feat : ui change's like

1 - logout icon's color
2 - profile itemList change color
3 - change empty icon and vec
4 - reset nested navigation when change main page's changed
This commit is contained in:
2025-07-20 12:39:37 +03:30
parent 3808161c88
commit e3e3005bba
10 changed files with 375 additions and 540 deletions

View File

@@ -16,145 +16,149 @@ class HomePage extends GetView<HomeLogic> {
return Scaffold(
backgroundColor: AppColor.bgLight,
appBar: chickenAppBar(hasBack: false, hasFilter: false, hasSearch: false),
body: Column(
spacing: 8,
children: [
InkWell(
onTap: () {
controller.isExpanded.value = !controller.isExpanded.value;
},
child: Card(
margin: EdgeInsetsGeometry.all(6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(width: 0.50, color: const Color(0xFFA9A9A9)),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
spacing: 8,
children: [
InkWell(
onTap: () {
controller.isExpanded.value = !controller.isExpanded.value;
},
child: Card(
margin: EdgeInsetsGeometry.all(6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(width: 0.50, color: const Color(0xFFA9A9A9)),
),
child: ObxValue((data) {
return AnimatedSize(
duration: Duration(milliseconds: 300),
child: data.value
? Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(Assets.images.chicken.path),
fit: BoxFit.cover,
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.25,
color: const Color(0xFFB0B0B0),
),
borderRadius: BorderRadius.circular(4),
),
),
),
Text(
'مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDarkActive,
),
),
Spacer(),
AnimatedRotation(
turns: 180,
duration: Duration(milliseconds: 3000),
child: Icon(CupertinoIcons.chevron_up, size: 18),
),
],
),
SizedBox(height: 8),
_todayShipmentWidget(),
_inventoryWidget(),
Row(
children: [
Text(
'اطلاعات بارها',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
],
),
_informationShipment(),
Row(
children: [
Text(
'اطلاعات توزیع',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
],
),
distributionInformationWidget(),
],
),
)
: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(Assets.images.chicken.path),
fit: BoxFit.cover,
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.25,
color: const Color(0xFFB0B0B0),
),
borderRadius: BorderRadius.circular(4),
),
),
),
Text(
'مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDarkActive,
),
),
Spacer(),
Icon(CupertinoIcons.chevron_down, size: 18),
],
),
_todayShipmentWidget(),
_inventoryWidget(),
],
),
),
);
}, controller.isExpanded),
),
child: ObxValue((data) {
return AnimatedSize(
duration: Duration(milliseconds: 300),
child: data.value
? Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(Assets.images.chicken.path),
fit: BoxFit.cover,
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.25,
color: const Color(0xFFB0B0B0),
),
borderRadius: BorderRadius.circular(4),
),
),
),
Text(
'مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDarkActive,
),
),
Spacer(),
AnimatedRotation(
turns: 180,
duration: Duration(milliseconds: 3000),
child: Icon(CupertinoIcons.chevron_up, size: 18),
),
],
),
SizedBox(height: 8),
_todayShipmentWidget(),
_inventoryWidget(),
Row(
children: [
Text(
'اطلاعات بارها',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
],
),
_informationShipment(),
Row(
children: [
Text(
'اطلاعات توزیع',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
],
),
distributionInformationWidget(),
],
),
)
: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(Assets.images.chicken.path),
fit: BoxFit.cover,
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.25,
color: const Color(0xFFB0B0B0),
),
borderRadius: BorderRadius.circular(4),
),
),
),
Text(
'مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDarkActive,
),
),
Spacer(),
Icon(CupertinoIcons.chevron_down, size: 18),
],
),
_todayShipmentWidget(),
_inventoryWidget(),
],
),
),
);
}, controller.isExpanded),
),
),
WidelyUsedWidget(),
],
WidelyUsedWidget(),
SizedBox(height: 20,)
],
),
),
);
}
@@ -288,13 +292,18 @@ class HomePage extends GetView<HomeLogic> {
Expanded(
child: ObxValue(
(data) => _informationLabelCard(
title: 'بارهای امروز',
title: 'بارهای امروز',
titleColor: AppColor.blueNormal,
isLoading: data.value == null,
description: data.value?.separatedByComma ?? '0',
iconPath: Assets.vec.cubeSearchSvg.path,
iconColor: AppColor.blueNormal,
bgDescriptionColor: Colors.white,
bgLabelColor: Color(0xFFEAEFFF),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [AppColor.blueLight, Colors.white],
),
),
controller.totalWeightTodayBars,
),
@@ -305,30 +314,35 @@ class HomePage extends GetView<HomeLogic> {
return _informationLabelCard(
title: 'درانتظار تایید',
isLoading: data.value == null,
description: '(${data.value?.totalNotEnteredBars.separatedByComma ?? '0'})',
unit: '(${data.value?.totalNotEnteredKillHouseRequestsWeight.separatedByComma})کیلوگرم',
iconPath: Assets.vec.cubeRotateSvg.path,
iconColor: Color(0xFF8F4124),
bgLabelColor: Color(0xFFF59770),
bgDescriptionColor: Color(0xFFF6DFD8),
description: data.value?.totalNotEnteredBars.separatedByComma ?? '0',
unit:
'(${data.value?.totalNotEnteredKillHouseRequestsWeight.separatedByComma})\nکیلوگرم',
iconPath: Assets.vec.cubeWattingSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [const Color(0xFFFFE7BB), Colors.white],
),
);
}, controller.barInformation),
),
],
),
);
}
Container _informationLabelCard({
required String title,
required String description,
required String iconPath,
required Color bgDescriptionColor,
String unit = 'کیلوگرم',
bool isLoading = false,
required String iconPath,
required Color iconColor,
required Color bgDescriptionColor,
required Color bgLabelColor,
Color? iconColor,
Color? titleColor,
Color? bgLabelColor,
LinearGradient? gradient,
}) {
return Container(
height: 82,
@@ -341,11 +355,12 @@ class HomePage extends GetView<HomeLogic> {
child: Container(
height: 82,
decoration: BoxDecoration(
color: bgLabelColor,
color: gradient == null ? bgLabelColor : null,
borderRadius: BorderRadius.only(
topRight: Radius.circular(8),
bottomRight: Radius.circular(8),
),
gradient: gradient,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -354,12 +369,16 @@ class HomePage extends GetView<HomeLogic> {
SvgGenImage.vec(iconPath).svg(
width: 24,
height: 24,
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
colorFilter: iconColor != null
? ColorFilter.mode(iconColor, BlendMode.srcIn)
: null,
),
Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan14.copyWith(
color: titleColor ?? AppColor.mediumGreyDarkActive,
),
),
],
),

View File

@@ -75,8 +75,8 @@ class ProfilePage extends GetView<ProfileLogic> {
title: 'خروج',
selected: true,
color: ColorFilter.mode(Colors.redAccent, BlendMode.srcIn),
cardColor:AppColor.error.withValues(alpha: 0.24),
textColor: Colors.red,
cardColor: Color(0xFFEFEFEF),
textColor: AppColor.redDarkerText,
onPressed: () {
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
},
@@ -187,9 +187,10 @@ class ProfilePage extends GetView<ProfileLogic> {
}) => Container(
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h),
decoration: BoxDecoration(
color: hasColoredBox ? AppColor.blueLight : Colors.transparent,
color: hasColoredBox ? AppColor.greenLight : Colors.transparent,
borderRadius: BorderRadius.circular(8),
border: hasColoredBox
? Border.all(width: 1, color: AppColor.blueLightHover)
? Border.all(width: 0.25, color: AppColor.bgDark)
: Border.all(width: 0, color: Colors.transparent),
),
child: Row(
@@ -199,14 +200,14 @@ class ProfilePage extends GetView<ProfileLogic> {
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: SvgGenImage.vec(icon).svg(
width: 20,
height: 20,
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
width: 20.w,
height: 20.h,
colorFilter: ColorFilter.mode(AppColor.mediumGreyNormalActive, BlendMode.srcIn),
),
),
Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal)),
Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyNormalActive)),
Spacer(),
Text(content, style: AppFonts.yekan13.copyWith(color: AppColor.darkGreyNormalHover)),
Text(content, style: AppFonts.yekan13.copyWith(color: AppColor.mediumGreyNormalHover)),
],
),
);
@@ -230,7 +231,7 @@ class ProfilePage extends GetView<ProfileLogic> {
height: 52,
padding: EdgeInsets.all(8),
decoration: ShapeDecoration(
color: cardColor??AppColor.blueLight,
color: cardColor ?? AppColor.blueLight,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: SvgGenImage.vec(icon).svg(

View File

@@ -59,7 +59,7 @@ class RootLogic extends GetxController {
@override
void onReady() {
super.onReady();
// Only call these methods if they haven't been called before
if (provinces.isEmpty) {
getProvinces();
}
@@ -157,4 +157,5 @@ class RootLogic extends GetxController {
onError: (error, stacktrace) {},
);
}
}

View File

@@ -105,19 +105,32 @@ class RootPage extends GetView<RootLogic> {
label: 'خانه',
icon: Assets.vec.homeSvg.path,
isSelected: controller.currentPage.value == 2,
onTap: () => controller.changePage(2),
onTap: () {
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
controller.changePage(2);
},
),
RBottomNavigationItem(
label: 'قطعه بندی',
icon: Assets.vec.convertCubeSvg.path,
isSelected: controller.currentPage.value == 3,
onTap: () => controller.changePage(3),
onTap: () {
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
controller.changePage(3);
},
),
RBottomNavigationItem(
label: 'پروفایل',
icon: Assets.vec.profileCircleSvg.path,
isSelected: controller.currentPage.value == 4,
onTap: () => controller.changePage(4),
onTap: () {
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
controller.changePage(4);
},
),
],
),