mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: pick images
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -550,6 +550,7 @@ class _CreatePanelState extends State<CreatePanel> {
|
||||
EasyThrottle.throttle(
|
||||
'imagePicker', const Duration(milliseconds: 500),
|
||||
() async {
|
||||
try {
|
||||
List<XFile> pickedFiles =
|
||||
await _imagePicker.pickMultiImage(
|
||||
limit: _limit,
|
||||
@@ -575,6 +576,9 @@ class _CreatePanelState extends State<CreatePanel> {
|
||||
_isEnableStream.add(true);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Ink(
|
||||
|
||||
@@ -448,6 +448,7 @@ class _EditProfilePageState extends State<EditProfilePage> {
|
||||
}
|
||||
|
||||
void _pickImg() async {
|
||||
try {
|
||||
XFile? pickedFile = await _imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 100,
|
||||
@@ -510,6 +511,9 @@ class _EditProfilePageState extends State<EditProfilePage> {
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ class _CreateFavPageState extends State<CreateFavPage> {
|
||||
}
|
||||
|
||||
void _pickImg() async {
|
||||
try {
|
||||
XFile? pickedFile = await _imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 100,
|
||||
@@ -157,6 +158,9 @@ class _CreateFavPageState extends State<CreateFavPage> {
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
dynamic leadingStyle = TextStyle(fontSize: 14);
|
||||
|
||||
@@ -361,6 +361,7 @@ class _ReplyPageState extends State<ReplyPage>
|
||||
EasyThrottle.throttle(
|
||||
'imagePicker', const Duration(milliseconds: 500),
|
||||
() async {
|
||||
try {
|
||||
List<XFile> pickedFiles =
|
||||
await _imagePicker.pickMultiImage(
|
||||
limit: _limit,
|
||||
@@ -383,6 +384,9 @@ class _ReplyPageState extends State<ReplyPage>
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -310,6 +310,7 @@ class _WhisperDetailPageState extends State<WhisperDetailPage> {
|
||||
if (snapshot.data == true) {
|
||||
_whisperDetailController.sendMsg();
|
||||
} else {
|
||||
try {
|
||||
XFile? pickedFile = await _imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 100,
|
||||
@@ -335,13 +336,17 @@ class _WhisperDetailPageState extends State<WhisperDetailPage> {
|
||||
'size': imageSize / 1024,
|
||||
};
|
||||
SmartDialog.showLoading(msg: '正在发送');
|
||||
await _whisperDetailController.sendMsg(picMsg: picMsg);
|
||||
await _whisperDetailController.sendMsg(
|
||||
picMsg: picMsg);
|
||||
} else {
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(result['msg']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
}
|
||||
},
|
||||
icon: Icon(snapshot.data == true
|
||||
|
||||
Reference in New Issue
Block a user