用户中心调整

This commit is contained in:
2022-10-26 10:29:16 +08:00
parent c10308bdff
commit 69f0a7a81e
14 changed files with 202 additions and 49 deletions

View File

@@ -0,0 +1,80 @@
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:chat/views/user/index/widgets/user_top_bar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class UserPage extends StatefulWidget {
const UserPage({Key? key}) : super(key: key);
@override
_UserPageState createState() => _UserPageState();
}
class _UserPageState extends State<UserPage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Column(
children: [
const UserTopBar(),
const Divider(
height: 0,
color: AppColors.border,
),
const SizedBox(height: 8),
const Divider(
height: 0,
color: AppColors.border,
),
ActionItem(
'分享邀请',
onTap: () {
Get.toNamed(UserRoutes.share);
},
),
const Divider(
height: 0,
color: AppColors.border,
indent: 16,
),
ActionItem(
'安全设置',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
indent: 16,
),
ActionItem(
'设置中心',
onTap: () {
Get.toNamed(UserRoutes.setting);
},
),
const Divider(
height: 0,
color: AppColors.border,
indent: 16,
),
ActionItem(
'检查更新',
onTap: () {
Get.toNamed(UserRoutes.setting);
},
),
const Divider(
height: 0,
color: AppColors.border,
),
],
),
),
);
}
}

View File

@@ -1,42 +0,0 @@
import 'package:chat/routes/user_routes.dart';
import 'package:chat/views/user/index/widgets/user_top_bar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class UserPage extends StatefulWidget {
const UserPage({Key? key}) : super(key: key);
@override
_UserPageState createState() => _UserPageState();
}
class _UserPageState extends State<UserPage> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Column(
children: [
const UserTopBar(),
const SizedBox(height: 8),
ListTile(
onTap: () {
Get.toNamed(UserRoutes.share);
},
title: const Text('分享邀请'),
),
ListTile(
onTap: () {
Get.toNamed(UserRoutes.setting);
},
title: const Text('设置中心'),
),
const ListTile(
title: Text('检查更新'),
),
],
),
),
);
}
}

View File

@@ -24,9 +24,14 @@ class UserTopBar extends StatelessWidget {
return Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
CustomAvatar(
_.userInfo.value.avatar,
size: 64,
InkWell(
onTap: () {
Get.toNamed(UserRoutes.info);
},
child: CustomAvatar(
_.userInfo.value.avatar,
size: 64,
),
),
const SizedBox(width: 16),
Column(

View File

@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class UserInfoAvatarPage extends StatefulWidget {
const UserInfoAvatarPage({Key? key}) : super(key: key);
@override
State<UserInfoAvatarPage> createState() => _UserInfoAvatarPageState();
}
class _UserInfoAvatarPageState extends State<UserInfoAvatarPage> {
@override
Widget build(BuildContext context) {
return Container();
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class UserInfoPage extends StatefulWidget {
const UserInfoPage({Key? key}) : super(key: key);
@override
State<UserInfoPage> createState() => _UserInfoPageState();
}
class _UserInfoPageState extends State<UserInfoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('用户资料'),
),
);
}
}

View File

@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class UserInfoNicknamePage extends StatefulWidget {
const UserInfoNicknamePage({Key? key}) : super(key: key);
@override
State<UserInfoNicknamePage> createState() => _UserInfoNicknamePageState();
}
class _UserInfoNicknamePageState extends State<UserInfoNicknamePage> {
@override
Widget build(BuildContext context) {
return Container();
}
}

View File

@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
class UserSafePage extends StatefulWidget {
const UserSafePage({Key? key}) : super(key: key);
@override
State<UserSafePage> createState() => _UserSafePageState();
}
class _UserSafePageState extends State<UserSafePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('安全设置'),
),
body: Container(),
);
}
}