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_types
lint, in which case there is almost no type-inference in your projectyou wrote custom Firestore utilities that interact with classes such as
DocumentReference
/CollectionReference
orDocumentSnapshot
/QuerySnapshot
. (For example, a widget that takes aDocumentReference
as parameter).you are using
StreamBuilder
where the stream is from a collection/document.
#
MigrationThe migration involves adding a <Map<String, dynamic>>
in numerous places.
Here is a collection of migration examples:
StreamBuilder
:References as function/class parameters:
get
andset
transactions:
set
batches: