feat : new ui for steward

This commit is contained in:
2025-10-01 13:16:16 +03:30
parent 20a4a59c2e
commit 3d957b8aee
12 changed files with 573 additions and 136 deletions

View File

@@ -28,123 +28,122 @@ class HomePage extends GetView<HomeLogic> {
InkWell mainInformation() {
return InkWell(
onTap: () {
controller.isExpanded.value = !controller.isExpanded.value;
},
onTap: () {
controller.isExpanded.value = !controller.isExpanded.value;
},
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
margin: EdgeInsetsGeometry.all(6),
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
margin: EdgeInsetsGeometry.all(6),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(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,
mainAxisAlignment: MainAxisAlignment.end,
children: [
AnimatedRotation(
turns: 180,
duration: Duration(milliseconds: 3000),
child: Icon(CupertinoIcons.chevron_up, size: 18),
),
],
),
SizedBox(height: 8),
_todayShipmentWidget(),
_todayShipmentWidget2(),
_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,
mainAxisAlignment: MainAxisAlignment.end,
children: [Icon(CupertinoIcons.chevron_down, size: 18)],
),
_todayShipmentWidget(),
_todayShipmentWidget2(),
_inventoryWidget(),
],
),
),
);
}, controller.isExpanded),
),
Positioned(
top: -10,
right: 20,
child: Container(
height: 32.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(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,
mainAxisAlignment: MainAxisAlignment.end,
children: [
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,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(CupertinoIcons.chevron_down, size: 18),
],
),
_todayShipmentWidget(),
_inventoryWidget(),
],
),
),
);
}, controller.isExpanded),
),
Positioned(
top: -10,
right: 20,
child: Container(
height: 32.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.50, color: const Color(0xFFA9A9A9)),
),
padding: EdgeInsets.symmetric(horizontal: 8),
child: Row(
spacing: 8,
children: [
Assets.vec.chicken2Svg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.blueDark, BlendMode.srcIn),
),
Text(
'اطلاعات مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
),
],
),
padding: EdgeInsets.symmetric(horizontal: 8),
child: Row(
spacing: 8,
children: [
Assets.vec.chicken2Svg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.blueDark, BlendMode.srcIn),
),
Text(
'اطلاعات مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
),
],
),
),
],
),
);
),
],
),
);
}
Widget distributionInformationWidget() {
@@ -278,10 +277,10 @@ class HomePage extends GetView<HomeLogic> {
(data) => _informationLabelCard(
title: 'بارهای امروز',
titleColor: AppColor.blueNormal,
borderColor: Color(0xFF77A6FF),
isLoading: data.value == null,
description: data.value?.separatedByCommaFa ?? '0',
iconPath: Assets.vec.cubeSearchSvg.path,
iconColor: AppColor.blueNormal,
iconPath: Assets.vec.cubeScanWithLabelSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
@@ -297,16 +296,67 @@ class HomePage extends GetView<HomeLogic> {
child: ObxValue((data) {
return _informationLabelCard(
title: 'درانتظار تایید',
borderColor: AppColor.greenNormal,
isLoading: data.value == null,
description: data.value?.totalNotEnteredBars.separatedByCommaFa ?? '0',
unit:
'(${data.value?.totalNotEnteredKillHouseRequestsWeight.separatedByCommaFa})\nکیلوگرم',
iconPath: Assets.vec.cubeWattingSvg.path,
iconPath: Assets.vec.cubeCardSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [const Color(0xFFFFE7BB), Colors.white],
colors: [const Color(0xFFD9F7F0), Colors.white],
),
);
}, controller.barInformation),
),
],
),
);
}
Widget _todayShipmentWidget2() {
return Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 13),
child: Row(
spacing: 8,
children: [
Expanded(
child: ObxValue(
(data) => _informationLabelCard(
title: 'مانده دولتی',
titleColor: AppColor.blueNormal,
borderColor: Color(0xFFFFAE00),
isLoading: data.value == null,
description: data.value?.separatedByCommaFa ?? '0',
iconPath: Assets.vec.cubeCardGovermentSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xFFFFD47A), Colors.white],
),
),
controller.totalWeightTodayBars,
),
),
Expanded(
child: ObxValue((data) {
return _informationLabelCard(
title: 'مانده آزاد',
borderColor: const Color(0xFF9758FF),
isLoading: data.value == null,
description: data.value?.totalNotEnteredBars.separatedByCommaFa ?? '0',
unit:
'(${data.value?.totalNotEnteredKillHouseRequestsWeight.separatedByCommaFa})\nکیلوگرم',
iconPath: Assets.vec.cubeCardFreeSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [const Color(0xFFD3B9FF), Colors.white],
),
);
}, controller.barInformation),
@@ -321,6 +371,7 @@ class HomePage extends GetView<HomeLogic> {
required String description,
required String iconPath,
required Color bgDescriptionColor,
Color? borderColor,
String unit = 'کیلوگرم',
bool isLoading = false,
Color? iconColor,
@@ -330,7 +381,10 @@ class HomePage extends GetView<HomeLogic> {
}) {
return Container(
height: 82,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: borderColor != null ? Border.all(width: 1, color: borderColor) : null,
),
clipBehavior: Clip.hardEdge,
child: Row(
children: [