助记词导出
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user