我有图像的网络网址,我需要得到Uint8List。如何转换?我在类似的问题中检查答案,但这些方法不起作用。How to get a Flutter Uint8List from a Network Image?
发布于 2021-03-29 10:41:58
这对我来说很有用:
import 'dart:typed_data';
import 'package:flutter/services.dart';
//Get the image from the URL and then convert it to Uint8List
Uint8List bytes = (await NetworkAssetBundle(Uri.parse('https://some_image_url.png'))
.load('https://some_image_url.png'))
.buffer
.asUint8List();
https://stackoverflow.com/questions/59894880
复制相似问题