feat : home page widely usage
This commit is contained in:
@@ -52,7 +52,10 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(width: 0.25, color: const Color(0xFFB0B0B0)),
|
side: BorderSide(
|
||||||
|
width: 0.25,
|
||||||
|
color: const Color(0xFFB0B0B0),
|
||||||
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -60,7 +63,9 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
Text(
|
Text(
|
||||||
'مرغ گرم',
|
'مرغ گرم',
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive),
|
style: AppFonts.yekan16.copyWith(
|
||||||
|
color: AppColor.darkGreyDarkActive,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
AnimatedRotation(
|
AnimatedRotation(
|
||||||
@@ -76,13 +81,25 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
_inventoryWidget(),
|
_inventoryWidget(),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
children: [Text('اطلاعات بارها', textAlign: TextAlign.right, style: AppFonts.yekan16)],
|
children: [
|
||||||
|
Text(
|
||||||
|
'اطلاعات بارها',
|
||||||
|
textAlign: TextAlign.right,
|
||||||
|
style: AppFonts.yekan16,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
_informationShipment(),
|
_informationShipment(),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
children: [Text('اطلاعات توزیع', textAlign: TextAlign.right, style: AppFonts.yekan16)],
|
children: [
|
||||||
|
Text(
|
||||||
|
'اطلاعات توزیع',
|
||||||
|
textAlign: TextAlign.right,
|
||||||
|
style: AppFonts.yekan16,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
distributionInformationWidget(),
|
distributionInformationWidget(),
|
||||||
@@ -107,7 +124,10 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(width: 0.25, color: const Color(0xFFB0B0B0)),
|
side: BorderSide(
|
||||||
|
width: 0.25,
|
||||||
|
color: const Color(0xFFB0B0B0),
|
||||||
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -115,7 +135,9 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
Text(
|
Text(
|
||||||
'مرغ گرم',
|
'مرغ گرم',
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive),
|
style: AppFonts.yekan16.copyWith(
|
||||||
|
color: AppColor.darkGreyDarkActive,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Icon(CupertinoIcons.chevron_down, size: 18),
|
Icon(CupertinoIcons.chevron_down, size: 18),
|
||||||
@@ -147,9 +169,30 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
children: [
|
children: [
|
||||||
widelyUsed(
|
widelyUsed(
|
||||||
title: 'خرید خارج استان',
|
title: 'خرید خارج استان',
|
||||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
iconPath: Assets.vec.truckFastSvg.path,
|
||||||
|
onTap: () async {
|
||||||
|
controller.rootLogic.currentPage.value = 0;
|
||||||
|
controller.rootLogic.currentPage.refresh();
|
||||||
|
await Future.delayed(Duration(milliseconds: 100));
|
||||||
|
Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(width: 15),
|
||||||
|
widelyUsed(
|
||||||
|
title: 'خرید داخل استان',
|
||||||
|
iconPath: Assets.vec.cubeSvg.path,
|
||||||
|
onTap: () async {
|
||||||
|
controller.rootLogic.currentPage.value = 0;
|
||||||
|
controller.rootLogic.currentPage.refresh();
|
||||||
|
await Future.delayed(Duration(milliseconds: 100));
|
||||||
|
Get.toNamed(ChickenRoutes.buysInProvince, id: 0);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(width: 15),
|
||||||
|
widelyUsed(
|
||||||
|
title: 'فروش خارج استان',
|
||||||
|
iconPath: Assets.vec.truckFastSvg.path,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
iLog('on tap :خرید خارج استان ');
|
|
||||||
controller.rootLogic.currentPage.value = 1;
|
controller.rootLogic.currentPage.value = 1;
|
||||||
controller.rootLogic.currentPage.refresh();
|
controller.rootLogic.currentPage.refresh();
|
||||||
await Future.delayed(Duration(milliseconds: 100));
|
await Future.delayed(Duration(milliseconds: 100));
|
||||||
@@ -158,10 +201,13 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 15),
|
SizedBox(width: 15),
|
||||||
widelyUsed(
|
widelyUsed(
|
||||||
title: 'عمده فروشی',
|
title: 'فروش داخل استان',
|
||||||
iconPath: Assets.vec.truckFastSvg.path,
|
iconPath: Assets.vec.cubeSvg.path,
|
||||||
onTap: () {
|
onTap: () async{
|
||||||
//Get.toNamed(ChickenRoutes.salesWithinProvince);
|
controller.rootLogic.currentPage.value = 1;
|
||||||
|
controller.rootLogic.currentPage.refresh();
|
||||||
|
await Future.delayed(Duration(milliseconds: 100));
|
||||||
|
Get.toNamed(ChickenRoutes.salesInProvince, id: 1);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(width: 15),
|
SizedBox(width: 15),
|
||||||
@@ -382,15 +428,20 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
height: 82,
|
height: 82,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: bgLabelColor,
|
color: bgLabelColor,
|
||||||
borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8)),
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: Radius.circular(8),
|
||||||
|
bottomRight: Radius.circular(8),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
children: [
|
children: [
|
||||||
SvgGenImage.vec(
|
SvgGenImage.vec(iconPath).svg(
|
||||||
iconPath,
|
width: 24,
|
||||||
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
|
height: 24,
|
||||||
|
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
@@ -405,7 +456,10 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: bgDescriptionColor,
|
color: bgDescriptionColor,
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(8),
|
||||||
|
bottomLeft: Radius.circular(8),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: isLoading
|
child: isLoading
|
||||||
? Center(child: CupertinoActivityIndicator())
|
? Center(child: CupertinoActivityIndicator())
|
||||||
@@ -499,9 +553,11 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SvgGenImage.vec(
|
child: SvgGenImage.vec(iconPath).svg(
|
||||||
iconPath,
|
width: 24,
|
||||||
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
|
height: 24,
|
||||||
|
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -510,7 +566,11 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget widelyUsed({required String title, required String iconPath, required VoidCallback onTap}) {
|
Widget widelyUsed({
|
||||||
|
required String title,
|
||||||
|
required String iconPath,
|
||||||
|
required VoidCallback onTap,
|
||||||
|
}) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -573,7 +633,11 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget inventoryItem({required bool isExpanded, required int index, required InventoryModel model}) {
|
Widget inventoryItem({
|
||||||
|
required bool isExpanded,
|
||||||
|
required int index,
|
||||||
|
required InventoryModel model,
|
||||||
|
}) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
@@ -585,9 +649,18 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'),
|
buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'),
|
||||||
buildRow('وزن خریدهای آزاد داخل استان (کیلوگرم)', model.receiveFreeCarcassesWeight.toString()),
|
buildRow(
|
||||||
buildRow('وزن خریدهای خارج استان (کیلوگرم)', model.freeBuyingCarcassesWeight.toString()),
|
'وزن خریدهای آزاد داخل استان (کیلوگرم)',
|
||||||
buildRow('کل ورودی به انبار (کیلوگرم)', model.totalFreeBarsCarcassesWeight.toString()),
|
model.receiveFreeCarcassesWeight.toString(),
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'وزن خریدهای خارج استان (کیلوگرم)',
|
||||||
|
model.freeBuyingCarcassesWeight.toString(),
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'کل ورودی به انبار (کیلوگرم)',
|
||||||
|
model.totalFreeBarsCarcassesWeight.toString(),
|
||||||
|
),
|
||||||
buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()),
|
buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()),
|
||||||
buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()),
|
buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()),
|
||||||
],
|
],
|
||||||
@@ -645,15 +718,25 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
buildRow('فروش و توزیع داخل استان (کیلوگرم)', model.stewardAllocationsWeight!.toInt().toString()),
|
buildRow(
|
||||||
buildRow('فروش و توزیع خارج استان (کیلوگرم)', model.freeSalesWeight!.toInt().toString()),
|
'فروش و توزیع داخل استان (کیلوگرم)',
|
||||||
|
model.stewardAllocationsWeight!.toInt().toString(),
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'فروش و توزیع خارج استان (کیلوگرم)',
|
||||||
|
model.freeSalesWeight!.toInt().toString(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: const Center(child: CircularProgressIndicator()),
|
: const Center(child: CircularProgressIndicator()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget cardWidget({required String title, required String iconPath, required VoidCallback onTap}) {
|
Widget cardWidget({
|
||||||
|
required String title,
|
||||||
|
required String iconPath,
|
||||||
|
required VoidCallback onTap,
|
||||||
|
}) {
|
||||||
return Container(
|
return Container(
|
||||||
width: Get.width / 4,
|
width: Get.width / 4,
|
||||||
height: 130,
|
height: 130,
|
||||||
|
|||||||
Reference in New Issue
Block a user