页面逻辑
This commit is contained in:
@@ -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('检查更新'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user