feat: new ui changes

This commit is contained in:
2025-10-07 14:21:09 +03:30
parent d5729e04ff
commit 99d1111655
44 changed files with 506 additions and 460 deletions

View File

@@ -1,5 +1,5 @@
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=release
flutter.buildMode=debug
flutter.versionName=1.3.18
flutter.versionCode=15

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

View File

@@ -16,6 +16,7 @@ abstract class SubmitStewardAllocation with _$SubmitStewardAllocation {
int? weightOfCarcasses,
String? sellType,
int? amount,
String? quota,
int? totalAmount,
bool? approvedPriceStatus,
String? date,

View File

@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$SubmitStewardAllocation {
String? get sellerType; String? get buyerType; String? get guildKey; String? get productKey; String? get type; String? get allocationType; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get sellType; int? get amount; int? get totalAmount; bool? get approvedPriceStatus; String? get date;
String? get sellerType; String? get buyerType; String? get guildKey; String? get productKey; String? get type; String? get allocationType; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get sellType; int? get amount; String? get quota; int? get totalAmount; bool? get approvedPriceStatus; String? get date;
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $SubmitStewardAllocationCopyWith<SubmitStewardAllocation> get copyWith => _$Subm
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.quota, quota) || other.quota == quota)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,quota,totalAmount,approvedPriceStatus,date);
@override
String toString() {
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, quota: $quota, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
}
@@ -48,7 +48,7 @@ abstract mixin class $SubmitStewardAllocationCopyWith<$Res> {
factory $SubmitStewardAllocationCopyWith(SubmitStewardAllocation value, $Res Function(SubmitStewardAllocation) _then) = _$SubmitStewardAllocationCopyWithImpl;
@useResult
$Res call({
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, String? quota, int? totalAmount, bool? approvedPriceStatus, String? date
});
@@ -65,7 +65,7 @@ class _$SubmitStewardAllocationCopyWithImpl<$Res>
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? quota = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
return _then(_self.copyWith(
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
@@ -77,7 +77,8 @@ as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarca
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
as int?,quota: freezed == quota ? _self.quota : quota // ignore: cast_nullable_to_non_nullable
as String?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as String?,
@@ -165,10 +166,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, String? quota, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SubmitStewardAllocation() when $default != null:
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.quota,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
return orElse();
}
@@ -186,10 +187,10 @@ return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, String? quota, int? totalAmount, bool? approvedPriceStatus, String? date) $default,) {final _that = this;
switch (_that) {
case _SubmitStewardAllocation():
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.quota,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
throw StateError('Unexpected subclass');
}
@@ -206,10 +207,10 @@ return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, String? quota, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,) {final _that = this;
switch (_that) {
case _SubmitStewardAllocation() when $default != null:
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.quota,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
return null;
}
@@ -221,7 +222,7 @@ return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey
@JsonSerializable()
class _SubmitStewardAllocation implements SubmitStewardAllocation {
const _SubmitStewardAllocation({this.sellerType, this.buyerType, this.guildKey, this.productKey, this.type, this.allocationType, this.numberOfCarcasses, this.weightOfCarcasses, this.sellType, this.amount, this.totalAmount, this.approvedPriceStatus, this.date});
const _SubmitStewardAllocation({this.sellerType, this.buyerType, this.guildKey, this.productKey, this.type, this.allocationType, this.numberOfCarcasses, this.weightOfCarcasses, this.sellType, this.amount, this.quota, this.totalAmount, this.approvedPriceStatus, this.date});
factory _SubmitStewardAllocation.fromJson(Map<String, dynamic> json) => _$SubmitStewardAllocationFromJson(json);
@override final String? sellerType;
@@ -234,6 +235,7 @@ class _SubmitStewardAllocation implements SubmitStewardAllocation {
@override final int? weightOfCarcasses;
@override final String? sellType;
@override final int? amount;
@override final String? quota;
@override final int? totalAmount;
@override final bool? approvedPriceStatus;
@override final String? date;
@@ -251,16 +253,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.quota, quota) || other.quota == quota)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,quota,totalAmount,approvedPriceStatus,date);
@override
String toString() {
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, quota: $quota, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
}
@@ -271,7 +273,7 @@ abstract mixin class _$SubmitStewardAllocationCopyWith<$Res> implements $SubmitS
factory _$SubmitStewardAllocationCopyWith(_SubmitStewardAllocation value, $Res Function(_SubmitStewardAllocation) _then) = __$SubmitStewardAllocationCopyWithImpl;
@override @useResult
$Res call({
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, String? quota, int? totalAmount, bool? approvedPriceStatus, String? date
});
@@ -288,7 +290,7 @@ class __$SubmitStewardAllocationCopyWithImpl<$Res>
/// Create a copy of SubmitStewardAllocation
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? quota = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
return _then(_SubmitStewardAllocation(
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
@@ -300,7 +302,8 @@ as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarca
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
as int?,quota: freezed == quota ? _self.quota : quota // ignore: cast_nullable_to_non_nullable
as String?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as String?,

View File

@@ -19,6 +19,7 @@ _SubmitStewardAllocation _$SubmitStewardAllocationFromJson(
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
sellType: json['sell_type'] as String?,
amount: (json['amount'] as num?)?.toInt(),
quota: json['quota'] as String?,
totalAmount: (json['total_amount'] as num?)?.toInt(),
approvedPriceStatus: json['approved_price_status'] as bool?,
date: json['date'] as String?,
@@ -37,6 +38,7 @@ Map<String, dynamic> _$SubmitStewardAllocationToJson(
'weight_of_carcasses': instance.weightOfCarcasses,
'sell_type': instance.sellType,
'amount': instance.amount,
'quota': instance.quota,
'total_amount': instance.totalAmount,
'approved_price_status': instance.approvedPriceStatus,
'date': instance.date,

View File

@@ -13,7 +13,7 @@ class AuthPage extends GetView<AuthLogic> {
Widget build(BuildContext context) {
return ChickenBasePage(
isFullScreen: true,
backGroundWidget: BackGroundWidget(
backGroundWidget: backGroundDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
@@ -24,7 +24,7 @@ class AuthPage extends GetView<AuthLogic> {
],
stops: const [0.0, 0.5, 1.0],
),
vecPath: Assets.vec.chickenPatternSvg.path,
backgroundPath: Assets.images.patternChicken.path,
),
onPopScopTaped: () => Get.back(result: -1),
child: Stack(

View File

@@ -73,4 +73,11 @@ class ActiveHatchingLogic extends GetxController {
void toggleExpanded(int index) {
expandedIndex.value = expandedIndex.value == index ? -1 : index;
}
Future<void> onRefresh() async {
currentPage.value = 1;
await getHatchingList();
}
}

View File

@@ -50,10 +50,7 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getHatchingList(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getHatchingList();
},
);
}, controller.activeHatchingList);
}

View File

@@ -107,4 +107,10 @@ class FarmLogic extends GetxController {
void toggleExpanded(int index) {
expandedIndex.value = expandedIndex.value == index ? -1 : index;
}
Future<void> onRefresh() async {
currentPage.value = 1;
farmList.value = Resource<PaginationModel<PoultryFarm>>.loading();
await getFarmList();
}
}

View File

@@ -3,7 +3,6 @@ import 'package:rasadyar_chicken/data/models/response/poultry_farm/poultry_farm.
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.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/label_item.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
@@ -16,6 +15,7 @@ class FarmPage extends GetView<FarmLogic> {
return ChickenBasePage(
hasFilter: false,
hasSearch: true,
onRefresh: controller.onRefresh,
onFilterTap: () {
Get.bottomSheet(
isScrollControlled: true,
@@ -29,7 +29,7 @@ class FarmPage extends GetView<FarmLogic> {
},
routes: controller.routes,
backId: poultryFirstKey,
widgets: [firstTagInformation(), farmListWidget()],
child: Column(children: [firstTagInformation(), farmListWidget()]),
);
}
@@ -76,10 +76,7 @@ class FarmPage extends GetView<FarmLogic> {
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getFarmList(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getFarmList();
},
);
}, controller.farmList),
);

View File

@@ -133,4 +133,11 @@ class GenocideLogic extends GetxController {
return 'تایید شده';
}
}
Future<void> onRefresh() async {
currentPage.value = 1;
await getPoultryOrderList();
}
}

View File

@@ -17,6 +17,7 @@ class GenocidePage extends GetView<GenocideLogic> {
routes: controller.routesName,
hasSearch: true,
hasFilter: true,
onRefresh: controller.onRefresh,
onSearchChanged: (data) {
controller.searchedValue.value = data;
controller.getPoultryOrderList();
@@ -79,10 +80,7 @@ class GenocidePage extends GetView<GenocideLogic> {
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getPoultryOrderList(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getPoultryOrderList();
},
);
}, controller.poultryOrderList);
}

View File

@@ -19,7 +19,8 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
hasNews: true,
scrollable: true,
widgets: [
child: Column(
children: [
SizedBox(height: 8.h),
InkWell(
onTap: () {
@@ -78,6 +79,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
widelyWidget(),
SizedBox(height: 20),
],
),
);
}

View File

@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
import 'package:rasadyar_core/core.dart';
class InspectionPoultryScienceLogic extends GetxController {
@@ -43,8 +42,6 @@ class InspectionPoultryScienceLogic extends GetxController {
routesName.removeLast();
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
});
}
@override
@@ -71,7 +68,6 @@ class InspectionPoultryScienceLogic extends GetxController {
baseLogic.clearSearch();
}
Future<void> getHatchingList([bool isLoadingMore = false]) async {
if (isLoadingMore) {
isLoadingMoreAllocationsMade.value = true;
@@ -261,5 +257,10 @@ class InspectionPoultryScienceLogic extends GetxController {
getHatchingList();
}
}
}
Future<void> onRefresh() async {
currentPage.value = 1;
await Future.wait([getHatchingList(), getHatchingReport()]);
}
}

View File

@@ -21,15 +21,18 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
},
onRefresh: controller.onRefresh,
onSearchChanged: (data) => controller.setSearchValue(data),
backId: poultryFirstKey,
routesWidget: ContainerBreadcrumb(rxRoutes: controller.routesName),
widgets: [
child: Column(
children: [
SizedBox(height: 50, child: segmentWidget()),
ObxValue((data) {
return data.value == 0 ? hatchingWidget() : reportWidget();
}, controller.selectedSegmentIndex),
],
),
);
}
@@ -60,10 +63,6 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getHatchingList(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getHatchingList();
},
);
}, controller.hatchingList),
);
@@ -356,10 +355,6 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getHatchingReport(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getHatchingReport();
},
);
}, controller.hatchingReportList),
);
@@ -518,7 +513,8 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
item.image?[index] ?? '',
loadingBuilder: (context, child, loadingProgress) {
if (loadingProgress == null) return child;
return Padding(padding: EdgeInsetsGeometry.all(80),
return Padding(
padding: EdgeInsetsGeometry.all(80),
child: CircularProgressIndicator(
color: AppColor.blueDark,

View File

@@ -14,7 +14,8 @@ class BuyPage extends GetView<BuyLogic> {
return ChickenBasePage(
routes: controller.routesName,
isBase: true,
widgets: [
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 21.w,
@@ -48,6 +49,7 @@ class BuyPage extends GetView<BuyLogic> {
],
),
],
),
);
}
}

View File

@@ -81,4 +81,9 @@ class BuyInProvinceLogic extends GetxController {
buyAllLogic.searchedValue.value = searchedValue.value;
}
}
Future<void> onRefresh() async {
final isWaiting = selectedSegmentIndex.value == 0;
await Future.wait([buyWaitingLogic.getWaitingArrivals(), buyAllLogic.getAllArrivals()]);
}
}

View File

@@ -22,7 +22,9 @@ class BuyInProvincePage extends GetView<BuyInProvinceLogic> {
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
},
widgets: [
onRefresh: controller.onRefresh,
child: Column(
children: [
inventoryWidget(controller.rootLogic),
segmentWidget(),
ObxValue((index) {
@@ -31,6 +33,7 @@ class BuyInProvincePage extends GetView<BuyInProvinceLogic> {
);
}, controller.selectedSegmentIndex),
],
)
);
}

View File

@@ -12,7 +12,6 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
@override
Widget build(BuildContext context) {
eLog("BuyInProvinceAllPage");
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: ObxValue((data) {
@@ -38,10 +37,7 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getAllArrivals(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getAllArrivals();
},
);
}, controller.allProduct),
);

View File

@@ -12,7 +12,6 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
@override
Widget build(BuildContext context) {
eLog("BuyInProvinceWaitingPage");
return Scaffold(
backgroundColor: Colors.transparent,
body: Padding(
@@ -40,28 +39,9 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getWaitingArrivals(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getWaitingArrivals();
},
);
}, controller.waitingProduct),
),
/* floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
floatingActionButton: ObxValue((data) {
if ((data.value.data?.results?.length ?? 0) > 1) {
return AnimatedFab(
onPressed: () {
//TODO FAB
},
message: 'تایید یکجا',
icon: Assets.vec.clipboardTaskSvg.svg(width: 45.w, height: 42.h),
backgroundColor: controller.bgConfirmAllColor.value,
);
} else {
return SizedBox.shrink();
}
}, controller.waitingProduct),*/
);
}

View File

@@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.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';
@@ -236,4 +235,9 @@ class BuyOutOfProvinceLogic extends GetxController {
),
);
}
Future<void> onRefresh() async {
currentPage.value = 1;
await getStewardPurchaseOutOfProvince();
}
}

View File

@@ -21,6 +21,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
return ChickenBasePage(
routes: controller.routesName,
backId: stewardFirstKey,
onRefresh: controller.onRefresh,
onSearchChanged: (data) => controller.setSearchValue(data),
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
@@ -28,7 +29,8 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
child: Stack(
children: [
Positioned.fill(child:Column(
Positioned.fill(
child: Column(
children: [
inventoryWidget(controller.rootLogic),
ObxValue((data) {
@@ -54,14 +56,11 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
itemCount: data.value.data?.results?.length ?? 0,
separatorBuilder: (context, index) => SizedBox(height: 8.h),
onLoadMore: () async => controller.getStewardPurchaseOutOfProvince(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getStewardPurchaseOutOfProvince();
},
);
}, controller.purchaseOutOfProvinceList)
}, controller.purchaseOutOfProvinceList),
],
)),
),
),
Positioned(
right: 5,
bottom: 95,
@@ -75,11 +74,10 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
controller.resetSubmitForm();
});
},
))
),
),
],
),
);
}

View File

@@ -1,5 +1,3 @@
import 'package:rasadyar_chicken/chicken.dart';
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
@@ -16,9 +14,11 @@ class HomeLogic extends GetxController {
@override
void onReady() {
super.onReady();
getGeneralBarsInformation();
getTodayBars();
getDistributionInformation();
refreshData();
}
Future<void> refreshData() async {
await Future.wait([getGeneralBarsInformation(), getTodayBars(), getDistributionInformation()]);
}
Future<void> getGeneralBarsInformation() async {

View File

@@ -16,13 +16,16 @@ class HomePage extends GetView<HomeLogic> {
return ChickenBasePage(
scrollable: true,
isBase: true,
widgets: [
SizedBox(height: 8.h),
onRefresh: controller.refreshData,
child: Column(
children: [
SizedBox(height: 18.h),
mainInformation(),
SizedBox(height: 8.h),
WidelyUsedWidget(),
SizedBox(height: 20),
],
),
);
}

View File

@@ -182,6 +182,12 @@ class StewardRootLogic extends GetxController {
final nestedKeyId = getNestedKey();
GlobalKey<NavigatorState>? currentNestedKey = Get.nestedKey(nestedKeyId);
final currentRoute = currentNestedKey?.currentState;
fLog(Get.currentRoute);
/*
fLog("onPopScopTaped ==> ${currentNestedKey?.currentState?.canPop()}");
if (currentNestedKey?.currentState?.canPop() == true) {
iLog(currentNestedKey?.currentState?.canPop());
@@ -202,6 +208,6 @@ class StewardRootLogic extends GetxController {
} else {
await SystemNavigator.pop();
}
}
}*/
}
}

View File

@@ -15,7 +15,8 @@ class SalePage extends GetView<SaleLogic> {
return ChickenBasePage(
routes: controller.routesName,
isBase: true,
widgets: [
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 21,
@@ -37,6 +38,7 @@ class SalePage extends GetView<SaleLogic> {
],
),
],
),
);
}

View File

@@ -33,13 +33,18 @@ class SalesInProvinceLogic extends GetxController {
GlobalKey<FormState> formKey = GlobalKey<FormState>();
Rx<Jalali> fromDateFilter = Jalali.now().obs;
Rx<Jalali> toDateFilter = Jalali.now().obs;
Rx<Jalali> fromDateFilter = Jalali
.now()
.obs;
Rx<Jalali> toDateFilter = Jalali
.now()
.obs;
Rxn<ProductModel> selectedProductModel = Rxn<ProductModel>();
Rxn<GuildModel> selectedGuildModel = Rxn<GuildModel>();
Rxn<GuildProfile> guildProfile = Rxn<GuildProfile>();
RxInt saleType = 1.obs;
RxInt priceType = 1.obs;
RxInt quotaType = 1.obs;
RxInt weight = 0.obs;
RxInt pricePerKilo = 0.obs;
RxInt totalCost = 0.obs;
@@ -71,7 +76,6 @@ class SalesInProvinceLogic extends GetxController {
});
debounce(weight, time: Duration(milliseconds: 110), (callback) {
totalCost.value = callback * pricePerKilo.value;
});
@@ -80,7 +84,9 @@ class SalesInProvinceLogic extends GetxController {
});
totalCost.listen((data) {
totalCostController.text = data.toString().separatedByComma;
totalCostController.text = data
.toString()
.separatedByComma;
isValid.value =
weight.value > 0 &&
@@ -127,7 +133,8 @@ class SalesInProvinceLogic extends GetxController {
}
safeCall(
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
call: () async =>
await rootLogic.chickenRepository.getAllocatedMade(
token: rootLogic.tokenService.accessToken.value!,
queryParameters: buildQueryParams(
page: currentPage.value,
@@ -177,7 +184,8 @@ class SalesInProvinceLogic extends GetxController {
void confirmAllocation(ConformAllocation allocation) {
safeCall(
call: () async => await rootLogic.chickenRepository.confirmAllocation(
call: () async =>
await rootLogic.chickenRepository.confirmAllocation(
token: rootLogic.tokenService.accessToken.value!,
allocation: allocation.toJson(),
),
@@ -190,7 +198,8 @@ class SalesInProvinceLogic extends GetxController {
void denyAllocation(String token) {
safeCall(
call: () async => await rootLogic.chickenRepository.denyAllocation(
call: () async =>
await rootLogic.chickenRepository.denyAllocation(
token: rootLogic.tokenService.accessToken.value!,
allocationToken: token,
),
@@ -203,7 +212,8 @@ class SalesInProvinceLogic extends GetxController {
Future<void> confirmAllAllocations() async {
safeCall(
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
call: () async =>
await rootLogic.chickenRepository.confirmAllAllocation(
token: rootLogic.tokenService.accessToken.value!,
allocationTokens: allocatedList.value.data?.results?.map((e) => e.key!).toList() ?? [],
),
@@ -216,7 +226,8 @@ class SalesInProvinceLogic extends GetxController {
Future<void> getRolesProducts() async {
safeCall(
call: () async => await rootLogic.chickenRepository.getRolesProducts(
call: () async =>
await rootLogic.chickenRepository.getRolesProducts(
token: rootLogic.tokenService.accessToken.value!,
),
onSuccess: (result) {
@@ -231,7 +242,8 @@ class SalesInProvinceLogic extends GetxController {
Future<void> getGuilds() async {
safeCall(
call: () async => await rootLogic.chickenRepository.getGuilds(
call: () async =>
await rootLogic.chickenRepository.getGuilds(
token: rootLogic.tokenService.accessToken.value!,
queryParameters: buildQueryParams(
queryParams: {'free': saleType.value == 2 ? true : false},
@@ -262,7 +274,8 @@ class SalesInProvinceLogic extends GetxController {
Future<void> getGuildProfile() async {
await safeCall(
call: () async => await rootLogic.chickenRepository.getProfile(
call: () async =>
await rootLogic.chickenRepository.getProfile(
token: rootLogic.tokenService.accessToken.value!,
),
onError: (error, stackTrace) {},
@@ -276,7 +289,8 @@ class SalesInProvinceLogic extends GetxController {
tmpStewardAllocation = SubmitStewardAllocation(
approvedPriceStatus: broadcastPrice.value?.active ?? false,
allocationType:
'${guildProfile.value?.steward == true ? "steward" : "guild"}_${selectedGuildModel.value?.steward == true ? "steward" : "guild"}',
'${guildProfile.value?.steward == true ? "steward" : "guild"}_${selectedGuildModel.value
?.steward == true ? "steward" : "guild"}',
sellerType: guildProfile.value?.steward == true ? "Steward" : "Guild",
buyerType: selectedGuildModel.value?.steward == true ? "Steward" : "Guild",
amount: pricePerKilo.value,
@@ -284,16 +298,20 @@ class SalesInProvinceLogic extends GetxController {
weightOfCarcasses: weight.value,
sellType: saleType.value == 2 ? "free" : 'exclusive',
numberOfCarcasses: 0,
quota: quotaType.value == 1 ? 'governmental' : 'free',
guildKey: selectedGuildModel.value?.key,
productKey: selectedProductModel.value?.key,
date: DateTime.now().formattedDashedGregorian,
date: DateTime
.now()
.formattedDashedGregorian,
type: "manual",
);
}
Future<void> submitAllocation() async {
safeCall(
call: () async => await rootLogic.chickenRepository.postSubmitStewardAllocation(
call: () async =>
await rootLogic.chickenRepository.postSubmitStewardAllocation(
token: rootLogic.tokenService.accessToken.value!,
request: tmpStewardAllocation!,
),
@@ -307,7 +325,8 @@ class SalesInProvinceLogic extends GetxController {
Future<void> deleteAllocation(AllocatedMadeModel model) async {
safeCall(
call: () async => await rootLogic.chickenRepository.deleteStewardAllocation(
call: () async =>
await rootLogic.chickenRepository.deleteStewardAllocation(
token: rootLogic.tokenService.accessToken.value!,
queryParameters: {'steward_allocation_key': model.key},
),
@@ -333,9 +352,15 @@ class SalesInProvinceLogic extends GetxController {
weight.value = item.weightOfCarcasses ?? 0;
pricePerKilo.value = item.amount ?? 0;
totalCost.value = item.totalAmount ?? 0;
weightController.text = weight.value.toString().separatedByComma;
pricePerKiloController.text = pricePerKilo.value.toString().separatedByComma;
totalCostController.text = totalCost.value.toString().separatedByComma;
weightController.text = weight.value
.toString()
.separatedByComma;
pricePerKiloController.text = pricePerKilo.value
.toString()
.separatedByComma;
totalCostController.text = totalCost.value
.toString()
.separatedByComma;
isValid.value = true;
}
@@ -364,7 +389,8 @@ class SalesInProvinceLogic extends GetxController {
);
safeCall(
call: () async => await rootLogic.chickenRepository.updateStewardAllocation(
call: () async =>
await rootLogic.chickenRepository.updateStewardAllocation(
token: rootLogic.tokenService.accessToken.value!,
request: updatedAllocationModel,
),
@@ -408,17 +434,27 @@ class SalesInProvinceLogic extends GetxController {
Future<void> getBroadcastPrice() async {
safeCall(
call: () async => await rootLogic.chickenRepository.getBroadcastPrice(
call: () async =>
await rootLogic.chickenRepository.getBroadcastPrice(
token: rootLogic.tokenService.accessToken.value!,
),
onSuccess: (result) {
broadcastPrice.value = result;
if (broadcastPrice.value?.active == true) {
pricePerKilo.value = broadcastPrice.value?.stewardPrice ?? 0;
pricePerKiloController.text = pricePerKilo.value.toString().separatedByComma;
pricePerKiloController.text = pricePerKilo.value
.toString()
.separatedByComma;
}
},
onError: (error, stacktrace) {},
);
}
Future<void> onRefresh() async {
currentPage.value = 1;
hasMoreDataAllocationsMade.value = true;
await Future.wait([getAllocatedMade()]);
}
}

View File

@@ -20,6 +20,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
routes: controller.routesName,
backId: stewardSecondKey,
onSearchChanged: (data) => controller.setSearchValue(data),
onRefresh: controller.onRefresh,
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
},
@@ -36,10 +37,6 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
resource: data.value,
hasMore: data.value.data?.next != null,
isPaginating: controller.isLoadingMoreAllocationsMade.value,
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getAllocatedMade();
},
onLoadMore: () async {
controller.currentPage.value++;
iLog(controller.currentPage.value);
@@ -404,30 +401,23 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
SizedBox(
height: 40,
child: ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Radio(
value: 1,
return RadioGroup(
groupValue: controller.saleType.value,
onChanged: (value) {
controller.saleType.value = value!;
controller.selectedGuildModel.value = null;
controller.selectedGuildModel.refresh();
},
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Radio(value: 1),
Text('فروش اختصاصی', style: AppFonts.yekan14),
SizedBox(width: 30.w),
Radio(
value: 2,
groupValue: controller.saleType.value,
onChanged: (value) {
controller.saleType.value = value!;
},
),
Radio(value: 2),
Text('فروش آزاد', style: AppFonts.yekan14),
],
),
);
}, controller.saleType),
),
@@ -521,6 +511,27 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
);
}),
Obx(() {
return RadioGroup(
groupValue: controller.quotaType.value,
onChanged: (value) {
controller.quotaType.value = value!;
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Radio(value: 1),
Text('انبار دولتی', style: AppFonts.yekan14),
SizedBox(width: 30.w),
Radio(value: 2),
Text('فروش آزاد', style: AppFonts.yekan14),
],
),
);
}),
Obx(() {
return Visibility(
visible: controller.broadcastPrice.value?.active == true,

View File

@@ -211,4 +211,12 @@ class SalesOutOfProvinceLogic extends GetxController {
selectedProduct.value = null;
key = null;
}
Future<void> onRefresh() async {
currentPage.value = 1;
await getOutProvinceSales();
}
}

View File

@@ -21,6 +21,7 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
return ChickenBasePage(
routes: controller.routesName,
backId: stewardSecondKey,
onRefresh: controller.onRefresh,
onSearchChanged: (data) => controller.setSearchValue(data),
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
@@ -73,10 +74,6 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
ObxValue((data) {
return RPaginatedListView(
onLoadMore: () async => controller.getOutProvinceSales(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getOutProvinceSales();
},
hasMore: data.value.data?.next != null,
listType: ListType.separated,
resource: data.value,
@@ -285,7 +282,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
buildRow(title: 'مشخصات خریدار', value: item.buyer?.fullname ?? 'N/A'),
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
buildRow(title: 'وزن لاشه (ريال)', value: '${item.weightOfCarcasses?.separatedByCommaFa}'),
buildRow(
title: 'وزن لاشه (ريال)',
value: '${item.weightOfCarcasses?.separatedByCommaFa}',
),
Row(
mainAxisAlignment: MainAxisAlignment.center,

View File

@@ -208,4 +208,10 @@ class SalesOutOfProvinceBuyersLogic extends GetxController {
toDateFilter.value = toDateFilter.value;
getOutProvinceCarcassesBuyer();
}
Future<void> onRefresh() async {
currentPage.value = 1;
await getOutProvinceCarcassesBuyer();
}
}

View File

@@ -16,6 +16,7 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
return ChickenBasePage(
routes: controller.routesName,
backId: stewardSecondKey,
onRefresh: controller.onRefresh,
onSearchChanged: (data) => controller.setSearchValue(data),
filteringWidget: filterBottomSheet(),
child: Stack(
@@ -33,21 +34,16 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
border: Border.all(color: AppColor.textColor, width: 0.5),
),
alignment: Alignment.center,
child:Text(
child: Text(
'لیست خریداران خارج از استان',
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkHover),
),
),
Expanded(
child: ObxValue((data) {
return RPaginatedListView(
onLoadMore: () async => controller.getOutProvinceCarcassesBuyer(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getOutProvinceCarcassesBuyer();
},
hasMore: data.value.data?.next != null,
listType: ListType.separated,
resource: data.value,

View File

@@ -20,10 +20,7 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
body: ObxValue((data) {
return RPaginatedListView(
onLoadMore: () async => controller.getOutProvinceSales(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getOutProvinceSales();
},
hasMore: data.value.data?.next != null,
listType: ListType.separated,
resource: data.value,

View File

@@ -220,4 +220,10 @@ class SegmentationLogic extends GetxController {
onError: (error, stacktrace) {},
);
}
Future<void> onRefresh() async {
currentPage.value = 1;
await getAllSegmentation();
}
}

View File

@@ -18,6 +18,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
},
onRefresh: controller.onRefresh,
hasBack: false,
child: Stack(
children: [
@@ -25,10 +26,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
child: ObxValue((data) {
return RPaginatedListView(
onLoadMore: () async => controller.getAllSegmentation(true),
onRefresh: () async {
controller.currentPage.value = 1;
await controller.getAllSegmentation();
},
hasMore: data.value.data?.next != null,
listType: ListType.separated,
resource: data.value,

View File

@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
BackGroundWidget chickenBackground() {
return BackGroundWidget(
BoxDecoration chickenBackground() {
return backGroundDecoration(
gradient: LinearGradient(
begin: Alignment(1.00, 0.01),
end: Alignment(0.04, 0.99),
@@ -12,6 +12,6 @@ BackGroundWidget chickenBackground() {
const Color(0xFFD6E4E3).withValues(alpha: .8),
],
),
vecPath: Assets.vec.chickenPatternSvg.path,
backgroundPath: Assets.images.patternChicken.path,
);
}

View File

@@ -21,7 +21,6 @@ class ChickenBasePage extends GetView<BaseLogic> {
this.onSearchChanged,
this.routes,
this.routesWidget,
this.widgets,
this.child,
this.scrollable = false,
this.floatingActionButtonLocation,
@@ -30,6 +29,7 @@ class ChickenBasePage extends GetView<BaseLogic> {
this.backGroundWidget,
this.isFullScreen = false,
this.onPopScopTaped,
this.onRefresh,
});
//AppBar properties`
@@ -48,10 +48,10 @@ class ChickenBasePage extends GetView<BaseLogic> {
final VoidCallback? onSearchTap;
final VoidCallback? onNewsTap;
final VoidCallback? onNotificationTap;
final RefreshCallback? onRefresh;
final List<String>? routes;
final Widget? routesWidget;
final List<Widget>? widgets;
final Widget? child;
final bool scrollable;
@@ -60,7 +60,7 @@ class ChickenBasePage extends GetView<BaseLogic> {
final Widget? filteringWidget;
final void Function(String?)? onSearchChanged;
final BackGroundWidget? backGroundWidget;
final BoxDecoration? backGroundWidget;
void _onFilterTap() {
if (hasFilter && filteringWidget != null) {
@@ -82,13 +82,12 @@ class ChickenBasePage extends GetView<BaseLogic> {
routes: routes,
routesWidget: routesWidget,
onPopScopTaped: onPopScopTaped,
widgets: widgets,
onRefresh: onRefresh,
child: child,
scrollable: scrollable,
onSearchChanged: onSearchChanged,
floatingActionButtonLocation: floatingActionButtonLocation,
floatingActionButton: floatingActionButton,
backGroundWidget: backGroundWidget ?? chickenBackground(),
backGroundDecoration: backGroundWidget ?? chickenBackground(),
appBar: isFullScreen
? null
: chickenAppBar(

View File

@@ -493,6 +493,9 @@ class $AssetsImagesGen {
/// File path: assets/images/outter_splash.webp
AssetGenImage get outterSplash => const AssetGenImage('assets/images/outter_splash.webp');
/// File path: assets/images/pattern_chicken.webp
AssetGenImage get patternChicken => const AssetGenImage('assets/images/pattern_chicken.webp');
/// File path: assets/images/place_holder.png
AssetGenImage get placeHolder => const AssetGenImage('assets/images/place_holder.png');
@@ -500,7 +503,7 @@ class $AssetsImagesGen {
AssetGenImage get selectRole => const AssetGenImage('assets/images/select_role.webp');
/// List of all assets
List<AssetGenImage> get values => [chicken, innerSplash, outterSplash, placeHolder, selectRole];
List<AssetGenImage> get values => [chicken, innerSplash, outterSplash, patternChicken, placeHolder, selectRole];
}
class $AssetsLogosGen {

View File

@@ -6,30 +6,28 @@ class BasePage extends GetView<BaseLogic> {
super.key,
this.routes,
this.routesWidget,
this.widgets,
this.child,
this.scrollable = false,
this.floatingActionButtonLocation,
this.floatingActionButton,
this.appBar,
this.backGroundWidget,
this.backGroundDecoration,
this.onPopScopTaped,
this.backId,
this.onSearchChanged,
this.onRefresh,
});
final List<String>? routes;
final Widget? routesWidget;
final List<Widget>? widgets;
final Widget? child;
final bool scrollable;
final RAppBar? appBar;
final BackGroundWidget? backGroundWidget;
final BoxDecoration? backGroundDecoration;
final FloatingActionButtonLocation? floatingActionButtonLocation;
final Widget? floatingActionButton;
final VoidCallback? onPopScopTaped;
final int? backId;
final void Function(String?)? onSearchChanged;
final RefreshCallback? onRefresh;
Widget _buildHeader() {
if (appBar?.hasSearch == true) {
@@ -49,38 +47,30 @@ class BasePage extends GetView<BaseLogic> {
final content = [
if (routes != null || routesWidget != null) _buildHeader(),
if (child != null) Expanded(child: child!),
...?widgets,
];
if (scrollable) {
if (backGroundWidget != null) {
return Stack(
children: [
?backGroundWidget,
SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(vertical: 8.h),
child: Column(children: content),
if (onRefresh == null) {
return Container(
decoration: backGroundDecoration,
child: Column(mainAxisAlignment: MainAxisAlignment.start, children: content),
);
} else {
return RefreshIndicator.adaptive(
triggerMode: RefreshIndicatorTriggerMode.anywhere,
edgeOffset: 16.h,
onRefresh: onRefresh ?? () async {},
child: CustomScrollView(
slivers: [
SliverFillRemaining(
child: Container(
decoration: backGroundDecoration,
child: Column(mainAxisAlignment: MainAxisAlignment.start, children: content),
),
),
],
),
);
}
return SingleChildScrollView(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(vertical: 8.h),
child: Column(children: content),
);
}
if (backGroundWidget != null) {
return Stack(
children: [
Positioned.fill(child: backGroundWidget!),
Column(children: content),
],
);
}
return Column(children: content);
}
@override

View File

@@ -2,19 +2,9 @@ import 'package:flutter/material.dart';
import '../../../../core.dart';
class BackGroundWidget extends StatelessWidget {
const BackGroundWidget({super.key, required this.gradient, required this.vecPath});
final Gradient gradient;
final String vecPath;
@override
Widget build(BuildContext context) {
return Container(
width: Get.width,
height: Get.height,
decoration: BoxDecoration(gradient: gradient),
child: SvgGenImage.vec(vecPath).svg(fit: BoxFit.cover),
BoxDecoration backGroundDecoration({required Gradient gradient, required String backgroundPath}) {
return BoxDecoration(
gradient: gradient,
image: DecorationImage(image: AssetGenImage(backgroundPath).provider(), fit: BoxFit.cover),
);
}
}

View File

@@ -11,7 +11,6 @@ class RPaginatedListView<T> extends StatelessWidget {
required this.itemBuilder,
required this.itemCount,
this.separatorBuilder,
this.onRefresh,
required this.onLoadMore,
this.isPaginating = false,
this.hasMore = true,
@@ -27,7 +26,6 @@ class RPaginatedListView<T> extends StatelessWidget {
final Resource<PaginationModel<T>> resource;
final NullableIndexedWidgetBuilder itemBuilder;
final IndexedWidgetBuilder? separatorBuilder;
final Future<void> Function()? onRefresh;
final Future<void> Function() onLoadMore;
final bool isPaginating;
final bool hasMore;
@@ -55,7 +53,7 @@ class RPaginatedListView<T> extends StatelessWidget {
}
if (resource.isEmpty || resource.data?.results?.isEmpty == true) {
return emptyWidget ?? EmptyWidget(onRefresh: onRefresh);
return emptyWidget ?? EmptyWidget();
}
final controller = scrollController ?? ScrollController();
@@ -69,11 +67,6 @@ class RPaginatedListView<T> extends StatelessWidget {
}
return false;
},
child: RefreshIndicator(
color: AppColor.blueNormal,
triggerMode: RefreshIndicatorTriggerMode.anywhere,
onRefresh: onRefresh ?? () async {},
child: listType == ListType.separated
? ListView.separated(
padding: padding,
@@ -112,7 +105,6 @@ class RPaginatedListView<T> extends StatelessWidget {
return itemBuilder(context, index);
},
),
),
);
}
}

View File

@@ -29,4 +29,14 @@ class RecordsLogic extends GetxController {
}
}
Future<void> onRefresh() async {
await Future.delayed(const Duration(seconds: 2)).then((value) {
currentPage.value = 1;
countList.value = Resource<PaginationModel<int>>.success(
PaginationModel(results: [1, 2, 3, 4, 5, 6], count: 1, next: null, previous: null),
);
});
}
}

View File

@@ -16,10 +16,7 @@ class RecordsPage extends GetView<RecordsLogic> {
resource: data.value,
hasMore: data.value.data?.next != null,
isPaginating: controller.isLoadingMore.value,
onRefresh: () async {
controller.currentPage.value = 1;
//await controller.getAllocatedMade();
},
onLoadMore: () async {
controller.currentPage.value++;
iLog(controller.currentPage.value);

View File

@@ -16,10 +16,7 @@ class UsersPage extends GetView<UsersLogic> {
resource: data.value,
hasMore: data.value.data?.next != null,
isPaginating: controller.isLoadingMore.value,
onRefresh: () async {
controller.currentPage.value = 1;
//await controller.getAllocatedMade();
},
onLoadMore: () async {
controller.currentPage.value++;
iLog(controller.currentPage.value);
@@ -58,10 +55,7 @@ class UsersPage extends GetView<UsersLogic> {
mainAxisAlignment: MainAxisAlignment.center,
spacing: 3,
children: [
Text(
'داود خرم مهری پور',
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
),
Text('داود خرم مهری پور', style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal)),
Text(
'09302545455',
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover),
@@ -72,10 +66,7 @@ class UsersPage extends GetView<UsersLogic> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
Text(
'0 کیلوگرم',
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
),
Text('0 کیلوگرم', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)),
],
),
Assets.vec.scanBarcodeSvg.svg(),
@@ -141,7 +132,7 @@ class UsersPage extends GetView<UsersLogic> {
),
),
Visibility(
visible:true,
visible: true,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 16.w,
@@ -176,7 +167,7 @@ class UsersPage extends GetView<UsersLogic> {
// controller.denyAllocation(item.key ?? '');
//await controller.deleteAllocation(item);
},
onRefresh: () async{}
onRefresh: () async {},
);
},
borderColor: AppColor.redNormal,