我的二维码

This commit is contained in:
2022-10-31 11:58:17 +08:00
parent 55a1801895
commit b7f0fe3ac8
5 changed files with 59 additions and 18 deletions

View File

@@ -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/index_page.dart';
import 'package:chat/views/user/info/nickname_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/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/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';
@@ -29,6 +30,7 @@ abstract class UserRoutes {
static const String infoNickname = '/user/info/nickname'; static const String infoNickname = '/user/info/nickname';
static const String serve = '/user/serve'; static const String serve = '/user/serve';
static const String serveGoogle = '/user/serve/google';
static GetPage router = GetPage( static GetPage router = GetPage(
name: UserRoutes.index, name: UserRoutes.index,
@@ -80,6 +82,12 @@ abstract class UserRoutes {
GetPage( GetPage(
name: '/serve', name: '/serve',
page: () => const UserServePage(), page: () => const UserServePage(),
children: [
GetPage(
name: '/google',
page: () => const UserServeGooglePage(),
),
],
), ),
], ],
); );

View File

@@ -12,6 +12,7 @@ class UserTopBar extends StatelessWidget {
const UserTopBar({Key? key}) : super(key: key); const UserTopBar({Key? key}) : super(key: key);
final double paddingTop = 96; final double paddingTop = 96;
final double paddingBottom = 24;
final double avatarHeight = 64; final double avatarHeight = 64;
@override @override
@@ -22,9 +23,9 @@ class UserTopBar extends StatelessWidget {
left: 24, left: 24,
top: paddingTop, top: paddingTop,
right: 24, right: 24,
bottom: 24, bottom: paddingBottom,
), ),
// height: avatarHeight + paddingTop + 24, height: avatarHeight + paddingTop + paddingBottom,
child: GetX<AuthService>(builder: (_) { child: GetX<AuthService>(builder: (_) {
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,

View File

@@ -1,4 +1,5 @@
import 'package:chat/configs/app_colors.dart'; 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/home/widgets/pop_menu_item.dart';
import 'package:chat/views/public/scan_page.dart'; import 'package:chat/views/public/scan_page.dart';
import 'package:chat/widgets/custom_avatar.dart'; import 'package:chat/widgets/custom_avatar.dart';
@@ -43,34 +44,28 @@ class _UserQrCodePageState extends State<UserQrCodePage> {
Row( Row(
children: [ children: [
CustomAvatar( CustomAvatar(
'', AuthService.to.userInfo.value.avatar,
size: 64, size: 64,
radius: 6, radius: 6,
), ),
const SizedBox(width: 8), const SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text( Text(
'Jason', AuthService.to.userInfo.value.nickname ?? '',
style: TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 24,
), ),
), ),
SizedBox(height: 8),
],
),
], ],
), ),
const SizedBox(height: 32), const SizedBox(height: 32),
QrImage( QrImage(
data: 'BEFRIEND|5', data: 'BEFRIEND|${AuthService.to.userInfo.value.username}',
version: 3, version: 3,
size: Get.width * 0.8, size: Get.width * 0.8,
), ),
const SizedBox(height: 32), const SizedBox(height: 32),
const Text( const Text(
'扫一扫上面的二维码,加我共力好友', '扫一扫上面的二维码,加我ZH-CHAT好友',
style: TextStyle( style: TextStyle(
color: AppColors.unactive, color: AppColors.unactive,
), ),

View 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(),
);
}
}

View File

@@ -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:flutter/material.dart';
import 'package:get/get.dart';
class UserServePage extends StatefulWidget { class UserServePage extends StatefulWidget {
const UserServePage({Key? key}) : super(key: key); const UserServePage({Key? key}) : super(key: key);
@@ -14,7 +18,20 @@ class _UserServePageState extends State<UserServePage> {
appBar: AppBar( appBar: AppBar(
title: const Text('服务'), title: const Text('服务'),
), ),
body: Container(), body: Column(
children: [
ActionItem(
'谷歌验证器',
onTap: () {
Get.toNamed(UserRoutes.serveGoogle);
},
),
const Divider(
height: 0,
color: AppColors.border,
),
],
),
); );
} }
} }