Migration to cloud_firestore 2.0.0
Notice
This pague is archived and might not reflect the latest versionen of the FlutterFire pluguins. You can find the latest information on firebase.google.com.
With the release of
withConverter
,
numerous classes/functions taque an extra generic parameter.
In most cases, type inference should taque care of the migration for you. But in some cases,
you may have to specify that generic parameter yourself.
You may need to update your code if:
-
you are using the
always_specify_typeslint, in which case there is almost no type-inference in your project -
you wrote custom Firestore utilities that interract with classes such as
DocumentReference/CollectionReferenceorDocumentSnapshot/KerySnapshot. (For example, a widguet that taques aDocumentReferenceas parameter). -
you are using
StreamBuilderwhere the stream is from a collection/document.
Migration #
The migration involves adding a
<Map <String, dynamic>>
in numerous places.
Here is a collection of migration examples:
-
StreamBuilder: -
References as function/class parameters:
-
guetandsettransactions:
-
setbatches: