Undefined name "Firebase" following "FlutterFire Overview" tutorial

Viewed 328

I follow this page : https://firebase.flutter.dev/docs/overview/#initializing-flutterfire

Then I type the instruction:

await Firebase.initializeApp();

Like in the documentation, I have the error: 'Undefined name 'Firebase'. However, I the import is present in my file:

import 'package:firebase_core/firebase_core.dart';

Plus, when I type FirebaseApp in place of Firebase, FirebaseApp is recognized but not define initializeApp function.

Note that import is displayed as greyed import 'package:firebase_core/firebase_core.dart';

So Where is the problem ?

1 Answers

I've changed the version of each Firebase related packages to the latest ones (because, as suggested, the tutorial is for a new version than 0.4.0) and all works fine.

firebase_core: ^1.0.0
firebase_auth: ^1.0.1
cloud_firestore: ^1.0.3
Related