助记词导出

This commit is contained in:
2022-10-31 11:42:14 +08:00
parent 52d775dd78
commit 55a1801895
5 changed files with 62 additions and 4 deletions

View File

@@ -1,6 +1,10 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/utils/ui_tools.dart';
import 'package:chat/views/home/widgets/action_item.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
class UserSettingSafePage extends StatefulWidget {
const UserSettingSafePage({Key? key}) : super(key: key);
@@ -20,7 +24,47 @@ class _UserSettingSafePageState extends State<UserSettingSafePage> {
children: [
ActionItem(
'导出助记词',
onTap: () {},
onTap: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: AppColors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(8)),
),
builder: (context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 16),
const Text('您的助记词'),
Container(
padding: const EdgeInsets.all(32),
child: Text(
AuthService.to.mnemonic,
style: const TextStyle(
fontSize: 18,
),
),
),
ElevatedButton(
onPressed: () {
Clipboard.setData(
ClipboardData(
text: AuthService.to.mnemonic,
),
);
UiTools.toast('复制成功');
Get.back();
},
child: const Text('复制'),
),
const SizedBox(height: 16),
],
);
},
);
},
),
const Divider(
height: 0,