dart.global.firebase.storage 为空
dart.global.firebase.storage is null
我在 main 方法中初始化 firebase
void main() {
fb.initializeApp(
apiKey: "123",
authDomain: "123",
databaseURL: "123",
projectId: "123",
storageBucket: "123",
messagingSenderId: "123");
runApp(ng.AppComponentNgFactory, createInjector: injector);
}
然后在一个组件中,我导入 firebase:
import 'package:firebase/firebase.dart' as fb;
最后我尝试使用存储:
fb.storage();
但是,我得到一个空指针:
EXCEPTION: NoSuchMethodError: tried to call a non-function, such as null: 'dart.global.firebase.storage'
STACKTRACE:
packages/firebase/src/top_level.ddc.js 64:100 storage
查看 firebase dart 包文档,如果您想使用存储,您似乎需要添加一个额外的脚本。
参见:https://pub.dartlang.org/documentation/firebase/latest/#do-you-need-to-use-firestore
我在 main 方法中初始化 firebase
void main() {
fb.initializeApp(
apiKey: "123",
authDomain: "123",
databaseURL: "123",
projectId: "123",
storageBucket: "123",
messagingSenderId: "123");
runApp(ng.AppComponentNgFactory, createInjector: injector);
}
然后在一个组件中,我导入 firebase:
import 'package:firebase/firebase.dart' as fb;
最后我尝试使用存储:
fb.storage();
但是,我得到一个空指针:
EXCEPTION: NoSuchMethodError: tried to call a non-function, such as null: 'dart.global.firebase.storage'
STACKTRACE:
packages/firebase/src/top_level.ddc.js 64:100 storage
查看 firebase dart 包文档,如果您想使用存储,您似乎需要添加一个额外的脚本。
参见:https://pub.dartlang.org/documentation/firebase/latest/#do-you-need-to-use-firestore