在下面的我的代码中,当我尝试在iOS上构建它时,出现了未定义的将来错误。但是,当我在Android上构建时,这组代码有效。
StorageReference ref = FirebaseStorage.instance.ref().child("$requestId.jpg");
StorageUploadTask uploadTask = ref.put(imageFile);
Uri downloadUrl = (await uploadTask.future).downloadUrl ;
错误消息:
The getter 'future' isn't defined for the class 'firebase_storage::StorageUploadTask'.
compiler message: Try correcting the name to the name of an existing getter, or defining a getter or field named 'future'.
Flutter Doctor输出:
Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale en-SG)
iOS toolchain - develop for iOS devices (Xcode 9.4.1)