diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 42487379c..3070833e4 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -37,8 +37,8 @@ class MyTheme { } final ButtonStyle flatButtonStyle = TextButton.styleFrom( - minimumSize: Size(88, 36), - padding: EdgeInsets.symmetric(horizontal: 16.0), + minimumSize: Size(0, 36), + padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 10.0), shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(2.0)), ), diff --git a/flutter/lib/models/file_model.dart b/flutter/lib/models/file_model.dart index fc31db549..49184cf5b 100644 --- a/flutter/lib/models/file_model.dart +++ b/flutter/lib/models/file_model.dart @@ -144,7 +144,7 @@ class FileModel extends ChangeNotifier { notifyListeners(); } - overrideFileConfirm(Map evt) async { + overrideFileConfirm(Map evt) async { final resp = await showFileConfirmDialog( translate("Overwrite"), "${evt['read_path']}", true); if (false == resp) { @@ -418,53 +418,56 @@ class FileModel extends ChangeNotifier { Future showFileConfirmDialog( String title, String content, bool showCheckbox) async { + fileConfirmCheckboxRemember = false; return await DialogManager.show( - (setState, Function(bool? v) close) => CustomAlertDialog( - title: Row( - children: [ - Icon(Icons.warning, color: Colors.red), - SizedBox(width: 20), - Text(title) - ], - ), - content: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text(translate("This file exists, skip or overwrite this file?"), - style: TextStyle(fontWeight: FontWeight.bold)), - SizedBox(height: 5), - Text(content), - showCheckbox - ? CheckboxListTile( - contentPadding: const EdgeInsets.all(0), - dense: true, - controlAffinity: ListTileControlAffinity.leading, - title: Text( - translate("Do this for all conflicts"), - ), - value: fileConfirmCheckboxRemember, - onChanged: (v) { - if (v == null) return; - setState(() => fileConfirmCheckboxRemember = v); - }, - ) - : SizedBox.shrink() + (setState, Function(bool? v) close) => CustomAlertDialog( + title: Row( + children: [ + Icon(Icons.warning, color: Colors.red), + SizedBox(width: 20), + Text(title) + ], + ), + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + translate( + "This file exists, skip or overwrite this file?"), + style: TextStyle(fontWeight: FontWeight.bold)), + SizedBox(height: 5), + Text(content), + showCheckbox + ? CheckboxListTile( + contentPadding: const EdgeInsets.all(0), + dense: true, + controlAffinity: ListTileControlAffinity.leading, + title: Text( + translate("Do this for all conflicts"), + ), + value: fileConfirmCheckboxRemember, + onChanged: (v) { + if (v == null) return; + setState(() => fileConfirmCheckboxRemember = v); + }, + ) + : SizedBox.shrink() + ]), + actions: [ + TextButton( + style: flatButtonStyle, + onPressed: () => close(false), + child: Text(translate("Cancel"))), + TextButton( + style: flatButtonStyle, + onPressed: () => close(null), + child: Text(translate("Skip"))), + TextButton( + style: flatButtonStyle, + onPressed: () => close(true), + child: Text(translate("OK"))), ]), - actions: [ - TextButton( - style: flatButtonStyle, - onPressed: () => close(false), - child: Text(translate("Cancel"))), - TextButton( - style: flatButtonStyle, - onPressed: () => close(null), - child: Text(translate("Skip"))), - TextButton( - style: flatButtonStyle, - onPressed: () => close(true), - child: Text(translate("OK"))), - ]), useAnimation: false); }