助记词导出
This commit is contained in:
BIN
assets/images/logo.png
Normal file
BIN
assets/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -1,6 +1,12 @@
|
||||
import 'package:chat/models/user_info_model.dart';
|
||||
import 'package:chat/providers/auth_provider.dart';
|
||||
import 'package:chat/routes/auth_routes.dart';
|
||||
import 'package:chat/services/tim/apply_service.dart';
|
||||
import 'package:chat/services/tim/block_service.dart';
|
||||
import 'package:chat/services/tim/conversation_service.dart';
|
||||
import 'package:chat/services/tim/friend_service.dart';
|
||||
import 'package:chat/services/tim/group_service.dart';
|
||||
import 'package:chat/services/tim/message_service.dart';
|
||||
import 'package:chat/services/tim_service.dart';
|
||||
import 'package:chat/utils/hd_wallet.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -28,6 +34,7 @@ class AuthService extends GetxService {
|
||||
String get _userSig => _box.read('userSig') ?? '';
|
||||
String get _userToken => _box.read('userToken') ?? '';
|
||||
Map<String, dynamic> get _userInfo => _box.read('userInfo') ?? {};
|
||||
String get mnemonic => _box.read('mnemonic') ?? '';
|
||||
|
||||
/// 用户信息,这个数据,在更新用户资料的时候,也应该更新
|
||||
Rx<UserInfoModel> userInfo = UserInfoModel.empty().obs;
|
||||
@@ -92,6 +99,14 @@ class AuthService extends GetxService {
|
||||
|
||||
TimService.to.instance.logout();
|
||||
|
||||
/// 移除这些服务
|
||||
Get.delete<TimConversationService>();
|
||||
Get.delete<TimFriendService>();
|
||||
Get.delete<TimGroupService>();
|
||||
Get.delete<TimBlockService>();
|
||||
Get.delete<TimApplyService>();
|
||||
Get.delete<TimMessageService>();
|
||||
|
||||
userInfo.value = UserInfoModel.empty();
|
||||
isLogin.value = false;
|
||||
Get.offAllNamed(AuthRoutes.index);
|
||||
|
||||
@@ -210,7 +210,7 @@ class ImTools {
|
||||
}
|
||||
|
||||
static showTrtcMessage(String userID) {
|
||||
return showModalBottomSheet(
|
||||
showModalBottomSheet(
|
||||
context: Get.context!,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: AppColors.white,
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:chat/routes/moments_routes.dart';
|
||||
import 'package:chat/services/auth_service.dart';
|
||||
import 'package:chat/widgets/custom_avatar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -21,7 +20,7 @@ class MomentHeader extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SliverAppBar(
|
||||
systemOverlayStyle: SystemUiOverlayStyle.light,
|
||||
// systemOverlayStyle: SystemUiOverlayStyle.light,
|
||||
pinned: true,
|
||||
expandedHeight: 260,
|
||||
backgroundColor: AppColors.primary,
|
||||
|
||||
@@ -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