Skip to content

Commit

Permalink
feat: add continue anyway button to select from storage dialog (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrisas authored Apr 29, 2023
1 parent 7230152 commit affba66
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"viewTitle": "Select an application",
"searchBarHint": "Search applications",
"selectFromStorageButton": "Select from storage",
"continueAnywayButton": "Continue anyway",
"storageButton": "Storage",
"errorMessage": "Unable to use selected application",
"downloadToast": "Download function is not available yet",
Expand Down
1 change: 1 addition & 0 deletions lib/ui/views/app_selector/app_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
)
: model.showSelectFromStorageDialog(
context,
app,
);
},
),
Expand Down
19 changes: 18 additions & 1 deletion lib/ui/views/app_selector/app_selector_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class AppSelectorViewModel extends BaseViewModel {
locator<PatcherViewModel>().loadLastSelectedPatches();
}

Future showSelectFromStorageDialog(BuildContext context) async {
Future showSelectFromStorageDialog(
BuildContext context, ApplicationWithIcon app) async {
return showDialog(
context: context,
builder: (context) => SimpleDialog(
Expand Down Expand Up @@ -132,6 +133,22 @@ class AppSelectorViewModel extends BaseViewModel {
],
),
),
CustomMaterialButton(
isFilled: false,
onPressed: () => selectApp(app).then(
(_) {
Navigator.pop(context);
Navigator.pop(context);
},
),
label: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(width: 10),
I18nText('appSelectorView.continueAnywayButton'),
],
),
),
],
),
);
Expand Down

0 comments on commit affba66

Please sign in to comment.