feat(ios):照片loading
This commit is contained in:
@@ -270,6 +270,7 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
Future<void> chooseCamera({
|
||||
required BuildContext context,
|
||||
int? max,
|
||||
bool? isShowLoading,
|
||||
}) async {
|
||||
//
|
||||
showCupertinoModalPopup(
|
||||
@@ -291,7 +292,7 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
CupertinoActionSheetAction(
|
||||
child: const Text('相册'),
|
||||
onPressed: () {
|
||||
openGallery();
|
||||
openGallery(isShowLoading: isShowLoading);
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
@@ -324,7 +325,7 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
}
|
||||
}
|
||||
|
||||
openGallery() async {
|
||||
openGallery({bool? isShowLoading}) async {
|
||||
int number = (widget.max ?? 9) - imagesList.length;
|
||||
// List<Media>? images =
|
||||
// await ImagesPicker.pick(count: number, pickType: PickType.image);
|
||||
@@ -336,6 +337,7 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
for (var element in images) {
|
||||
String path = await saveNetworkImgGallery(
|
||||
element.path,
|
||||
isShowLoading: isShowLoading,
|
||||
);
|
||||
list.add(path);
|
||||
}
|
||||
@@ -364,7 +366,8 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
}
|
||||
|
||||
// 保存网络图片
|
||||
Future<String> saveNetworkImgGallery(String path) async {
|
||||
Future<String> saveNetworkImgGallery(String path,
|
||||
{bool? isShowLoading}) async {
|
||||
String string = await UploadOss.upload(
|
||||
path,
|
||||
fileType: "jpg",
|
||||
@@ -374,6 +377,7 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
policy: widget.policy,
|
||||
callback: widget.callback,
|
||||
signature: widget.signature,
|
||||
isShowLoading: isShowLoading,
|
||||
);
|
||||
return string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user