feat:优化鑫泓佳 ui

This commit is contained in:
anfe 2024-04-30 13:41:34 +08:00
parent 127ec95537
commit 91327ab395
6 changed files with 102 additions and 56 deletions

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/flavors.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
import '../../../tools/dateTool.dart'; import '../../../tools/dateTool.dart';
@ -22,28 +22,55 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: F.sw(
barTitle: "消息详情".tr, defaultCall: () => TitleAppBar(
haveBack: true, barTitle: "消息详情".tr,
backgroundColor: AppColors.mainColor), haveBack: true,
body: Container( backgroundColor: AppColors.mainColor,
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h), ),
child: Obx(() => Column( xhjCall: () => TitleAppBar(
crossAxisAlignment: CrossAxisAlignment.start, barTitle: "消息详情".tr,
children: [ haveBack: true,
Text( backgroundColor: Colors.white,
"${"创建时间".tr}:${DateTool().dateToYMDHNString(state.itemData.value.createdAt!.toString())}", iconColor: AppColors.blackColor,
style: TextStyle(fontSize: 22.sp, color: AppColors.placeholderTextColor), titleColor: AppColors.blackColor,
), ),
SizedBox(height: 20.h), ),
Text( body: Container(
state.itemData.value.data!, margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h),
style: TextStyle(fontSize: 22.sp, color: AppColors.placeholderTextColor), child: Obx(() => Column(
), crossAxisAlignment: CrossAxisAlignment.start,
], children: [
)), Text(
) "${"创建时间".tr}:${DateTool().dateToYMDHNString(state.itemData.value.createdAt!.toString())}",
style: TextStyle(
fontSize: 22.sp, color: AppColors.placeholderTextColor),
),
SizedBox(height: 20.h),
textView(),
],
)),
));
}
Widget textView() {
Widget view = Text(
state.itemData.value.data!,
style: TextStyle(fontSize: 22.sp, color: AppColors.placeholderTextColor),
); );
return F.sw(
defaultCall: () => view,
xhjCall: () => Container(
padding: EdgeInsets.only(
top: 20.h, bottom: 20.h, left: 20.w, right: 20.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
} }
} }

View File

@ -72,6 +72,9 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
: null, : null,
body: Column( body: Column(
children: [ children: [
SizedBox(
height: 15.h,
),
Container( Container(
width: 1.sw, width: 1.sw,
height: 0.2.sw, height: 0.2.sw,

View File

@ -77,10 +77,11 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(52.5.w), borderRadius: BorderRadius.circular(52.5.w),
child: CustomNetworkImage( child: CustomNetworkImage(
url: state.userHeadUrl.value ?? "", url: state.userHeadUrl.value ?? "",
defaultUrl: 'images/controls_user.png', defaultUrl: 'images/controls_user.png',
width: 105.w, width: 105.w,
height: 105.h), height: 105.h,
),
), ),
)), )),
), ),

View File

@ -30,7 +30,9 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: F.sw(
defaultCall: () => AppColors.mainBackgroundColor,
xhjCall: () => AppColors.mainBackgroundColor),
appBar: widget.showAppBar appBar: widget.showAppBar
? TitleAppBar( ? TitleAppBar(
barTitle: TranslationLoader.lanKeys!.personalInformation!.tr, barTitle: TranslationLoader.lanKeys!.personalInformation!.tr,
@ -44,7 +46,8 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
xhjCall: () => Container( xhjCall: () => Container(
width: 1.sw, width: 1.sw,
height: 0.2.sw, height: 0.2.sw,
margin: EdgeInsets.symmetric(horizontal: 15.w), margin:
EdgeInsets.only(top: 15.h, left: 20.w, right: 20.w),
padding: EdgeInsets.symmetric(horizontal: 25.w), padding: EdgeInsets.symmetric(horizontal: 25.w),
decoration: BoxDecoration( decoration: BoxDecoration(
image: const DecorationImage( image: const DecorationImage(

View File

@ -19,8 +19,9 @@ class AppFirstEnterHandle {
switch (flagStr) { switch (flagStr) {
case isAgreePrivacy: // case isAgreePrivacy: //
{ {
if (getFlag != isAgreePrivacy) if (getFlag != isAgreePrivacy) {
showPrivacyAgreementAlert(widgetContext); showPrivacyAgreementAlert(widgetContext);
}
} }
break; break;
case isAgreePosition: // case isAgreePosition: //

View File

@ -12,34 +12,45 @@ class CustomNetworkImage extends StatelessWidget {
final double width; final double width;
final double height; final double height;
final BoxFit boxFit; final BoxFit boxFit;
const CustomNetworkImage({Key? key, required this.url, required this.defaultUrl, required this.width, required this.height, this.boxFit=BoxFit.cover}) : super(key: key);
const CustomNetworkImage(
{Key? key,
required this.url,
required this.defaultUrl,
required this.width,
required this.height,
this.boxFit = BoxFit.cover})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return url.isNotEmpty ? CachedNetworkImage( return url.isNotEmpty
width: width, ? CachedNetworkImage(
height: height, width: width,
fit: boxFit, height: height,
imageUrl: url, fit: boxFit,
imageBuilder: (context, imageProvider) => Container( imageUrl: url,
decoration: BoxDecoration( imageBuilder: (context, imageProvider) => Container(
image: DecorationImage( decoration: BoxDecoration(
image: imageProvider, image: DecorationImage(
fit: boxFit, image: imageProvider,
colorFilter: const ColorFilter.mode(Colors.transparent, BlendMode.colorBurn)), fit: boxFit,
), colorFilter: const ColorFilter.mode(
), Colors.transparent, BlendMode.colorBurn)),
errorWidget: (context, url, error) => Image.asset( ),
defaultUrl, ),
width: width, errorWidget: (context, url, error) => Image.asset(
height: height, defaultUrl,
fit: BoxFit.fill, width: width,
), height: height,
) :Image.asset( fit: BoxFit.fill,
defaultUrl, ),
width: width, )
height: height, : Image.asset(
fit: BoxFit.fill, defaultUrl,
); width: width,
height: height,
fit: BoxFit.fill,
);
} }
} }