title: The property 'quantity' can't be unconditionally accessed because the receiver can be 'null'. Try making the access conditional (using '?.')
body: <p>Relevent code</p>
  <pre><code>import 'package:flutter/foundation.dart';
  
  class CartItem {
    final String id;
    final String title;
    final int quantity;
    final double price;
  
    CartItem({
      required this.id,
      required this.title,
      required this.quantity,
      required this.price,
    });
  }
  
  class Cart with ChangeNotifier {
    Map&lt;String, CartItem&gt; _items = {}; // see that I have initialized the items
  </code></pre>
  <p>The code where I am getting the null safety error 'The property 'quantity' can't be unconditionally accessed because the receiver can be 'null'.
  Try making the access conditional (using '?.') or adding a null check to the target ('!').' The error I am getting is on the below <em>quantity</em> variable. I am not sure how to fix it. I have watched videos which talked about int?, ! and ?: operators but this particular scenario was not covered.</p>
  <pre><code>if (_items[productID].quantity == 1) _items.remove(productID);
  </code></pre>
  <p>Additional questions, what is the receiver here that the error is point to which can be null?</p>