Home > front end >  Undefined name 'DefaultfirebaseOptions'. Try correcting the name to one that is defined, o
Undefined name 'DefaultfirebaseOptions'. Try correcting the name to one that is defined, o

Time:08-24

I Got This Weird Error:

"Undefined name 'DefaultfirebaseOptions' "

@override 
    Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Register"),
        ), 
      body:FutureBuilder(
        future: Firebase.initializeApp(
          options: DefaultfirebaseOptions.currentPlatform,
          ),
      builder: (context,snapshot) {
        switch (snapshot.connectionState) {
          case ConnectionState.done:```

CodePudding user response:

You need to set up Firebase on your project. Start with firebase init

Follow this enter image description here

then import the file

  • Related