huhx / flutter_oss_aliyun

阿里云oss sdk的flutter版本
MIT License
61 stars 22 forks source link

现在上传入参是List<int> fileData, 希望能加一个Uint8List fileData #21

Closed herowws closed 1 year ago

herowws commented 1 year ago

await Client().putObject( bytes, "test.txt", onSendProgress: (count, total) { debugPrint("sent = $count, total = $total"); }, onReceiveProgress: (count, total) { debugPrint("received = $count, total = $total"); } );

huhx commented 1 year ago

Uint8List 是实现了 List的,所以putObject第一个参数是可以接收Uint8List的吧。

abstract class Uint8List implements List<int>, _TypedIntList {
....
}

Uint8List来自于:library dart.typed_data;

测试代码:

final Response<dynamic> resp = await Client().putObject(
  Uint8List.fromList("aaa".codeUnits),
  "test.txt"
);