chore: display loading during image upload (#3503)

pull/2245/head
ggurdin 4 months ago committed by GitHub
parent e59e314628
commit cc9fa75c34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -172,6 +172,7 @@ class ActivityPlannerBuilderState extends State<ActivityPlannerBuilder> {
if (mounted) {
setState(() {
avatar = bytes;
imageURL = null;
filename = photo.singleOrNull?.name;
});
}

@ -56,8 +56,13 @@ class ActivitySuggestionDialogState extends State<ActivitySuggestionDialog> {
: MediaQuery.of(context).size.width;
Future<void> _launchActivity() async {
try {
setState(() {
_loading = true;
_error = null;
});
if (widget.onLaunch != null) {
await widget.controller.updateImageURL();
widget.onLaunch!.call();
Navigator.of(context).pop();
} else if (widget.controller.room != null &&
@ -73,6 +78,22 @@ class ActivitySuggestionDialogState extends State<ActivitySuggestionDialog> {
} else {
_setPageMode(_PageMode.roomSelection);
}
} catch (e, s) {
_error = e;
ErrorHandler.logError(
e: e,
s: s,
data: {
"request": widget.controller.updatedRequest.toJson(),
},
);
} finally {
if (mounted) {
setState(() {
_loading = false;
});
}
}
}
void _setPageMode(_PageMode mode) {

Loading…
Cancel
Save