From 3e696d6847a9870e8a10be677645f8791ef75dfe Mon Sep 17 00:00:00 2001 From: "Eray Erdin (&mut self)" Date: Sun, 25 Feb 2024 23:48:52 +0300 Subject: [PATCH] feat: Hide the Install button during installation (#1633) Co-authored-by: Ushie --- lib/ui/views/installer/installer_view.dart | 3 ++- lib/ui/views/installer/installer_viewmodel.dart | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index c576a6a2..c3175b7f 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -30,7 +30,8 @@ class InstallerView extends StatelessWidget { bottom: model.isPatching, child: Scaffold( floatingActionButton: Visibility( - visible: !model.isPatching && !model.hasErrors, + visible: + !model.isPatching && !model.hasErrors && !model.isInstalling, child: HapticFloatingActionButtonExtended( label: Text( model.isInstalled diff --git a/lib/ui/views/installer/installer_viewmodel.dart b/lib/ui/views/installer/installer_viewmodel.dart index d47836de..d2a8c7f5 100644 --- a/lib/ui/views/installer/installer_viewmodel.dart +++ b/lib/ui/views/installer/installer_viewmodel.dart @@ -37,6 +37,7 @@ class InstallerViewModel extends BaseViewModel { String headerLogs = ''; bool isRooted = false; bool isPatching = true; + bool isInstalling = false; bool isInstalled = false; bool hasErrors = false; bool isCanceled = false; @@ -437,6 +438,7 @@ class InstallerViewModel extends BaseViewModel { } Future installResult(BuildContext context, bool installAsRoot) async { + isInstalling = true; try { _app.isRooted = installAsRoot; if (headerLogs != 'Installing...') { @@ -486,6 +488,7 @@ class InstallerViewModel extends BaseViewModel { print(e); } } + isInstalling = false; } void exportResult() {