我的二维码
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:chat/views/contact/index/index_page.dart';
|
||||
import 'package:chat/views/user/info/index_page.dart';
|
||||
import 'package:chat/views/user/info/nickname_page.dart';
|
||||
import 'package:chat/views/user/qr_code/index_page.dart';
|
||||
import 'package:chat/views/user/serve/google/index_page.dart';
|
||||
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/index_page.dart';
|
||||
@@ -29,6 +30,7 @@ abstract class UserRoutes {
|
||||
static const String infoNickname = '/user/info/nickname';
|
||||
|
||||
static const String serve = '/user/serve';
|
||||
static const String serveGoogle = '/user/serve/google';
|
||||
|
||||
static GetPage router = GetPage(
|
||||
name: UserRoutes.index,
|
||||
@@ -80,6 +82,12 @@ abstract class UserRoutes {
|
||||
GetPage(
|
||||
name: '/serve',
|
||||
page: () => const UserServePage(),
|
||||
children: [
|
||||
GetPage(
|
||||
name: '/google',
|
||||
page: () => const UserServeGooglePage(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -12,6 +12,7 @@ class UserTopBar extends StatelessWidget {
|
||||
const UserTopBar({Key? key}) : super(key: key);
|
||||
|
||||
final double paddingTop = 96;
|
||||
final double paddingBottom = 24;
|
||||
final double avatarHeight = 64;
|
||||
|
||||
@override
|
||||
@@ -22,9 +23,9 @@ class UserTopBar extends StatelessWidget {
|
||||
left: 24,
|
||||
top: paddingTop,
|
||||
right: 24,
|
||||
bottom: 24,
|
||||
bottom: paddingBottom,
|
||||
),
|
||||
// height: avatarHeight + paddingTop + 24,
|
||||
height: avatarHeight + paddingTop + paddingBottom,
|
||||
child: GetX<AuthService>(builder: (_) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:chat/configs/app_colors.dart';
|
||||
import 'package:chat/services/auth_service.dart';
|
||||
import 'package:chat/views/home/widgets/pop_menu_item.dart';
|
||||
import 'package:chat/views/public/scan_page.dart';
|
||||
import 'package:chat/widgets/custom_avatar.dart';
|
||||
@@ -43,34 +44,28 @@ class _UserQrCodePageState extends State<UserQrCodePage> {
|
||||
Row(
|
||||
children: [
|
||||
CustomAvatar(
|
||||
'',
|
||||
AuthService.to.userInfo.value.avatar,
|
||||
size: 64,
|
||||
radius: 6,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text(
|
||||
'Jason',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
],
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
AuthService.to.userInfo.value.nickname ?? '',
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
QrImage(
|
||||
data: 'BEFRIEND|5',
|
||||
data: 'BEFRIEND|${AuthService.to.userInfo.value.username}',
|
||||
version: 3,
|
||||
size: Get.width * 0.8,
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
const Text(
|
||||
'扫一扫上面的二维码,加我共力好友',
|
||||
'扫一扫上面的二维码,加我ZH-CHAT好友',
|
||||
style: TextStyle(
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
|
||||
20
lib/views/user/serve/google/index_page.dart
Normal file
20
lib/views/user/serve/google/index_page.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UserServeGooglePage extends StatefulWidget {
|
||||
const UserServeGooglePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<UserServeGooglePage> createState() => _UserServeGooglePageState();
|
||||
}
|
||||
|
||||
class _UserServeGooglePageState extends State<UserServeGooglePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('谷歌验证器'),
|
||||
),
|
||||
body: Container(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
import 'package:chat/configs/app_colors.dart';
|
||||
import 'package:chat/routes/user_routes.dart';
|
||||
import 'package:chat/views/home/widgets/action_item.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class UserServePage extends StatefulWidget {
|
||||
const UserServePage({Key? key}) : super(key: key);
|
||||
@@ -14,7 +18,20 @@ class _UserServePageState extends State<UserServePage> {
|
||||
appBar: AppBar(
|
||||
title: const Text('服务'),
|
||||
),
|
||||
body: Container(),
|
||||
body: Column(
|
||||
children: [
|
||||
ActionItem(
|
||||
'谷歌验证器',
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.serveGoogle);
|
||||
},
|
||||
),
|
||||
const Divider(
|
||||
height: 0,
|
||||
color: AppColors.border,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user