页面逻辑

This commit is contained in:
2022-10-20 16:08:27 +08:00
parent 8ad451d4d8
commit 0a81762ba1
12 changed files with 197 additions and 25 deletions

View File

@@ -1,4 +1,8 @@
import 'package:chat/routes/user_routes.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/widgets/custom_avatar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class UserPage extends StatefulWidget {
const UserPage({Key? key}) : super(key: key);
@@ -10,9 +14,55 @@ class UserPage extends StatefulWidget {
class _UserPageState extends State<UserPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('我的'),
return SafeArea(
child: Scaffold(
body: Column(
children: [
GetX<AuthService>(builder: (_) {
return Row(
children: [
CustomAvatar(
_.userInfo.value.avatar,
size: 72,
),
Column(
children: [
Text(_.userInfo.value.nickname),
Text('${_.userInfo.value.address}'),
],
),
Expanded(child: Container()),
InkWell(
onTap: () {
Get.toNamed(UserRoutes.qrCode);
},
child: Row(
children: const [
Icon(Icons.qr_code),
Icon(Icons.arrow_forward_ios),
],
),
),
],
);
}),
ListTile(
onTap: () {
Get.toNamed(UserRoutes.share);
},
title: const Text('分享邀请'),
),
ListTile(
onTap: () {
Get.toNamed(UserRoutes.setting);
},
title: const Text('设置中心'),
),
const ListTile(
title: Text('检查更新'),
),
],
),
),
);
}