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

@@ -20,7 +20,7 @@ void setPermanentPasswordDialog(OverlayDialogManager dialogManager) async {
final p1 = TextEditingController(text: pw);
var validateLength = false;
var validateSame = false;
dialogManager.show((setState, close) {
dialogManager.show((setState, close, context) {
submit() async {
close();
dialogManager.showLoading(translate("Waiting"));
@@ -111,7 +111,7 @@ void setTemporaryPasswordLengthDialog(
var index = lengths.indexOf(length);
if (index < 0) index = 0;
length = lengths[index];
dialogManager.show((setState, close) {
dialogManager.show((setState, close, context) {
setLength(newValue) {
final oldValue = length;
if (oldValue == newValue) return;
@@ -160,7 +160,7 @@ void showServerSettingsWithValue(
String? relayServerMsg;
String? apiServerMsg;
dialogManager.show((setState, close) {
dialogManager.show((setState, close, context) {
Future<bool> validate() async {
if (idCtrl.text != oldCfg.idServer) {
final res = await validateAsync(idCtrl.text);