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_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/flavors.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/dateTool.dart';
@ -22,28 +22,55 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: "消息详情".tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h),
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),
Text(
state.itemData.value.data!,
style: TextStyle(fontSize: 22.sp, color: AppColors.placeholderTextColor),
),
],
)),
)
backgroundColor: AppColors.mainBackgroundColor,
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: "消息详情".tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: "消息详情".tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h),
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,
body: Column(
children: [
SizedBox(
height: 15.h,
),
Container(
width: 1.sw,
height: 0.2.sw,

View File

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

View File

@ -30,7 +30,9 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
backgroundColor: F.sw(
defaultCall: () => AppColors.mainBackgroundColor,
xhjCall: () => AppColors.mainBackgroundColor),
appBar: widget.showAppBar
? TitleAppBar(
barTitle: TranslationLoader.lanKeys!.personalInformation!.tr,
@ -44,7 +46,8 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
xhjCall: () => Container(
width: 1.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),
decoration: BoxDecoration(
image: const DecorationImage(

View File

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

View File

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