Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在将 Uint8List 图像转换为 Flutter Web 上的文件时遇到问题,因为 dart:io 在 Web 上不受支持,我需要将其作为文件才能将其上传到 FirebaseStorage,有什么解决方法吗?谢谢你
由于dart:io在网络上不可用,您可以使用该universal_io软件包。
dart:io
universal_io
将其添加到您的pubspec.yaml.
pubspec.yaml
import 'package:universal_io/io.dart'; File createFileFromBytes(Uint8List bytes) => File.fromRawPath(bytes);