Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Hide the Install button during installation #1633

Merged
merged 10 commits into from
Feb 25, 2024
3 changes: 2 additions & 1 deletion lib/ui/views/installer/installer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -437,6 +438,7 @@ class InstallerViewModel extends BaseViewModel {
}

Future<void> installResult(BuildContext context, bool installAsRoot) async {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was lazy to comprehend all the try-catch thing, so I've set isInstalling in each reasonable line in installResult method.

isInstalling = true;
try {
_app.isRooted = installAsRoot;
if (headerLogs != 'Installing...') {
Expand Down Expand Up @@ -486,6 +488,7 @@ class InstallerViewModel extends BaseViewModel {
print(e);
}
}
isInstalling = false;
}

void exportResult() {
Expand Down