user-page
This commit is contained in:
@@ -51,21 +51,4 @@ class AppColors {
|
|||||||
static const Color golden = Color(0xfffca106); // 枇杷黄
|
static const Color golden = Color(0xfffca106); // 枇杷黄
|
||||||
|
|
||||||
static const Color mainBlack = Color(0xff000000);
|
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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class ActionItem extends StatelessWidget {
|
|||||||
rightWidget ??
|
rightWidget ??
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
size: 16,
|
size: 14,
|
||||||
color: AppColors.unactive,
|
color: AppColors.unactive,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class MomentListItemReplay extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'查看全部$listLength条回复',
|
'查看全部$listLength条回复',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: AppColors.tTextColor999,
|
color: AppColors.active,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -104,7 +104,7 @@ class MomentListItemReplay extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.keyboard_arrow_down,
|
Icons.keyboard_arrow_down,
|
||||||
color: AppColors.tTextColor999,
|
color: AppColors.active,
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -143,7 +143,7 @@ class MomentListItemReplay extends StatelessWidget {
|
|||||||
text: comment.content ?? '',
|
text: comment.content ?? '',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: AppColors.tTextColor333,
|
color: AppColors.active,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -161,7 +161,7 @@ class MomentListItemReplay extends StatelessWidget {
|
|||||||
text: ' 回复 ',
|
text: ' 回复 ',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: AppColors.tTextColor333,
|
color: AppColors.active,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -175,7 +175,7 @@ class MomentListItemReplay extends StatelessWidget {
|
|||||||
text: comment.content ?? '',
|
text: comment.content ?? '',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: AppColors.tTextColor333,
|
color: AppColors.active,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class _QuickReplyBarState extends State<QuickReplyBar> {
|
|||||||
backgroundColor: MaterialStateProperty.resolveWith(
|
backgroundColor: MaterialStateProperty.resolveWith(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(MaterialState.disabled)) {
|
if (states.contains(MaterialState.disabled)) {
|
||||||
return AppColors.tTextColor999.withAlpha(128);
|
return AppColors.active.withAlpha(128);
|
||||||
} else {
|
} else {
|
||||||
return AppColors.primary;
|
return AppColors.primary;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class MomentsPublishPage extends StatelessWidget {
|
|||||||
backgroundColor: MaterialStateProperty.resolveWith(
|
backgroundColor: MaterialStateProperty.resolveWith(
|
||||||
(states) {
|
(states) {
|
||||||
if (states.contains(MaterialState.disabled)) {
|
if (states.contains(MaterialState.disabled)) {
|
||||||
return AppColors.tTextColor999.withAlpha(128);
|
return AppColors.active.withAlpha(128);
|
||||||
} else {
|
} else {
|
||||||
return AppColors.primary;
|
return AppColors.primary;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,21 @@ class _UserPageState extends State<UserPage> {
|
|||||||
height: 0,
|
height: 0,
|
||||||
color: AppColors.border,
|
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(
|
ActionItem(
|
||||||
'分享邀请',
|
'分享邀请',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -41,18 +56,7 @@ class _UserPageState extends State<UserPage> {
|
|||||||
indent: 16,
|
indent: 16,
|
||||||
),
|
),
|
||||||
ActionItem(
|
ActionItem(
|
||||||
'安全设置',
|
'设置',
|
||||||
onTap: () {
|
|
||||||
Get.toNamed(UserRoutes.safe);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const Divider(
|
|
||||||
height: 0,
|
|
||||||
color: AppColors.border,
|
|
||||||
indent: 16,
|
|
||||||
),
|
|
||||||
ActionItem(
|
|
||||||
'设置中心',
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(UserRoutes.setting);
|
Get.toNamed(UserRoutes.setting);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,11 +40,16 @@ class UserTopBar extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
InkWell(
|
||||||
_.userInfo.value.nickname ?? '',
|
onTap: () {
|
||||||
style: const TextStyle(
|
Get.toNamed(UserRoutes.info);
|
||||||
fontSize: 22,
|
},
|
||||||
fontWeight: FontWeight.w400,
|
child: Text(
|
||||||
|
_.userInfo.value.nickname ?? '',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import 'package:chat/configs/app_colors.dart';
|
|
||||||
import 'package:chat/controllers/user_controller.dart';
|
import 'package:chat/controllers/user_controller.dart';
|
||||||
import 'package:chat/routes/user_routes.dart';
|
import 'package:chat/routes/user_routes.dart';
|
||||||
import 'package:chat/services/auth_service.dart';
|
import 'package:chat/services/auth_service.dart';
|
||||||
import 'package:chat/views/user/widgets/link_action_item.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:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:image_cropper/image_cropper.dart';
|
import 'package:image_cropper/image_cropper.dart';
|
||||||
@@ -45,11 +44,10 @@ class _UserInfoPageState extends State<UserInfoPage> {
|
|||||||
|
|
||||||
_cropImage((await result.first.file)!.path);
|
_cropImage((await result.first.file)!.path);
|
||||||
},
|
},
|
||||||
trailing: CustomCircleAvatar(
|
isLink: true,
|
||||||
|
trailing: CustomAvatar(
|
||||||
_.userInfo.value.avatar,
|
_.userInfo.value.avatar,
|
||||||
size: 44,
|
size: 52,
|
||||||
borderWidth: 0.8,
|
|
||||||
borderColor: AppColors.primary,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
LinkActionItem(
|
LinkActionItem(
|
||||||
|
|||||||
@@ -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/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:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class UserSettingPage extends StatefulWidget {
|
class UserSettingPage extends StatefulWidget {
|
||||||
const UserSettingPage({Key? key}) : super(key: key);
|
const UserSettingPage({Key? key}) : super(key: key);
|
||||||
@@ -17,11 +22,90 @@ class _UserSettingPageState extends State<UserSettingPage> {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton(
|
ActionItem(
|
||||||
onPressed: () {
|
'账号与安全',
|
||||||
|
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();
|
AuthService.to.logout();
|
||||||
},
|
},
|
||||||
child: const Text('退出登录'),
|
),
|
||||||
|
const Divider(
|
||||||
|
height: 0,
|
||||||
|
color: AppColors.border,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -59,9 +59,13 @@ class LinkActionItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (trailing != null) trailing!,
|
if (trailing != null) trailing!,
|
||||||
if (isLink == true)
|
if (isLink == true)
|
||||||
const Icon(
|
const Padding(
|
||||||
Icons.chevron_right,
|
padding: EdgeInsets.only(left: 4),
|
||||||
color: AppColors.unactive,
|
child: Icon(
|
||||||
|
Icons.arrow_forward_ios,
|
||||||
|
color: AppColors.unactive,
|
||||||
|
size: 14,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user