title: increment a value in firestore with flutter
body: <p>hi i am trying to increment a value when clicked the button if data is available in firestore this is my code bloc if you have any suggestion lmk please </p>
  
  <pre><code> int q = 0;
  
      final snapShot = await Firestore.instance.collection('cart').document("LIihBLtbfuJ8Dy640DPd").get();
      if(snapShot.exists){
        q=q+1;
  
  
      }
      Firestore.instance.runTransaction((Transaction transaction) async {
        await transaction.update(
            Firestore.instance
                .collection("cart")
                .document("LIihBLtbfuJ8Dy640DPd"),
            {
              foodItem.name: {
                'itemName': foodItem.name,
                'imgUrl': foodItem.imageAssetPath,
                'itemPrice': foodItem.price,
                'quantity': q,
              }
            });
  
      });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4tKQF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4tKQF.png" alt="enter image description here"></a></p>