user-page

This commit is contained in:
2022-10-26 13:41:29 +08:00
parent afee57df73
commit 099d2b4423
10 changed files with 132 additions and 54 deletions

View File

@@ -51,21 +51,4 @@ class AppColors {
static const Color golden = Color(0xfffca106); // 枇杷黄
static const Color mainBlack = Color(0xff000000);
static const Color tMainBg = Color(0xfff9f9f9);
static const Color tVipBg = Color(0xff242430);
static const Color tNack = Color(0xfffcc590);
static const Color tNack1 = Color(0xfffcc692);
static const Color tVip1 = Color(0xfffce3c5);
static const Color tVip2 = Color(0xfffcc590);
static const Color tVip3 = Color(0xff9f5529);
static const Color tVip4 = Color(0xff3e5364);
static const Color tVip5 = Color(0xff31364a);
static const Color tMainColor = Color(0xfffdbb03);
static const Color tMainRedColor = Color(0xffe6576b);
static const Color tTextColor = Color(0xff333333);
static const Color tTextColor333 = Color(0xff333333);
static const Color tTextColor666 = Color(0xff666666);
static const Color tTextColor999 = Color(0xff999999);
}

View File

@@ -50,7 +50,7 @@ class ActionItem extends StatelessWidget {
rightWidget ??
const Icon(
Icons.arrow_forward_ios,
size: 16,
size: 14,
color: AppColors.unactive,
),
],

View File

@@ -94,7 +94,7 @@ class MomentListItemReplay extends StatelessWidget {
Text(
'查看全部$listLength条回复',
style: const TextStyle(
color: AppColors.tTextColor999,
color: AppColors.active,
fontSize: 12,
),
),
@@ -104,7 +104,7 @@ class MomentListItemReplay extends StatelessWidget {
),
child: Icon(
Icons.keyboard_arrow_down,
color: AppColors.tTextColor999,
color: AppColors.active,
size: 16,
),
),
@@ -143,7 +143,7 @@ class MomentListItemReplay extends StatelessWidget {
text: comment.content ?? '',
style: const TextStyle(
fontWeight: FontWeight.normal,
color: AppColors.tTextColor333,
color: AppColors.active,
fontSize: 13,
),
),
@@ -161,7 +161,7 @@ class MomentListItemReplay extends StatelessWidget {
text: ' 回复 ',
style: TextStyle(
fontWeight: FontWeight.normal,
color: AppColors.tTextColor333,
color: AppColors.active,
fontSize: 13,
),
),
@@ -175,7 +175,7 @@ class MomentListItemReplay extends StatelessWidget {
text: comment.content ?? '',
style: const TextStyle(
fontWeight: FontWeight.normal,
color: AppColors.tTextColor333,
color: AppColors.active,
fontSize: 13,
),
),

View File

@@ -75,7 +75,7 @@ class _QuickReplyBarState extends State<QuickReplyBar> {
backgroundColor: MaterialStateProperty.resolveWith(
(states) {
if (states.contains(MaterialState.disabled)) {
return AppColors.tTextColor999.withAlpha(128);
return AppColors.active.withAlpha(128);
} else {
return AppColors.primary;
}

View File

@@ -29,7 +29,7 @@ class MomentsPublishPage extends StatelessWidget {
backgroundColor: MaterialStateProperty.resolveWith(
(states) {
if (states.contains(MaterialState.disabled)) {
return AppColors.tTextColor999.withAlpha(128);
return AppColors.active.withAlpha(128);
} else {
return AppColors.primary;
}

View File

@@ -29,6 +29,21 @@ class _UserPageState extends State<UserPage> {
height: 0,
color: AppColors.border,
),
ActionItem(
'服务',
onTap: () {
Get.toNamed(UserRoutes.share);
},
),
const Divider(
height: 0,
color: AppColors.border,
),
const SizedBox(height: 8),
const Divider(
height: 0,
color: AppColors.border,
),
ActionItem(
'分享邀请',
onTap: () {
@@ -41,18 +56,7 @@ class _UserPageState extends State<UserPage> {
indent: 16,
),
ActionItem(
'安全设置',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
indent: 16,
),
ActionItem(
'设置中心',
'设置',
onTap: () {
Get.toNamed(UserRoutes.setting);
},

View File

@@ -40,11 +40,16 @@ class UserTopBar extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
_.userInfo.value.nickname ?? '',
style: const TextStyle(
fontSize: 22,
fontWeight: FontWeight.w400,
InkWell(
onTap: () {
Get.toNamed(UserRoutes.info);
},
child: Text(
_.userInfo.value.nickname ?? '',
style: const TextStyle(
fontSize: 22,
fontWeight: FontWeight.w400,
),
),
),
Row(

View File

@@ -1,9 +1,8 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/controllers/user_controller.dart';
import 'package:chat/routes/user_routes.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/views/user/widgets/link_action_item.dart';
import 'package:chat/widgets/custom_circle_avatar.dart';
import 'package:chat/widgets/custom_avatar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_cropper/image_cropper.dart';
@@ -45,11 +44,10 @@ class _UserInfoPageState extends State<UserInfoPage> {
_cropImage((await result.first.file)!.path);
},
trailing: CustomCircleAvatar(
isLink: true,
trailing: CustomAvatar(
_.userInfo.value.avatar,
size: 44,
borderWidth: 0.8,
borderColor: AppColors.primary,
size: 52,
),
),
LinkActionItem(

View File

@@ -1,5 +1,10 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/routes/user_routes.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/views/home/widgets/action_button.dart';
import 'package:chat/views/home/widgets/action_item.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class UserSettingPage extends StatefulWidget {
const UserSettingPage({Key? key}) : super(key: key);
@@ -17,11 +22,90 @@ class _UserSettingPageState extends State<UserSettingPage> {
),
body: Column(
children: [
ElevatedButton(
onPressed: () {
ActionItem(
'账号与安全',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
),
const SizedBox(height: 8),
const Divider(
height: 0,
color: AppColors.border,
),
ActionItem(
'新消息通知',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
indent: 16,
),
ActionItem(
'隐私权限',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
),
const SizedBox(height: 8),
ActionItem(
'关于ZH-CHAT',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
indent: 16,
),
ActionItem(
'帮助与反馈',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const SizedBox(height: 8),
const Divider(
height: 0,
color: AppColors.border,
),
ActionItem(
'版本更新',
onTap: () {
Get.toNamed(UserRoutes.safe);
},
),
const Divider(
height: 0,
color: AppColors.border,
),
const SizedBox(height: 8),
const Divider(
height: 0,
color: AppColors.border,
),
ActionButton(
'退出',
color: AppColors.primary,
onTap: () async {
AuthService.to.logout();
},
child: const Text('退出登录'),
),
const Divider(
height: 0,
color: AppColors.border,
),
],
),

View File

@@ -59,9 +59,13 @@ class LinkActionItem extends StatelessWidget {
),
if (trailing != null) trailing!,
if (isLink == true)
const Icon(
Icons.chevron_right,
color: AppColors.unactive,
const Padding(
padding: EdgeInsets.only(left: 4),
child: Icon(
Icons.arrow_forward_ios,
color: AppColors.unactive,
size: 14,
),
),
],
),