fix: disk parse

This commit is contained in:
lollipopkit
2024-05-09 14:51:41 +08:00
parent 8ed6a3869e
commit dc16574a04
12 changed files with 163 additions and 141 deletions

View File

@@ -67,6 +67,7 @@ extension DialogX on BuildContext {
Future<String?> showPwdDialog({
String? hostId,
String? title,
String? label,
}) async {
if (!mounted) return null;
return await showRoundDialog<String>(
@@ -82,7 +83,7 @@ extension DialogX on BuildContext {
_recoredPwd[hostId] = val;
}
},
label: l10n.pwd,
label: label ?? l10n.pwd,
),
);
}

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:toolbox/core/extension/context/dialog.dart';
import 'package:toolbox/core/extension/context/locale.dart';
import 'package:toolbox/data/model/server/server_private_info.dart';
import 'package:toolbox/data/res/provider.dart';
@@ -11,7 +12,10 @@ abstract final class KeybordInteractive {
BuildContext? ctx,
}) async {
try {
final res = await (ctx ?? Pros.app.ctx)?.showPwdDialog(title: spi.id);
final res = await (ctx ?? Pros.app.ctx)?.showPwdDialog(
title: '2FA ${l10n.pwd}',
label: spi.id,
);
return res == null ? null : [res];
} catch (e) {
return null;