diff --git a/lib/routes/user_routes.dart b/lib/routes/user_routes.dart index 983b999..f6d5f9d 100644 --- a/lib/routes/user_routes.dart +++ b/lib/routes/user_routes.dart @@ -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(), + ), + ], ), ], ); diff --git a/lib/views/user/index/widgets/user_top_bar.dart b/lib/views/user/index/widgets/user_top_bar.dart index 844045c..4b066f1 100644 --- a/lib/views/user/index/widgets/user_top_bar.dart +++ b/lib/views/user/index/widgets/user_top_bar.dart @@ -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(builder: (_) { return Row( crossAxisAlignment: CrossAxisAlignment.end, diff --git a/lib/views/user/qr_code/index_page.dart b/lib/views/user/qr_code/index_page.dart index 120192d..f46e75b 100644 --- a/lib/views/user/qr_code/index_page.dart +++ b/lib/views/user/qr_code/index_page.dart @@ -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 { 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, ), diff --git a/lib/views/user/serve/google/index_page.dart b/lib/views/user/serve/google/index_page.dart new file mode 100644 index 0000000..fe6600b --- /dev/null +++ b/lib/views/user/serve/google/index_page.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; + +class UserServeGooglePage extends StatefulWidget { + const UserServeGooglePage({Key? key}) : super(key: key); + + @override + State createState() => _UserServeGooglePageState(); +} + +class _UserServeGooglePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('谷歌验证器'), + ), + body: Container(), + ); + } +} diff --git a/lib/views/user/serve/index_page.dart b/lib/views/user/serve/index_page.dart index 306e54b..f9a129b 100644 --- a/lib/views/user/serve/index_page.dart +++ b/lib/views/user/serve/index_page.dart @@ -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 { appBar: AppBar( title: const Text('服务'), ), - body: Container(), + body: Column( + children: [ + ActionItem( + '谷歌验证器', + onTap: () { + Get.toNamed(UserRoutes.serveGoogle); + }, + ), + const Divider( + height: 0, + color: AppColors.border, + ), + ], + ), ); } }