opt.: loading dialog

This commit is contained in:
lollipopkit
2024-02-29 18:12:44 +08:00
parent 2137bfbcd0
commit 183fc7f160
13 changed files with 256 additions and 224 deletions

View File

@@ -148,9 +148,10 @@ class _EditorPageState extends State<EditorPage> {
// If path is not null, then it's a file editor
// save the text and return true to pop the page
if (widget.path != null) {
context.showLoadingDialog();
await File(widget.path!).writeAsString(_controller.text);
context.pop();
await context.showLoadingDialog(
fn: () => File(widget.path!).writeAsString(_controller.text),
);
context.pop(true);
return;
}