class 'FirebaseStorage' 没有未命名的构造函数

The class 'FirebaseStorage' doesn't have an unnamed constructor

我已经克隆了一个 git 来构建一个应用程序。在存储部分,我有以下代码:

class StorageRepo {
  FirebaseStorage storage = FirebaseStorage(
    storageBucket: ''
  );

但是它给我错误:

The class 'FirebaseStorage' doesn't have an unnamed constructor.

怎么了?

根据链接的 documentation Doug,为特定存储桶创建 FirebaseStorage 对象是通过以下方式完成的:

firebase_storage.FirebaseStorage storage =
  firebase_storage.FirebaseStorage.instanceFor(
      bucket: 'secondary-storage-bucket');