【问题标题】:Undefined name 'DefaultfirebaseOptions'. Try correcting the name to one that is defined, or defining the name未定义的名称 \'DefaultfirebaseOptions\'。尝试将名称更正为已定义的名称,或定义名称
【发布时间】:2022-08-22 21:12:16
【问题描述】:

我遇到了这个奇怪的错误:

\"未定义名称\'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:```

    标签: flutter firebase dart


    【解决方案1】:

    您需要在您的项目上设置 Firebase。以firebase init 开头

    关注这个docs

    你会得到类似的

    然后导入文件

    【讨论】:

      猜你喜欢
      • 2020-09-03
      • 2023-02-07
      • 2022-06-10
      • 1970-01-01
      • 2021-11-28
      • 2020-01-28
      • 2020-11-01
      • 2021-03-24
      • 1970-01-01
      相关资源
      最近更新 更多