portable-service: better prompt message

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-15 16:49:55 +08:00
parent abd665153b
commit ca8cb5a3b0
38 changed files with 131 additions and 124 deletions

View File

@@ -627,7 +627,7 @@ class CustomAlertDialog extends StatelessWidget {
}
}
void msgBox(String type, String title, String text, String link,
void msgBox(String id, String type, String title, String text, String link,
OverlayDialogManager dialogManager,
{bool? hasCancel}) {
dialogManager.dismissAll();
@@ -672,14 +672,17 @@ void msgBox(String type, String title, String text, String link,
if (link.isNotEmpty) {
buttons.insert(0, msgBoxButton(translate('JumpLink'), jumplink));
}
dialogManager.show((setState, close) => CustomAlertDialog(
title: _msgBoxTitle(title),
content: SelectableText(translate(text),
style: const TextStyle(fontSize: 15)),
actions: buttons,
onSubmit: hasOk ? submit : null,
onCancel: hasCancel == true ? cancel : null,
));
dialogManager.show(
(setState, close) => CustomAlertDialog(
title: _msgBoxTitle(title),
content:
SelectableText(translate(text), style: const TextStyle(fontSize: 15)),
actions: buttons,
onSubmit: hasOk ? submit : null,
onCancel: hasCancel == true ? cancel : null,
),
tag: '$id-$type-$title-$text-$link',
);
}
Widget msgBoxButton(String text, void Function() onPressed) {