我的二维码

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

@@ -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,

View File

@@ -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,
),

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: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,
),
],
),
);
}
}