feat: implement dialog callback

This commit is contained in:
Kingtous
2023-05-08 12:34:19 +08:00
parent 19f81ad317
commit 77fa807b57
55 changed files with 734 additions and 554 deletions

View File

@@ -589,7 +589,7 @@ void setPasswordDialog() async {
MinCharactersValidationRule(8),
];
gFFI.dialogManager.show((setState, close) {
gFFI.dialogManager.show((setState, close, context) {
submit() {
setState(() {
errMsg0 = "";

View File

@@ -2016,7 +2016,7 @@ void changeSocks5Proxy() async {
RxBool obscure = true.obs;
var isInProgress = false;
gFFI.dialogManager.show((setState, close) {
gFFI.dialogManager.show((setState, close, context) {
submit() async {
setState(() {
proxyMsg = '';

View File

@@ -643,7 +643,7 @@ class _FileManagerViewState extends State<FileManagerView> {
MenuButton(
onPressed: () {
final name = TextEditingController();
_ffi.dialogManager.show((setState, close) {
_ffi.dialogManager.show((setState, close, context) {
submit() {
if (name.value.text.isNotEmpty) {
controller.createDir(PathUtil.join(

View File

@@ -293,7 +293,7 @@ class _InstallPageBodyState extends State<_InstallPageBody>
),
];
gFFI.dialogManager.show(
(setState, close) => CustomAlertDialog(
(setState, close, context) => CustomAlertDialog(
title: null,
content: SelectionArea(
child:

View File

@@ -204,7 +204,7 @@ showKBLayoutTypeChooser(
String localPlatform,
OverlayDialogManager dialogManager,
) {
dialogManager.show((setState, close) {
dialogManager.show((setState, close, context) {
return CustomAlertDialog(
title:
Text('${translate('Select local keyboard type')} ($localPlatform)'),

View File

@@ -687,7 +687,7 @@ Future<bool> toggleMaximize(bool isMainWindow) async {
Future<bool> closeConfirmDialog() async {
var confirm = true;
final res = await gFFI.dialogManager.show<bool>((setState, close) {
final res = await gFFI.dialogManager.show<bool>((setState, close, context) {
submit() {
final opt = "enable-confirm-closing-tabs";
String value = bool2option(opt, confirm);