登录逻辑

This commit is contained in:
2022-10-21 14:03:48 +08:00
parent 30a9279ff1
commit 4bf03d234b
11 changed files with 154 additions and 135 deletions

View File

@@ -37,36 +37,41 @@ class _AuthImportPageState extends State<AuthImportPage> {
appBar: AppBar(
title: const Text('导入账户'),
),
body: Column(
children: [
TextField(
controller: _editingController,
maxLines: 4,
decoration: const InputDecoration(
hintText: '请输入您的助记词',
border: OutlineInputBorder(
borderSide: BorderSide(
color: AppColors.border,
width: 0.4,
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
TextField(
controller: _editingController,
maxLines: 5,
decoration: const InputDecoration(
hintText: '请输入您的助记词,以空格分割单词或汉字',
border: OutlineInputBorder(
borderSide: BorderSide(
color: AppColors.border,
width: 0.4,
),
),
),
),
),
const Text('支持导入所有遵循BIP标准生成的助记词'),
ElevatedButton(
onPressed: () async {
String? address =
HDWallet.mnemonicToAddress(_editingController.text);
if (address != null) {
var result = await AuthService.to.login(address);
if (result) {
Get.offAllNamed(AppRoutes.app);
const SizedBox(height: 16),
const Text('支持导入所有遵循BIP标准生成的助记词'),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
String? address =
HDWallet.mnemonicToAddress(_editingController.text);
if (address != null) {
var result = await AuthService.to.login(address);
if (result) {
Get.offAllNamed(AppRoutes.app);
}
}
}
},
child: const Text('开始导入'),
),
],
},
child: const Text('开始导入'),
),
],
),
),
);
}