fix : some ui bug
This commit is contained in:
@@ -18,8 +18,8 @@ part 'app_paths.dart';
|
|||||||
sealed class AppPages {
|
sealed class AppPages {
|
||||||
AppPages._();
|
AppPages._();
|
||||||
|
|
||||||
//static const String initRoutes = AppPaths.splash;
|
static const String initRoutes = AppPaths.splash;
|
||||||
static const String initRoutes = AppPaths.test;
|
// static const String initRoutes = AppPaths.test;
|
||||||
static const String initDesignSystem = AppPaths.systemDesignPage;
|
static const String initDesignSystem = AppPaths.systemDesignPage;
|
||||||
|
|
||||||
static List<GetPage> pages = [
|
static List<GetPage> pages = [
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class GenocidePage extends GetView<GenocideLogic> {
|
|||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
labelColor: AppColor.blueLight,
|
labelColor: AppColor.blueLight,
|
||||||
labelIcon: Assets.vec.timerSvg.path,
|
labelIcon: Assets.vec.timerSvg.path,
|
||||||
|
labelIconColor: AppColor.yellowNormal2,
|
||||||
);
|
);
|
||||||
}, controller.expandedIndex);
|
}, controller.expandedIndex);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
|
|||||||
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 8.h),
|
SizedBox(height: 18.h),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.isExpanded.value = !controller.isExpanded.value;
|
controller.isExpanded.value = !controller.isExpanded.value;
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
labelIcon: item.reportInfo?.image == false
|
labelIcon: item.reportInfo?.image == false
|
||||||
? Assets.vec.timerSvg.path
|
? Assets.vec.timerSvg.path
|
||||||
: Assets.vec.checkSquareSvg.path,
|
: Assets.vec.checkSquareSvg.path,
|
||||||
|
labelIconColor: item.reportInfo?.image == false
|
||||||
|
? AppColor.yellowNormal2
|
||||||
|
: AppColor.mediumGreyDarkHover,
|
||||||
);
|
);
|
||||||
}, controller.expandedIndex);
|
}, controller.expandedIndex);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -174,4 +174,11 @@ class BuyInProvinceAllLogic extends GetxController {
|
|||||||
isExpandedListIndex.value = index;
|
isExpandedListIndex.value = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color getLabelColor(String? receiverState) {
|
||||||
|
if (receiverState == 'pending') {
|
||||||
|
return AppColor.yellowNormal2;
|
||||||
|
}
|
||||||
|
return AppColor.mediumGreyDarkHover;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
labelColor: getLabelColor(item.receiverState),
|
labelColor: getLabelColor(item.receiverState),
|
||||||
labelIcon: controller.getVecPathItem(item.receiverState),
|
labelIcon: controller.getVecPathItem(item.receiverState),
|
||||||
|
labelIconColor: controller.getLabelColor(item.receiverState),
|
||||||
);
|
);
|
||||||
}, controller.isExpandedListIndex);
|
}, controller.isExpandedListIndex);
|
||||||
},
|
},
|
||||||
@@ -87,9 +88,10 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${item.weightOfCarcasses?.separatedByCommaFa}kg',
|
item.weightOfCarcasses?.separatedByCommaFa.addKg ?? 'N/A',
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
textDirection: TextDirection.ltr,
|
||||||
|
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -195,15 +197,21 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'وزن خریداری شده',
|
title: 'وزن خریداری شده',
|
||||||
value: '${item.weightOfCarcasses?.separatedByCommaFa} کیلوگرم',
|
value: item.weightOfCarcasses?.separatedByCommaFa ?? 'N/A',
|
||||||
|
valueLabel: 'کیلوگرم',
|
||||||
),
|
),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'قیمت هر کیلوگرم',
|
title: 'قیمت هر کیلوگرم',
|
||||||
titleLabel:(item.approvedPriceStatus ?? false) ? 'مصوب' : 'آزاد' ,
|
titleLabel: (item.approvedPriceStatus ?? false) ? 'مصوب' : 'آزاد',
|
||||||
titleLabelStyle: AppFonts.yekan14Bold.copyWith(color: AppColor.greenNormal),
|
titleLabelStyle: AppFonts.yekan14Bold.copyWith(color: AppColor.greenNormal),
|
||||||
value: '${item.amount?.separatedByCommaFa} ریال',
|
value: item.amount?.separatedByCommaFa ?? 'N/A',
|
||||||
|
valueLabel: 'ریال',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
title: 'قیمت کل',
|
||||||
|
value: item.totalAmount?.separatedByCommaFa ?? 'N/A',
|
||||||
|
valueLabel: 'ریال',
|
||||||
),
|
),
|
||||||
buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByCommaFa} ریال'),
|
|
||||||
|
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: item.receiverState == 'pending',
|
visible: item.receiverState == 'pending',
|
||||||
@@ -222,7 +230,6 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
conformationBottomSheet(item),
|
conformationBottomSheet(item),
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
).then((value) {
|
).then((value) {
|
||||||
|
|
||||||
Get.back();
|
Get.back();
|
||||||
controller.clearApprovedController();
|
controller.clearApprovedController();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
labelColor: AppColor.blueLight,
|
labelColor: AppColor.blueLight,
|
||||||
labelIcon: Assets.vec.timerSvg.path,
|
labelIcon: Assets.vec.timerSvg.path,
|
||||||
|
labelIconColor: AppColor.yellowNormal2,
|
||||||
);
|
);
|
||||||
}, controller.isExpandedListIndex);
|
}, controller.isExpandedListIndex);
|
||||||
},
|
},
|
||||||
@@ -90,9 +91,10 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${item.weightOfCarcasses?.separatedByCommaFa}kg',
|
item.weightOfCarcasses?.separatedByCommaFa.addKg ?? 'N/A',
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
textDirection: TextDirection.ltr,
|
||||||
|
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,13 +19,14 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
isBase: true,
|
isBase: true,
|
||||||
onRefresh: controller.refreshData,
|
onRefresh: controller.refreshData,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
padding: EdgeInsets.only(bottom: 100.h),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 18.h),
|
SizedBox(height: 18.h),
|
||||||
mainInformation(),
|
mainInformation(),
|
||||||
SizedBox(height: 8.h),
|
SizedBox(height: 8.h),
|
||||||
WidelyUsedWidget(),
|
WidelyUsedWidget(),
|
||||||
SizedBox(height: 20),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -189,9 +189,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${item.weightOfCarcasses?.separatedByCommaFa}kg',
|
item.weightOfCarcasses!.separatedByCommaFa.addKg,
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
textDirection: TextDirection.ltr,
|
||||||
|
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
|
|||||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
||||||
@@ -140,11 +141,11 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
'${item.weightOfCarcasses?.separatedByCommaFa ?? 0}KG',
|
item.weightOfCarcasses!.separatedByCommaFa.addKg,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
style: AppFonts.yekan12Bold.copyWith(color: AppColor.textColor),
|
style: AppFonts.yekan12Bold.copyWith(color: AppColor.textColor),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -176,22 +177,19 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
item.buyer?.province?? 'N/A',
|
item.buyer?.province ?? 'N/A',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
item.buyer?.city?? 'N/A',
|
item.buyer?.city ?? 'N/A',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -257,12 +255,30 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
|
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
|
||||||
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
|
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'وزن لاشه (کیلوگرم)',
|
title: 'وزن لاشه ',
|
||||||
value: '${item.weightOfCarcasses?.separatedByCommaFa}',
|
value: '${item.weightOfCarcasses?.separatedByCommaFa}',
|
||||||
|
valueLabel: 'کیلوگرم'
|
||||||
),
|
),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'حجم تقریبی لاشه (قطعه)',
|
title: 'حجم تقریبی لاشه ',
|
||||||
value: '${item.numberOfCarcasses?.separatedByCommaFa}',
|
value: '${item.numberOfCarcasses?.separatedByCommaFa}',
|
||||||
|
valueLabel: 'قطعه'
|
||||||
|
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
title: 'انبار فروش',
|
||||||
|
value: '${item.quota?.faTitle}',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
title: 'کد قرنطینه ',
|
||||||
|
value: item.clearanceCode?? 'بدون کد',
|
||||||
|
),
|
||||||
|
|
||||||
|
buildRow(
|
||||||
|
title: 'حجم تقریبی لاشه ',
|
||||||
|
value: '${item.numberOfCarcasses?.separatedByCommaFa}',
|
||||||
|
valueLabel: 'قطعه'
|
||||||
|
|
||||||
),
|
),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
|
|||||||
return ObxValue((val) {
|
return ObxValue((val) {
|
||||||
return ExpandableListItem2(
|
return ExpandableListItem2(
|
||||||
selected: val.value == index,
|
selected: val.value == index,
|
||||||
onTap: () => controller.toggleExpansion(),
|
onTap: () => controller.toggleExpansion(index: index),
|
||||||
index: index,
|
index: index,
|
||||||
child: itemListWidget(item),
|
child: itemListWidget(item),
|
||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
@@ -304,7 +304,16 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
|
|||||||
title: 'تعداد درخواست ها',
|
title: 'تعداد درخواست ها',
|
||||||
value: '${item.requestsInfo?.numberOfRequests.separatedByCommaFa}',
|
value: '${item.requestsInfo?.numberOfRequests.separatedByCommaFa}',
|
||||||
),
|
),
|
||||||
buildRow(title: 'وزن', value: '${item.requestsInfo?.totalWeight.separatedByCommaFa}'),
|
buildRow(
|
||||||
|
title: 'حجم تقریبی',
|
||||||
|
value: '${item.requestsInfo?.totalQuantity.separatedByCommaFa}',
|
||||||
|
valueLabel: 'قطعه',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
title: 'وزن',
|
||||||
|
value: '${item.requestsInfo?.totalWeight.separatedByCommaFa}',
|
||||||
|
valueLabel: 'کیلوگرم',
|
||||||
|
),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
|
|||||||
secondChild: itemListExpandedWidget(item, index),
|
secondChild: itemListExpandedWidget(item, index),
|
||||||
labelColor: AppColor.blueLight,
|
labelColor: AppColor.blueLight,
|
||||||
labelIcon: Assets.vec.timerSvg.path,
|
labelIcon: Assets.vec.timerSvg.path,
|
||||||
|
labelIconColor: AppColor.yellowNormal2,
|
||||||
);
|
);
|
||||||
}, controller.expandedListIndex);
|
}, controller.expandedListIndex);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -132,9 +132,10 @@ class SegmentationPage extends GetView<SegmentationLogic> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
'${item.weight.separatedByCommaFa} KG',
|
item.weight.separatedByCommaFa.addKg,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
textDirection: TextDirection.ltr,
|
||||||
|
style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -207,7 +208,10 @@ class SegmentationPage extends GetView<SegmentationLogic> {
|
|||||||
: item.buyer?.shop ?? 'N/A',
|
: item.buyer?.shop ?? 'N/A',
|
||||||
),
|
),
|
||||||
buildRow(title: 'ماهیت', value: item.toGuild != null ? 'مباشر' : 'قطعهبند'),
|
buildRow(title: 'ماهیت', value: item.toGuild != null ? 'مباشر' : 'قطعهبند'),
|
||||||
buildRow(title: 'وزن قطعهبندی', value: '${item.weight?.separatedByCommaFa}'),
|
buildRow(title: 'وزن قطعهبندی',
|
||||||
|
value: item.weight!.separatedByCommaFa,
|
||||||
|
valueLabel: 'کیلوگرم'
|
||||||
|
),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@@ -128,12 +128,15 @@ class AppColor {
|
|||||||
static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218)
|
static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218)
|
||||||
static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178)
|
static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178)
|
||||||
static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7)
|
static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7)
|
||||||
|
static const Color yellowNormal2 = Color(0xFFFF9800); // #FF9800 rgb(255, 152, 0)
|
||||||
static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6)
|
static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6)
|
||||||
static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6)
|
static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6)
|
||||||
static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5)
|
static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5)
|
||||||
static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4)
|
static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4)
|
||||||
static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3)
|
static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3)
|
||||||
static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2)
|
static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2)
|
||||||
|
|
||||||
|
// #594402 rgb(89, 68, 2)
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region --- red Colors ---
|
//region --- red Colors ---
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
if (hasNotification) SizedBox(width: 8.w),
|
if (hasNotification) SizedBox(width: 8.w),
|
||||||
|
|
||||||
if (!isBase) ...{
|
if (!isBase) ...{
|
||||||
|
SizedBox(width: 8.w),
|
||||||
if (hasFilter)
|
if (hasFilter)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: onFilterTap,
|
onTap: onFilterTap,
|
||||||
@@ -95,7 +96,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (hasBack) SizedBox(width: 8.w),
|
if (hasBack) SizedBox(width: 8.w),
|
||||||
|
if (hasSearch) SizedBox(width: 8.w),
|
||||||
if (hasSearch) GestureDetector(
|
if (hasSearch) GestureDetector(
|
||||||
onTap: onSearchTap,
|
onTap: onSearchTap,
|
||||||
child: Assets.vec.searchSvg.svg(
|
child: Assets.vec.searchSvg.svg(
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:persian_datetime_picker/persian_datetime_picker.dart';
|
import 'package:persian_datetime_picker/persian_datetime_picker.dart';
|
||||||
|
|
||||||
extension XString on String {
|
extension XString on String? {
|
||||||
String get separatedByComma {
|
String get separatedByComma {
|
||||||
final formatter = NumberFormat('#,###');
|
final formatter = NumberFormat('#,###');
|
||||||
final number = num.tryParse(this);
|
final number = num.tryParse(this ?? '');
|
||||||
return number != null ? formatter.format(number) : this;
|
return number != null ? formatter.format(number) : (this ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
String get clearComma {
|
String get clearComma {
|
||||||
return replaceAll(RegExp(r'\D'), '');
|
return (this ?? '').replaceAll(RegExp(r'\D'), '');
|
||||||
}
|
}
|
||||||
|
|
||||||
String get addCountEXT {
|
String get addCountEXT {
|
||||||
@@ -20,21 +20,29 @@ extension XString on String {
|
|||||||
return '$thisروزه';
|
return '$thisروزه';
|
||||||
}
|
}
|
||||||
|
|
||||||
String get addKgEXT {
|
String get addKgFa {
|
||||||
return '$this کیلوگرم';
|
return '${this ?? 0}کیلوگرم ';
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime get toDateTime => DateTime.parse(this);
|
String get addKgFaWithParentheses {
|
||||||
|
return '${this ?? 0} (کیلوگرم)';
|
||||||
|
}
|
||||||
|
|
||||||
|
String get addKg {
|
||||||
|
return '$this KG';
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime get toDateTime => DateTime.parse(this ?? '');
|
||||||
|
|
||||||
String get formattedJalaliDate {
|
String get formattedJalaliDate {
|
||||||
String tmp = contains("/") ? replaceAll("/", "-") : this;
|
String tmp = (this != null && this!.contains("/")) ? this!.replaceAll("/", "-") : (this ?? "");
|
||||||
final dateTime = DateTime.parse(tmp);
|
final dateTime = DateTime.parse(tmp);
|
||||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||||
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||||
}
|
}
|
||||||
|
|
||||||
String get formattedJalaliDateYHMS {
|
String get formattedJalaliDateYHMS {
|
||||||
final dateTime = DateTime.parse(this);
|
final dateTime = DateTime.parse(this ?? '');
|
||||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||||
return "${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')} - ${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
return "${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')} - ${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||||
}
|
}
|
||||||
@@ -44,9 +52,9 @@ extension XString on String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Jalali get toJalali {
|
Jalali get toJalali {
|
||||||
final dateTime = DateTime.parse(this);
|
final dateTime = DateTime.parse(this ?? '');
|
||||||
return Jalali.fromDateTime(dateTime);
|
return Jalali.fromDateTime(dateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
int get versionNumber => int.parse(replaceAll(".", ''));
|
int get versionNumber => int.parse(this?.replaceAll(".", '') ?? '0');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -558,12 +558,12 @@ class MapPage extends GetView<MapLogic> {
|
|||||||
|
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'میانگین وزن کشتار',
|
title: 'میانگین وزن کشتار',
|
||||||
value: hatchingDetails?.totalAverageKilledWeight.toString().addKgEXT ?? 'N/A',
|
value: hatchingDetails?.totalAverageKilledWeight.toString().addKgFa ?? 'N/A',
|
||||||
),
|
),
|
||||||
|
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'وزن کشتار',
|
title: 'وزن کشتار',
|
||||||
value: hatchingDetails?.totalKilledWeight.separatedByCommaFa.addKgEXT ?? 'N/A',
|
value: hatchingDetails?.totalKilledWeight.separatedByCommaFa.addKgFa ?? 'N/A',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user