Reputation: 13
Error Image:https://i.sstatic.net/SZLOO.png
I cannot use Firestore.instance even after importing the required package(cloud_firestore).I have uploaded the image showing the error.Please consider helping.
I have imported the following in pubspec.yaml
name: fluttershare
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.16.0+1
image_picker: ^0.6.7+22
firebase_core: ^0.7.0
firebase_storage: ^7.0.0
firebase_auth: ^0.20.0+1
google_sign_in: ^4.5.9
geolocator: ^6.2.0
uuid: ^2.2.2
image: ^2.1.19
animator: ^2.0.2
path_provider: ^1.6.27
firebase_messaging: ^6.0.16
timeago: ^2.0.29
cached_network_image:
flutter_svg:
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
fonts:
- family: Signatra
fonts:
- asset: assets/fonts/Signatra.ttf
assets:
- assets/images/google_signin_button.png
- assets/images/upload.svg
- assets/images/search.svg
- assets/images/activity_feed.svg
- assets/images/no_content.svg
Upvotes: 1
Views: 1062
Reputation: 256
I see that you are using the latest version of the package.
use
FirebaseFirestore.instance.collection();
instead of
Firestore.instance.collection();
Upvotes: 2