u
This commit is contained in:
@@ -8,7 +8,9 @@ import 'package:chat/views/user/serve/index_page.dart';
|
|||||||
import 'package:chat/views/user/setting/about/index_page.dart';
|
import 'package:chat/views/user/setting/about/index_page.dart';
|
||||||
import 'package:chat/views/user/setting/index_page.dart';
|
import 'package:chat/views/user/setting/index_page.dart';
|
||||||
import 'package:chat/views/user/setting/privacy/index_page.dart';
|
import 'package:chat/views/user/setting/privacy/index_page.dart';
|
||||||
|
import 'package:chat/views/user/setting/safe/email_page.dart';
|
||||||
import 'package:chat/views/user/setting/safe/index_page.dart';
|
import 'package:chat/views/user/setting/safe/index_page.dart';
|
||||||
|
import 'package:chat/views/user/setting/safe/mobile_page.dart';
|
||||||
import 'package:chat/views/user/setting/sugguest/index_page.dart';
|
import 'package:chat/views/user/setting/sugguest/index_page.dart';
|
||||||
import 'package:chat/views/user/share/index_page.dart';
|
import 'package:chat/views/user/share/index_page.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -22,6 +24,8 @@ abstract class UserRoutes {
|
|||||||
static const String settingPrivacy = '/user/setting/privacy';
|
static const String settingPrivacy = '/user/setting/privacy';
|
||||||
static const String settingAbout = '/user/setting/about';
|
static const String settingAbout = '/user/setting/about';
|
||||||
static const String settingSafe = '/user/setting/safe';
|
static const String settingSafe = '/user/setting/safe';
|
||||||
|
static const String settingSafeEmail = '/user/setting/safe/email';
|
||||||
|
static const String settingSafeMobile = '/user/setting/safe/mobile';
|
||||||
static const String settingSugguest = '/user/setting/sugguest';
|
static const String settingSugguest = '/user/setting/sugguest';
|
||||||
|
|
||||||
static const String share = '/user/share';
|
static const String share = '/user/share';
|
||||||
@@ -62,6 +66,16 @@ abstract class UserRoutes {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: '/safe',
|
name: '/safe',
|
||||||
page: () => const UserSettingSafePage(),
|
page: () => const UserSettingSafePage(),
|
||||||
|
children: [
|
||||||
|
GetPage(
|
||||||
|
name: '/email',
|
||||||
|
page: () => const UserSettingSafeEmailPage(),
|
||||||
|
),
|
||||||
|
GetPage(
|
||||||
|
name: '/mobile',
|
||||||
|
page: () => const UserSettingSafeMobilePage(),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: '/sugguest',
|
name: '/sugguest',
|
||||||
|
|||||||
15
lib/views/user/setting/safe/email_page.dart
Normal file
15
lib/views/user/setting/safe/email_page.dart
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class UserSettingSafeEmailPage extends StatelessWidget {
|
||||||
|
const UserSettingSafeEmailPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('绑定邮箱'),
|
||||||
|
),
|
||||||
|
body: Container(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:chat/configs/app_colors.dart';
|
import 'package:chat/configs/app_colors.dart';
|
||||||
|
import 'package:chat/routes/user_routes.dart';
|
||||||
import 'package:chat/services/auth_service.dart';
|
import 'package:chat/services/auth_service.dart';
|
||||||
import 'package:chat/utils/ui_tools.dart';
|
import 'package:chat/utils/ui_tools.dart';
|
||||||
import 'package:chat/views/home/widgets/action_item.dart';
|
import 'package:chat/views/home/widgets/action_item.dart';
|
||||||
@@ -26,61 +27,70 @@ class _UserSettingSafePageState extends State<UserSettingSafePage> {
|
|||||||
'导出助记词',
|
'导出助记词',
|
||||||
isFirst: true,
|
isFirst: true,
|
||||||
isLast: true,
|
isLast: true,
|
||||||
onTap: () {
|
onTap: _showMnemonic,
|
||||||
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 SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
ActionItem(
|
ActionItem(
|
||||||
'绑定手机',
|
'绑定手机',
|
||||||
isFirst: true,
|
isFirst: true,
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(UserRoutes.settingSafeMobile);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
ActionItem(
|
ActionItem(
|
||||||
'绑定邮箱',
|
'绑定邮箱',
|
||||||
isLast: true,
|
isLast: true,
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(UserRoutes.settingSafeEmail);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _showMnemonic() {
|
||||||
|
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: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
wordSpacing: 6,
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
Clipboard.setData(
|
||||||
|
ClipboardData(
|
||||||
|
text: AuthService.to.mnemonic,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
UiTools.toast('复制成功');
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: const Text('复制'),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
lib/views/user/setting/safe/mobile_page.dart
Normal file
15
lib/views/user/setting/safe/mobile_page.dart
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class UserSettingSafeMobilePage extends StatelessWidget {
|
||||||
|
const UserSettingSafeMobilePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('绑定手机'),
|
||||||
|
),
|
||||||
|
body: Container(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user