0
votes

If I add this line: final databaseReference = FirebaseFirestore.instance;

I am getting this error:

../../../../.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.4/lib/src/collection_reference.dart:42:29: Error: The name of a constructor must match the name of the enclosing class. Future tabs.add(Map<String, dynamic> data) async { ^^^^ ../../../../.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.4/lib/src/collection_reference.dart:42:3: Error: Constructors can't have a return type. Try removing the return type. Future tabs.add(Map<String, dynamic> data) async { ^^^^^^ ../../../../.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.4/lib/src/collection_reference.dart:46:5: Error: Constructors can't have a return type. Try removing the return type. return newDocument; ^ ../../../../.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.4/lib/src/collection_reference.dart:42:71: Error: Constructor bodies can't use 'async', 'async*', or 'sync*'. Future tabs.add(Map<String, dynamic> data) async { ^ ../../../../.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.4/lib/src/collection_reference.dart:42:29: Error: Final field '_delegate' is not initialized by this constructor. Try to initialize the field using an initializing formal or a field initializer. Future tabs.add(Map<String, dynamic> data) async { ^^^ ../../../../.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.14.4/lib/src/collection_reference.dart:11:37: Context: '_delegate' is defined here. final CollectionReferencePlatform _delegate; ^^^^^^^^^

1
have you tried using flutter clean?Luis Utrera
Yes flutter clean and Invalidate caches / Restart. Did not help.sativa

1 Answers

0
votes

After deleting flutter and downloading it again. It worked