feat : list view item in out of the province
14879
assets/anim/error.json
Normal file
8
assets/icons/clipboard_eye.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<svg width="20" height="24" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.8071 2.18154H14.7275V1.63608C14.7275 1.49141 14.67 1.35267 14.5677 1.25038C14.4654 1.14808 14.3267 1.09062 14.182 1.09062H11.7045C11.5137 0.759108 11.2389 0.483748 10.9077 0.29228C10.5766 0.100812 10.2008 0 9.81831 0C9.4358 0 9.06004 0.100812 8.7289 0.29228C8.39776 0.483748 8.12293 0.759108 7.9321 1.09062H5.45461C5.30995 1.09062 5.17121 1.14808 5.06892 1.25038C4.96662 1.35267 4.90915 1.49141 4.90915 1.63608V2.18154H1.82948C1.34445 2.18212 0.879448 2.37505 0.536479 2.71802C0.193511 3.06099 0.000577418 3.52599 0 4.01102V22.1705C0.000577418 22.6556 0.193511 23.1206 0.536479 23.4635C0.879448 23.8065 1.34445 23.9994 1.82948 24H17.8071C18.2922 23.9994 18.7572 23.8065 19.1001 23.4635C19.4431 23.1206 19.636 22.6556 19.6366 22.1705V4.01102C19.636 3.52599 19.4431 3.06099 19.1001 2.71802C18.7572 2.37505 18.2922 2.18212 17.8071 2.18154ZM6.00008 2.18154H8.28011C8.3935 2.18138 8.50403 2.14589 8.59631 2.08C8.6886 2.01411 8.75805 1.9211 8.79502 1.8139C8.86961 1.60222 9.00805 1.4189 9.19123 1.28922C9.37441 1.15955 9.59332 1.08991 9.81776 1.08991C10.0422 1.08991 10.2611 1.15955 10.4443 1.28922C10.6275 1.4189 10.7659 1.60222 10.8405 1.8139C10.8775 1.92127 10.9472 2.01441 11.0397 2.08032C11.1322 2.14622 11.2429 2.18161 11.3565 2.18154H13.6365V4.36339H6.00008V2.18154ZM18.5457 22.1705C18.5454 22.3663 18.4675 22.554 18.3291 22.6924C18.1906 22.8309 18.0029 22.9088 17.8071 22.9091H1.82948C1.63369 22.9088 1.446 22.8309 1.30756 22.6924C1.16912 22.554 1.09121 22.3663 1.09092 22.1705V4.01102C1.09121 3.81523 1.16912 3.62754 1.30756 3.4891C1.446 3.35066 1.63369 3.27275 1.82948 3.27246H4.90915V4.90885C4.90915 5.05351 4.96662 5.19225 5.06892 5.29455C5.17121 5.39684 5.30995 5.45431 5.45461 5.45431H14.182C14.3267 5.45431 14.4654 5.39684 14.5677 5.29455C14.67 5.19225 14.7275 5.05351 14.7275 4.90885V3.27246H17.8071C18.0029 3.27275 18.1906 3.35066 18.3291 3.4891C18.4675 3.62754 18.5454 3.81523 18.5457 4.01102V22.1705Z"
|
||||
fill="#FFFFFF"/>
|
||||
<path d="M9.81901 9.81836C12.0031 9.81836 13.9937 10.7485 15.49 11.7341C17.1934 12.8562 17.1934 15.1962 15.49 16.3183C13.9937 17.3039 12.0031 18.2341 9.81901 18.2341C7.63495 18.2341 5.64435 17.3039 4.14806 16.3183C2.44461 15.1962 2.44461 12.8562 4.14806 11.7341C5.64435 10.7485 7.63495 9.81836 9.81901 9.81836Z"
|
||||
stroke="#FFFFFF" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.81821 15.6733C10.2066 15.6741 10.5865 15.5591 10.9095 15.3428C11.2324 15.1265 11.4837 14.8189 11.6314 14.459C11.78 14.0996 11.8189 13.7042 11.7432 13.3227C11.6674 12.9412 11.4804 12.5908 11.2059 12.3157C10.9327 12.0408 10.5841 11.8534 10.2044 11.7774C9.82207 11.7011 9.42576 11.7398 9.06543 11.8889C8.70788 12.0394 8.40245 12.292 8.18713 12.6152C7.97182 12.9384 7.85614 13.3178 7.85449 13.7063C7.85449 14.228 8.06137 14.7283 8.42964 15.0972C8.79791 15.466 9.2974 15.6733 9.81821 15.6733Z"
|
||||
stroke="#FFFFFF" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
6
assets/icons/clipboard_task.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M32.205 4.99986H27.5V4.16652C27.5 3.94551 27.4122 3.73355 27.2559 3.57727C27.0996 3.42099 26.8877 3.33319 26.6667 3.33319H22.8817C22.5901 2.82673 22.1702 2.40604 21.6643 2.11353C21.1584 1.82101 20.5844 1.66699 20 1.66699C19.4156 1.66699 18.8416 1.82101 18.3357 2.11353C17.8297 2.40604 17.4099 2.82673 17.1183 3.33319H13.3333C13.1123 3.33319 12.9004 3.42099 12.7441 3.57727C12.5878 3.73355 12.5 3.94551 12.5 4.16652V4.99986H7.795C7.05399 5.00074 6.34358 5.2955 5.81961 5.81947C5.29564 6.34344 5.00088 7.05385 5 7.79486V35.5382C5.00088 36.2792 5.29564 36.9896 5.81961 37.5136C6.34358 38.0376 7.05399 38.3323 7.795 38.3332H32.205C32.946 38.3323 33.6564 38.0376 34.1804 37.5136C34.7044 36.9896 34.9991 36.2792 35 35.5382V7.79486C34.9991 7.05385 34.7044 6.34344 34.1804 5.81947C33.6564 5.2955 32.946 5.00074 32.205 4.99986ZM14.1667 4.99986H17.65C17.8232 4.99962 17.9921 4.9454 18.1331 4.84473C18.2741 4.74407 18.3802 4.60197 18.4367 4.43819C18.5506 4.11479 18.7621 3.83472 19.042 3.63661C19.3218 3.4385 19.6563 3.3321 19.9992 3.3321C20.3421 3.3321 20.6765 3.4385 20.9564 3.63661C21.2362 3.83472 21.4477 4.11479 21.5617 4.43819C21.6182 4.60223 21.7246 4.74453 21.8659 4.84522C22.0072 4.94591 22.1765 4.99997 22.35 4.99986H25.8333V8.33319H14.1667V4.99986ZM33.3333 35.5382C33.3329 35.8373 33.2139 36.124 33.0024 36.3356C32.7909 36.5471 32.5041 36.6661 32.205 36.6665H7.795C7.49588 36.6661 7.20914 36.5471 6.99763 36.3356C6.78613 36.124 6.66711 35.8373 6.66667 35.5382V7.79486C6.66711 7.49574 6.78613 7.209 6.99763 6.99749C7.20914 6.78598 7.49588 6.66697 7.795 6.66652H12.5V9.16652C12.5 9.38754 12.5878 9.5995 12.7441 9.75578C12.9004 9.91206 13.1123 9.99986 13.3333 9.99986H26.6667C26.8877 9.99986 27.0996 9.91206 27.2559 9.75578C27.4122 9.5995 27.5 9.38754 27.5 9.16652V6.66652H32.205C32.5041 6.66697 32.7909 6.78598 33.0024 6.99749C33.2139 7.209 33.3329 7.49574 33.3333 7.79486V35.5382Z" fill="white"/>
|
||||
<path d="M30.833 11.667H9.16634C8.94533 11.667 8.73337 11.7548 8.57709 11.9111C8.42081 12.0674 8.33301 12.2793 8.33301 12.5003V34.167C8.33301 34.388 8.42081 34.6 8.57709 34.7563C8.73337 34.9125 8.94533 35.0003 9.16634 35.0003H30.833C31.054 35.0003 31.266 34.9125 31.4223 34.7563C31.5785 34.6 31.6663 34.388 31.6663 34.167V12.5003C31.6663 12.2793 31.5785 12.0674 31.4223 11.9111C31.266 11.7548 31.054 11.667 30.833 11.667ZM29.9997 33.3337H9.99967V13.3337H29.9997V33.3337Z" fill="white"/>
|
||||
<path d="M18.5771 25.5898C18.6545 25.6674 18.7464 25.7289 18.8477 25.7709C18.9489 25.8129 19.0575 25.8346 19.1671 25.8346C19.2767 25.8346 19.3852 25.8129 19.4865 25.7709C19.5877 25.7289 19.6797 25.6674 19.7571 25.5898L23.0904 22.2564C23.2469 22.0999 23.3348 21.8877 23.3348 21.6664C23.3348 21.4451 23.2469 21.2329 23.0904 21.0764C22.9339 20.9199 22.7217 20.832 22.5004 20.832C22.2791 20.832 22.0669 20.9199 21.9104 21.0764L19.1671 23.8214L18.0904 22.7431C17.9339 22.5866 17.7217 22.4987 17.5004 22.4987C17.2791 22.4987 17.0669 22.5866 16.9104 22.7431C16.7539 22.8996 16.666 23.1118 16.666 23.3331C16.666 23.5544 16.7539 23.7666 16.9104 23.9231L18.5771 25.5898Z" fill="white"/>
|
||||
<path d="M20 30.833C21.4834 30.833 22.9334 30.3931 24.1668 29.569C25.4001 28.7449 26.3614 27.5736 26.9291 26.2031C27.4968 24.8327 27.6453 23.3247 27.3559 21.8698C27.0665 20.415 26.3522 19.0786 25.3033 18.0297C24.2544 16.9808 22.918 16.2665 21.4632 15.9771C20.0083 15.6877 18.5003 15.8363 17.1299 16.4039C15.7594 16.9716 14.5881 17.9329 13.764 19.1662C12.9399 20.3996 12.5 21.8497 12.5 23.333C12.5022 25.3215 13.2931 27.2278 14.6991 28.6339C16.1052 30.0399 18.0116 30.8308 20 30.833ZM20 17.4997C21.1537 17.4997 22.2815 17.8418 23.2408 18.4828C24.2001 19.1237 24.9478 20.0348 25.3893 21.1007C25.8308 22.1666 25.9463 23.3395 25.7212 24.471C25.4962 25.6026 24.9406 26.642 24.1248 27.4578C23.309 28.2736 22.2696 28.8292 21.138 29.0543C20.0065 29.2793 18.8336 29.1638 17.7677 28.7223C16.7018 28.2808 15.7907 27.5331 15.1498 26.5738C14.5088 25.6146 14.1667 24.4867 14.1667 23.333C14.1667 21.7859 14.7812 20.3022 15.8752 19.2082C16.9692 18.1143 18.4529 17.4997 20 17.4997Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
3
assets/icons/killogram.svg
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 12 KiB |
BIN
assets/vec/clipboard_eye.svg.vec
Normal file
BIN
assets/vec/clipboard_task.svg.vec
Normal file
BIN
assets/vec/killogram.svg.vec
Normal file
@@ -5,9 +5,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -28,143 +28,51 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 18, 80),
|
||||
itemBuilder: (context, index) => ListItem(
|
||||
expandList: controller.isExpandedList,
|
||||
index: index,
|
||||
child: Container(height: 40, color: Colors.red),
|
||||
secondChild: Container(height: 80, color: Colors.blue),
|
||||
labelColor: AppColor.lightGreyNormalHover,
|
||||
labelIcon: Assets.vec.truckFastSvg.path,
|
||||
),
|
||||
itemCount: data.value.data?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async {},
|
||||
);
|
||||
}, controller.purchaseOutOfProvinceList),
|
||||
),
|
||||
],
|
||||
floatingActionButton: RFab.add(
|
||||
onPressed: () {
|
||||
Get.bottomSheet(addPurchasedInformationBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||
);
|
||||
}
|
||||
|
||||
Widget saleListWidget() {
|
||||
return ObxValue((data) {
|
||||
switch (data.value.status) {
|
||||
case Status.initial:
|
||||
case Status.loading:
|
||||
return Center(child: CupertinoActivityIndicator());
|
||||
case Status.success:
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: BouncingScrollPhysics(),
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 18, 80),
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||
itemBuilder: (context, index) {
|
||||
return ObxValue(
|
||||
(expandList) => saleListItem(
|
||||
expandList: expandList,
|
||||
var item = data.value.data![index];
|
||||
return ObxValue((val) {
|
||||
return ListItem2(
|
||||
selected: val.contains(index),
|
||||
onTap: () => controller.isExpandedList.toggle(index),
|
||||
|
||||
index: index,
|
||||
item: data.value.data![index],
|
||||
),
|
||||
controller.isExpandedList,
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8),
|
||||
itemCount: data.value.data?.length ?? 0,
|
||||
);
|
||||
case Status.error:
|
||||
return Center(
|
||||
child: Text(
|
||||
data.value.message ?? 'خطا در دریافت اطلاعات',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.error),
|
||||
),
|
||||
);
|
||||
case Status.empty:
|
||||
return emptyWidget();
|
||||
}
|
||||
}, controller.purchaseOutOfProvinceList);
|
||||
}
|
||||
|
||||
Widget emptyWidget() {
|
||||
return Center(
|
||||
child: Text(
|
||||
'داده ای دریافت نشد!',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
GestureDetector saleListItem({
|
||||
required RxList<int> expandList,
|
||||
required int index,
|
||||
required StewardFreeBar item,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (expandList.contains(index)) {
|
||||
controller.isExpandedList.remove(index);
|
||||
} else {
|
||||
controller.isExpandedList.add(index);
|
||||
}
|
||||
},
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
AnimatedSize(
|
||||
duration: Duration(milliseconds: 300),
|
||||
child: Container(
|
||||
width: Get.width - 30,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.5, color: AppColor.darkGreyNormal),
|
||||
),
|
||||
child: AnimatedCrossFade(
|
||||
alignment: Alignment.center,
|
||||
firstChild: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
SizedBox(width: 12),
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.killHouseName ?? 'N/A',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.date?.formattedJalaliDate ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
item.killHouseName ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'${item.weightOfCarcasses?.separatedByComma}kg',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
SizedBox(height: 2),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Visibility(
|
||||
visible: item.product?.name?.contains('مرغ گرم') ?? false,
|
||||
child: Assets.vec.hotChickenSvg.svg(
|
||||
@@ -176,25 +84,36 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${item.weightOfCarcasses?.separatedByComma}kg',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 2),
|
||||
|
||||
Text(
|
||||
'${item.province}',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
'${item.province}\n${item.city}',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
flex: 1,
|
||||
child: Assets.vec.scanSvg.svg(
|
||||
width: 32.w,
|
||||
height: 32.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
Icon(CupertinoIcons.chevron_down, size: 12),
|
||||
SizedBox(width: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
||||
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -203,44 +122,13 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.setEditData(item);
|
||||
Get.bottomSheet(
|
||||
addPurchasedInformationBottomSheet(true),
|
||||
isScrollControlled: true,
|
||||
).whenComplete(() {
|
||||
controller.resetSubmitForm();
|
||||
});
|
||||
},
|
||||
child: Assets.vec.editSvg.svg(
|
||||
width: 20,
|
||||
height: 20,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${item.province}-${item.city}',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
buildDeleteDialog(
|
||||
onConfirm: () =>
|
||||
controller.deleteStewardPurchaseOutOfProvince(item.key!),
|
||||
);
|
||||
},
|
||||
child: Assets.vec.trashSvg.svg(
|
||||
width: 20,
|
||||
height: 20,
|
||||
colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
@@ -253,22 +141,57 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: buildRow('تاریخ', item.date?.formattedJalaliDateYHMS ?? 'N/A'),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
'مشخصات فروشنده',
|
||||
'${item.killHouseName} - ${item.killHouseMobile ?? 'N/A'}',
|
||||
),
|
||||
buildRow('محصول', item.product?.name ?? 'N/A'),
|
||||
buildRow(
|
||||
'وزن خریداری شده',
|
||||
'${item.weightOfCarcasses?.separatedByComma} کیلوگرم',
|
||||
),
|
||||
Row(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
Row(
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.date?.toJalali.formatter.wN ?? 'N/A',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Text(
|
||||
'${item.date?.toJalali.formatter.y}',
|
||||
style: AppFonts.yekan20.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(title: 'مشخصات فروشنده', value: item.killHouseName ?? 'N/A'),
|
||||
|
||||
buildRow(
|
||||
title: 'تلفن فروشنده',
|
||||
value: item.killHouseMobile ?? 'N/A',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
||||
buildRow(
|
||||
title: 'وزن خریداری شده',
|
||||
value: '${item.weightOfCarcasses?.separatedByComma} کیلوگرم',
|
||||
),
|
||||
buildRowOnTapped(
|
||||
title: 'مشاهده بارنامه',
|
||||
titleStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
valueWidget: Assets.vec.clipboardEyeSvg.svg(
|
||||
width: 20,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
BaseBottomSheet(
|
||||
@@ -302,73 +225,63 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
'مشاهده بارنامه',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
Icon(CupertinoIcons.chevron_up, size: 12),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
crossFadeState: expandList.contains(index)
|
||||
? CrossFadeState.showSecond
|
||||
: CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: -12,
|
||||
child: Container(
|
||||
width: index < 999 ? 24 : null,
|
||||
height: index < 999 ? 24 : null,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildRow(String title, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 16.w,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.left,
|
||||
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
RElevated(
|
||||
text: 'ویرایش',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
controller.setEditData(item);
|
||||
Get.bottomSheet(
|
||||
addPurchasedInformationBottomSheet(true),
|
||||
isScrollControlled: true,
|
||||
).whenComplete(() {
|
||||
controller.resetSubmitForm();
|
||||
});
|
||||
},
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
),
|
||||
ROutlinedElevated(
|
||||
text: 'حذف',
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
buildDeleteDialog(
|
||||
onConfirm: () =>
|
||||
controller.deleteStewardPurchaseOutOfProvince(item.key!),
|
||||
);
|
||||
},
|
||||
borderColor: AppColor.redNormal,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.truckFastOutlinedSvg.path,
|
||||
);
|
||||
}, controller.isExpandedList);
|
||||
},
|
||||
itemCount: data.value.data?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async {},
|
||||
);
|
||||
}, controller.purchaseOutOfProvinceList),
|
||||
),
|
||||
],
|
||||
floatingActionButton: RFab.add(
|
||||
onPressed: () {
|
||||
Get.bottomSheet(addPurchasedInformationBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -389,6 +302,8 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
controller: controller.sellerNameController,
|
||||
label: 'نام فروشنده',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filled: true,
|
||||
filledColor: AppColor.bgLight,
|
||||
),
|
||||
RTextField(
|
||||
controller: controller.sellerPhoneController,
|
||||
@@ -396,6 +311,8 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
keyboardType: TextInputType.phone,
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
maxLength: 11,
|
||||
filled: true,
|
||||
filledColor: AppColor.bgLight,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'لطفاً شماره موبایل را وارد کنید';
|
||||
@@ -415,7 +332,13 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
_cityWidget(),
|
||||
RTextField(
|
||||
controller: controller.carcassWeightController,
|
||||
label: 'وزن لاشه',
|
||||
label: 'وزن',
|
||||
filled: true,
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Assets.vec.killogramSvg.svg(),
|
||||
),
|
||||
filledColor: AppColor.bgLight,
|
||||
keyboardType: TextInputType.number,
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
inputFormatters: [
|
||||
@@ -437,6 +360,8 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
return ObxValue((data) {
|
||||
return RElevated(
|
||||
text: isOnEdit ? 'ویرایش' : 'ثبت خرید',
|
||||
width: Get.width,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
onPressed: data.value
|
||||
? () async {
|
||||
var res = await controller.createStewardPurchaseOutOfProvince();
|
||||
@@ -459,8 +384,16 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
},
|
||||
selectedItem: controller.selectedProduct.value,
|
||||
initialValue: controller.selectedProduct.value,
|
||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب محصول'),
|
||||
itemBuilder: (item) => Text(
|
||||
item.name ?? 'بدون نام',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
||||
),
|
||||
labelBuilder: (item) => item?.name != null
|
||||
? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor))
|
||||
: Text(
|
||||
'انتخاب محصول',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -474,8 +407,16 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
print('Selected Product: ${value.name}');
|
||||
},
|
||||
selectedItem: controller.selectedProvince.value,
|
||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'),
|
||||
itemBuilder: (item) => Text(
|
||||
item.name ?? 'بدون نام',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
||||
),
|
||||
labelBuilder: (item) => item?.name != null
|
||||
? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor))
|
||||
: Text(
|
||||
'انتخاب استان',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -486,11 +427,15 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
items: data,
|
||||
onChanged: (value) {
|
||||
controller.selectedCity.value = value;
|
||||
print('Selected Product: ${value.name}');
|
||||
},
|
||||
selectedItem: controller.selectedCity.value,
|
||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'),
|
||||
itemBuilder: (item) => Text(
|
||||
item.name ?? 'بدون نام',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
||||
),
|
||||
labelBuilder: (item) => item?.name != null
|
||||
? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor))
|
||||
: Text('انتخاب شهر', style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight)),
|
||||
);
|
||||
}, controller.cites);
|
||||
}
|
||||
@@ -498,71 +443,49 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
SizedBox _imageCarcasesWidget(bool isOnEdit) {
|
||||
return SizedBox(
|
||||
width: Get.width,
|
||||
height: 250,
|
||||
height: 370,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text('بارنامه', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return Container(
|
||||
width: Get.width,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.lightGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLight),
|
||||
),
|
||||
child: Center(
|
||||
child: isOnEdit
|
||||
? Image.network(controller.editImageUrl.value ?? '')
|
||||
: data.value == null
|
||||
? Assets.images.placeHolder.image(height: 150, width: 200)
|
||||
? Padding(
|
||||
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
|
||||
child: Assets.vec.placeHolderSvg.svg(width: 200.w, height: 150.h),
|
||||
)
|
||||
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
||||
),
|
||||
);
|
||||
}, controller.selectedImage),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
width: Get.width,
|
||||
height: 40,
|
||||
child: Row(
|
||||
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'تصویر بار',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
padding: EdgeInsetsGeometry.symmetric(horizontal: 6, vertical: 4),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text('دوربین', style: AppFonts.yekan14.copyWith(color: Colors.white)),
|
||||
SizedBox(width: 8),
|
||||
Icon(CupertinoIcons.camera, color: Colors.white),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
RElevated(
|
||||
text: 'گالری',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 60,
|
||||
@@ -570,25 +493,24 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
padding: EdgeInsetsGeometry.symmetric(horizontal: 6, vertical: 4),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text('گالری', style: AppFonts.yekan14.copyWith(color: Colors.white)),
|
||||
SizedBox(width: 8),
|
||||
Icon(CupertinoIcons.photo, color: Colors.white),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
ROutlinedElevated(
|
||||
text: 'دوربین',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -4,33 +4,29 @@ import 'package:rasadyar_core/core.dart';
|
||||
class ListItem extends StatelessWidget {
|
||||
const ListItem({
|
||||
super.key,
|
||||
required this.expandList,
|
||||
required this.index,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final RxList<int> expandList;
|
||||
final int index;
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
/*if (expandList.contains(index)) {
|
||||
controller.isExpandedList.remove(index);
|
||||
} else {
|
||||
controller.isExpandedList.add(index);
|
||||
}*/
|
||||
},
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
@@ -83,7 +79,7 @@ class ListItem extends StatelessWidget {
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: expandList.contains(index)
|
||||
crossFadeState: selected
|
||||
? CrossFadeState.showSecond
|
||||
: CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
@@ -129,3 +125,115 @@ class ListItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListItem2 extends StatelessWidget {
|
||||
const ListItem2({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.child,
|
||||
required this.secondChild,
|
||||
required this.labelColor,
|
||||
required this.labelIcon,
|
||||
required this.onTap,
|
||||
required this.selected,
|
||||
this.labelIconColor = AppColor.mediumGreyDarkHover,
|
||||
});
|
||||
|
||||
final int index;
|
||||
final Widget child;
|
||||
final Widget secondChild;
|
||||
final Color labelColor;
|
||||
final String labelIcon;
|
||||
final Color? labelIconColor;
|
||||
final VoidCallback onTap;
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||
decoration: BoxDecoration(
|
||||
color: labelColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
|
||||
),
|
||||
child: AnimatedSize(
|
||||
duration: Duration(milliseconds: 400),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
AnimatedCrossFade(
|
||||
firstChild: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.zero,
|
||||
bottomRight: Radius.circular(8),
|
||||
topLeft: Radius.zero,
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: SvgGenImage.vec(labelIcon).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
//TODO
|
||||
colorFilter: ColorFilter.mode(labelIconColor ?? AppColor.mediumGreyDarkActive, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
secondChild: Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 12, 12),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: secondChild,
|
||||
),
|
||||
crossFadeState: selected ? CrossFadeState.showSecond : CrossFadeState.showFirst,
|
||||
duration: Duration(milliseconds: 300),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: -12,
|
||||
child: Container(
|
||||
width: index < 999 ? 24 : null,
|
||||
height: index < 999 ? 24 : null,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLightHover,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
76
packages/chicken/lib/presentation/widget/list_row_item.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget buildRow({
|
||||
required String title,
|
||||
required String value,
|
||||
TextStyle? titleStyle,
|
||||
TextStyle? valueStyle,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: titleStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.left,
|
||||
style: valueStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildRowOnTapped({
|
||||
String? title,
|
||||
String? value,
|
||||
Widget? titleWidget,
|
||||
Widget? valueWidget,
|
||||
TextStyle? titleStyle,
|
||||
TextStyle? valueStyle,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child:
|
||||
titleWidget ??
|
||||
Text(
|
||||
title ?? 'N/A',
|
||||
textAlign: TextAlign.right,
|
||||
style: titleStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Flexible(
|
||||
flex: 2,
|
||||
child:
|
||||
valueWidget ??
|
||||
Text(
|
||||
value ?? 'N/A',
|
||||
textAlign: TextAlign.left,
|
||||
style: valueStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -361,8 +361,10 @@ class AppColor {
|
||||
|
||||
|
||||
static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64)
|
||||
static const Color bgIcon = Color(0xFF797979); // #797979
|
||||
static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64)
|
||||
static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64)
|
||||
static const Color textColorLight = Color(0xFFB2B2B2);
|
||||
|
||||
//endregion
|
||||
|
||||
|
||||
@@ -16,11 +16,14 @@ import 'package:vector_graphics/vector_graphics.dart' as _vg;
|
||||
class $AssetsAnimGen {
|
||||
const $AssetsAnimGen();
|
||||
|
||||
/// File path: assets/anim/error.json
|
||||
LottieGenImage get error => const LottieGenImage('assets/anim/error.json');
|
||||
|
||||
/// File path: assets/anim/loading.json
|
||||
LottieGenImage get loading => const LottieGenImage('assets/anim/loading.json');
|
||||
|
||||
/// List of all assets
|
||||
List<LottieGenImage> get values => [loading];
|
||||
List<LottieGenImage> get values => [error, loading];
|
||||
}
|
||||
|
||||
class $AssetsIconsGen {
|
||||
@@ -62,6 +65,12 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/chicken.svg
|
||||
SvgGenImage get chicken => const SvgGenImage('assets/icons/chicken.svg');
|
||||
|
||||
/// File path: assets/icons/clipboard_eye.svg
|
||||
SvgGenImage get clipboardEye => const SvgGenImage('assets/icons/clipboard_eye.svg');
|
||||
|
||||
/// File path: assets/icons/clipboard_task.svg
|
||||
SvgGenImage get clipboardTask => const SvgGenImage('assets/icons/clipboard_task.svg');
|
||||
|
||||
/// File path: assets/icons/close_square.svg
|
||||
SvgGenImage get closeSquare => const SvgGenImage('assets/icons/close_square.svg');
|
||||
|
||||
@@ -128,6 +137,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/key.svg
|
||||
SvgGenImage get key => const SvgGenImage('assets/icons/key.svg');
|
||||
|
||||
/// File path: assets/icons/killogram.svg
|
||||
SvgGenImage get killogram => const SvgGenImage('assets/icons/killogram.svg');
|
||||
|
||||
/// File path: assets/icons/liveStock.svg
|
||||
SvgGenImage get liveStock => const SvgGenImage('assets/icons/liveStock.svg');
|
||||
|
||||
@@ -238,6 +250,8 @@ class $AssetsIconsGen {
|
||||
check,
|
||||
checkSquare,
|
||||
chicken,
|
||||
clipboardEye,
|
||||
clipboardTask,
|
||||
closeSquare,
|
||||
convertCube,
|
||||
cube,
|
||||
@@ -260,6 +274,7 @@ class $AssetsIconsGen {
|
||||
inside,
|
||||
inspection,
|
||||
key,
|
||||
killogram,
|
||||
liveStock,
|
||||
logout,
|
||||
map,
|
||||
@@ -363,6 +378,12 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/chicken.svg.vec
|
||||
SvgGenImage get chickenSvg => const SvgGenImage.vec('assets/vec/chicken.svg.vec');
|
||||
|
||||
/// File path: assets/vec/clipboard_eye.svg.vec
|
||||
SvgGenImage get clipboardEyeSvg => const SvgGenImage.vec('assets/vec/clipboard_eye.svg.vec');
|
||||
|
||||
/// File path: assets/vec/clipboard_task.svg.vec
|
||||
SvgGenImage get clipboardTaskSvg => const SvgGenImage.vec('assets/vec/clipboard_task.svg.vec');
|
||||
|
||||
/// File path: assets/vec/close_square.svg.vec
|
||||
SvgGenImage get closeSquareSvg => const SvgGenImage.vec('assets/vec/close_square.svg.vec');
|
||||
|
||||
@@ -429,6 +450,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/key.svg.vec
|
||||
SvgGenImage get keySvg => const SvgGenImage.vec('assets/vec/key.svg.vec');
|
||||
|
||||
/// File path: assets/vec/killogram.svg.vec
|
||||
SvgGenImage get killogramSvg => const SvgGenImage.vec('assets/vec/killogram.svg.vec');
|
||||
|
||||
/// File path: assets/vec/liveStock.svg.vec
|
||||
SvgGenImage get liveStockSvg => const SvgGenImage.vec('assets/vec/liveStock.svg.vec');
|
||||
|
||||
@@ -539,6 +563,8 @@ class $AssetsVecGen {
|
||||
checkSvg,
|
||||
checkSquareSvg,
|
||||
chickenSvg,
|
||||
clipboardEyeSvg,
|
||||
clipboardTaskSvg,
|
||||
closeSquareSvg,
|
||||
convertCubeSvg,
|
||||
cubeSvg,
|
||||
@@ -561,6 +587,7 @@ class $AssetsVecGen {
|
||||
insideSvg,
|
||||
inspectionSvg,
|
||||
keySvg,
|
||||
killogramSvg,
|
||||
liveStockSvg,
|
||||
logoutSvg,
|
||||
mapSvg,
|
||||
|
||||
@@ -15,8 +15,11 @@ class BaseBottomSheet extends StatelessWidget {
|
||||
height: height ?? MediaQuery.of(context).size.height * 0.85,
|
||||
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 20),
|
||||
decoration: BoxDecoration(
|
||||
color:bgColor?? Colors.white,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)),
|
||||
color: bgColor ?? Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(25),
|
||||
topRight: Radius.circular(25),
|
||||
),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -33,11 +36,14 @@ class BaseBottomSheet extends StatelessWidget {
|
||||
Container(
|
||||
height: 3,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(color: AppColor.darkGreyDark, borderRadius: BorderRadius.circular(8)),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.darkGreyDark,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
left: 0,
|
||||
left: -10,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -6,16 +6,14 @@ class EmptyWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Column(
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(),
|
||||
Assets.icons.empty.svg(width: 156.w, height: 156.h),
|
||||
Assets.anim.error.lottie(),
|
||||
Text('داده ای یافت نشد', style: AppFonts.yekan20.copyWith(color: AppColor.textColor)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
enum RTextFieldVariant {
|
||||
normal,
|
||||
noBorder,
|
||||
password,
|
||||
passwordNoBorder,
|
||||
}
|
||||
enum RTextFieldVariant { normal, noBorder, password, passwordNoBorder }
|
||||
|
||||
class RTextField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
@@ -40,6 +35,7 @@ class RTextField extends StatefulWidget {
|
||||
final void Function(String)? onChanged;
|
||||
final void Function(String)? onSubmitted;
|
||||
final List<TextInputFormatter>? inputFormatters;
|
||||
final Widget? suffix;
|
||||
|
||||
const RTextField({
|
||||
super.key,
|
||||
@@ -71,32 +67,25 @@ class RTextField extends StatefulWidget {
|
||||
this.onChanged,
|
||||
this.onSubmitted,
|
||||
this.borderColor,
|
||||
this.inputFormatters
|
||||
this.inputFormatters,
|
||||
this.suffix,
|
||||
});
|
||||
|
||||
|
||||
@override
|
||||
State<RTextField> createState() => _RTextFieldState();
|
||||
|
||||
bool get _isPassword => variant == RTextFieldVariant.password;
|
||||
|
||||
bool get _noBorder => variant == RTextFieldVariant.noBorder;
|
||||
|
||||
bool get _passwordNoBorder => variant == RTextFieldVariant.passwordNoBorder;
|
||||
|
||||
|
||||
InputBorder get _inputBorder =>
|
||||
_noBorder || _passwordNoBorder ? InputBorder.none : OutlineInputBorder(
|
||||
InputBorder get _inputBorder => _noBorder || _passwordNoBorder
|
||||
? InputBorder.none
|
||||
: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? AppColor.lightGreyDarkActive,
|
||||
width: 1,
|
||||
),
|
||||
borderSide: BorderSide(color: borderColor ?? AppColor.lightGreyDarkActive, width: 1),
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class _RTextFieldState extends State<RTextField> {
|
||||
@@ -164,6 +153,7 @@ class _RTextFieldState extends State<RTextField> {
|
||||
errorStyle: widget.errorStyle,
|
||||
errorMaxLines: 1,
|
||||
isDense: widget.isDense,
|
||||
suffix: widget.suffix,
|
||||
suffixIcon: _buildSuffixIcon(),
|
||||
suffixIconConstraints: widget.boxConstraints,
|
||||
prefixIcon: widget.prefixIcon,
|
||||
|
||||
@@ -6,9 +6,9 @@ class LoadingWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(child: Center(child: Assets.anim.loading.lottie(
|
||||
return Center(child: Assets.anim.loading.lottie(
|
||||
width: 120.w,
|
||||
height: 120.h,
|
||||
)));
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,9 @@ class _OverlayDropdownState<T> extends State<OverlayDropdownWidget<T>> {
|
||||
elevation: 4,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Container(
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: AppColor.bgLight,
|
||||
border: Border.all(color: AppColor.darkGreyLight),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
@@ -123,6 +124,7 @@ class _OverlayDropdownState<T> extends State<OverlayDropdownWidget<T>> {
|
||||
width: Get.width,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.bgLight,
|
||||
border: Border.all(color: AppColor.darkGreyLight),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
|
||||
@@ -21,6 +21,11 @@ extension XDateTime on String {
|
||||
String get formattedYHMS {
|
||||
return DateFormat('yyyy-MM-dd HH:mm:ss').format(toDateTime);
|
||||
}
|
||||
|
||||
Jalali get toJalali{
|
||||
final dateTime = DateTime.parse(this);
|
||||
return Jalali.fromDateTime(dateTime);
|
||||
}
|
||||
}
|
||||
|
||||
extension XDateTime2 on DateTime {
|
||||
|
||||