Migration to cloud_firestore 2.0.0
Notice
This page is archived and might not reflect the latest version of the FlutterFire plugins. You can find the latest information on firebase.google.com.
With the release of withConverter,
numerous classes/functions take an extra generic parameter.
In most cases, type inference should take 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 projectyou wrote custom Firestore utilities that interact with classes such as
DocumentReference/CollectionReferenceorDocumentSnapshot/QuerySnapshot. (For example, a widget that takes 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:
getandsettransactions:
setbatches: