feat: Hide the Install button during installation (#1633)

Co-authored-by: Ushie <ushiekane@gmail.com>
This commit is contained in:
Eray Erdin (&mut self) 2024-02-25 23:48:52 +03:00 committed by GitHub
parent 28d6ab692e
commit 3e696d6847
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -30,7 +30,8 @@ class InstallerView extends StatelessWidget {
bottom: model.isPatching, bottom: model.isPatching,
child: Scaffold( child: Scaffold(
floatingActionButton: Visibility( floatingActionButton: Visibility(
visible: !model.isPatching && !model.hasErrors, visible:
!model.isPatching && !model.hasErrors && !model.isInstalling,
child: HapticFloatingActionButtonExtended( child: HapticFloatingActionButtonExtended(
label: Text( label: Text(
model.isInstalled model.isInstalled

View File

@ -37,6 +37,7 @@ class InstallerViewModel extends BaseViewModel {
String headerLogs = ''; String headerLogs = '';
bool isRooted = false; bool isRooted = false;
bool isPatching = true; bool isPatching = true;
bool isInstalling = false;
bool isInstalled = false; bool isInstalled = false;
bool hasErrors = false; bool hasErrors = false;
bool isCanceled = false; bool isCanceled = false;
@ -437,6 +438,7 @@ class InstallerViewModel extends BaseViewModel {
} }
Future<void> installResult(BuildContext context, bool installAsRoot) async { Future<void> installResult(BuildContext context, bool installAsRoot) async {
isInstalling = true;
try { try {
_app.isRooted = installAsRoot; _app.isRooted = installAsRoot;
if (headerLogs != 'Installing...') { if (headerLogs != 'Installing...') {
@ -486,6 +488,7 @@ class InstallerViewModel extends BaseViewModel {
print(e); print(e);
} }
} }
isInstalling = false;
} }
void exportResult() { void exportResult() {