I'm new to Flutter and Firestore and feel I am missing something basic in how to handle doubles and Firebase. I have Flutter code reading and writing Strings and int to Firestore and all is well. When I set up a Firestore field as number life get complicated. If in flutter I define a variable as num (and ignore the Flutter double data type) all is well. If I define the Flutter variable as double nothing works, unless I ensure the Firestore number field has say 10.2 (or whatever value with a decimal point). A value of 10 will crash the app!
Should I just always use num in Flutter and not use double? Any implications?
With the code reading from Firestore ( propertyLandArea: snapshot.data['propertyLandArea'] ?? 10.5,) should I do checks or somehow ensure properyLandArea is assigned a double. Using something simple like snapshot.data['propertyLandArea'].toDouble is not possible.
Should I just use int, and know the number of decimal places required so can display and save correctly (if I don't forget to convert somewhere).