feat: new ui changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
|
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
|
||||||
flutter.sdk=C:\\src\\flutter
|
flutter.sdk=C:\\src\\flutter
|
||||||
flutter.buildMode=release
|
flutter.buildMode=debug
|
||||||
flutter.versionName=1.3.18
|
flutter.versionName=1.3.18
|
||||||
flutter.versionCode=15
|
flutter.versionCode=15
|
||||||
BIN
assets/images/pattern_chicken.webp
Normal file
BIN
assets/images/pattern_chicken.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
@@ -16,6 +16,7 @@ abstract class SubmitStewardAllocation with _$SubmitStewardAllocation {
|
|||||||
int? weightOfCarcasses,
|
int? weightOfCarcasses,
|
||||||
String? sellType,
|
String? sellType,
|
||||||
int? amount,
|
int? amount,
|
||||||
|
String? quota,
|
||||||
int? totalAmount,
|
int? totalAmount,
|
||||||
bool? approvedPriceStatus,
|
bool? approvedPriceStatus,
|
||||||
String? date,
|
String? date,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SubmitStewardAllocation {
|
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
|
/// Create a copy of SubmitStewardAllocation
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -28,16 +28,16 @@ $SubmitStewardAllocationCopyWith<SubmitStewardAllocation> get copyWith => _$Subm
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
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)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@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
|
@override
|
||||||
String toString() {
|
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;
|
factory $SubmitStewardAllocationCopyWith(SubmitStewardAllocation value, $Res Function(SubmitStewardAllocation) _then) = _$SubmitStewardAllocationCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$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
|
/// Create a copy of SubmitStewardAllocation
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// 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(
|
return _then(_self.copyWith(
|
||||||
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
|
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
|
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?,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 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 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 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 bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,
|
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) {
|
switch (_that) {
|
||||||
case _SubmitStewardAllocation() when $default != null:
|
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();
|
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) {
|
switch (_that) {
|
||||||
case _SubmitStewardAllocation():
|
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');
|
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) {
|
switch (_that) {
|
||||||
case _SubmitStewardAllocation() when $default != null:
|
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;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -221,7 +222,7 @@ return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SubmitStewardAllocation implements SubmitStewardAllocation {
|
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);
|
factory _SubmitStewardAllocation.fromJson(Map<String, dynamic> json) => _$SubmitStewardAllocationFromJson(json);
|
||||||
|
|
||||||
@override final String? sellerType;
|
@override final String? sellerType;
|
||||||
@@ -234,6 +235,7 @@ class _SubmitStewardAllocation implements SubmitStewardAllocation {
|
|||||||
@override final int? weightOfCarcasses;
|
@override final int? weightOfCarcasses;
|
||||||
@override final String? sellType;
|
@override final String? sellType;
|
||||||
@override final int? amount;
|
@override final int? amount;
|
||||||
|
@override final String? quota;
|
||||||
@override final int? totalAmount;
|
@override final int? totalAmount;
|
||||||
@override final bool? approvedPriceStatus;
|
@override final bool? approvedPriceStatus;
|
||||||
@override final String? date;
|
@override final String? date;
|
||||||
@@ -251,16 +253,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
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)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@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
|
@override
|
||||||
String toString() {
|
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;
|
factory _$SubmitStewardAllocationCopyWith(_SubmitStewardAllocation value, $Res Function(_SubmitStewardAllocation) _then) = __$SubmitStewardAllocationCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$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
|
/// Create a copy of SubmitStewardAllocation
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// 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(
|
return _then(_SubmitStewardAllocation(
|
||||||
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
|
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
|
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?,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 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 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 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 bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,
|
as String?,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ _SubmitStewardAllocation _$SubmitStewardAllocationFromJson(
|
|||||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||||
sellType: json['sell_type'] as String?,
|
sellType: json['sell_type'] as String?,
|
||||||
amount: (json['amount'] as num?)?.toInt(),
|
amount: (json['amount'] as num?)?.toInt(),
|
||||||
|
quota: json['quota'] as String?,
|
||||||
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||||
date: json['date'] as String?,
|
date: json['date'] as String?,
|
||||||
@@ -37,6 +38,7 @@ Map<String, dynamic> _$SubmitStewardAllocationToJson(
|
|||||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||||
'sell_type': instance.sellType,
|
'sell_type': instance.sellType,
|
||||||
'amount': instance.amount,
|
'amount': instance.amount,
|
||||||
|
'quota': instance.quota,
|
||||||
'total_amount': instance.totalAmount,
|
'total_amount': instance.totalAmount,
|
||||||
'approved_price_status': instance.approvedPriceStatus,
|
'approved_price_status': instance.approvedPriceStatus,
|
||||||
'date': instance.date,
|
'date': instance.date,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class AuthPage extends GetView<AuthLogic> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
isFullScreen: true,
|
isFullScreen: true,
|
||||||
backGroundWidget: BackGroundWidget(
|
backGroundWidget: backGroundDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment.topRight,
|
begin: Alignment.topRight,
|
||||||
end: Alignment.bottomLeft,
|
end: Alignment.bottomLeft,
|
||||||
@@ -24,7 +24,7 @@ class AuthPage extends GetView<AuthLogic> {
|
|||||||
],
|
],
|
||||||
stops: const [0.0, 0.5, 1.0],
|
stops: const [0.0, 0.5, 1.0],
|
||||||
),
|
),
|
||||||
vecPath: Assets.vec.chickenPatternSvg.path,
|
backgroundPath: Assets.images.patternChicken.path,
|
||||||
),
|
),
|
||||||
onPopScopTaped: () => Get.back(result: -1),
|
onPopScopTaped: () => Get.back(result: -1),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
|||||||
@@ -73,4 +73,11 @@ class ActiveHatchingLogic extends GetxController {
|
|||||||
void toggleExpanded(int index) {
|
void toggleExpanded(int index) {
|
||||||
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
await getHatchingList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,7 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getHatchingList(true),
|
onLoadMore: () async => controller.getHatchingList(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getHatchingList();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.activeHatchingList);
|
}, controller.activeHatchingList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,4 +107,10 @@ class FarmLogic extends GetxController {
|
|||||||
void toggleExpanded(int index) {
|
void toggleExpanded(int index) {
|
||||||
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
farmList.value = Resource<PaginationModel<PoultryFarm>>.loading();
|
||||||
|
await getFarmList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/utils/nested_keys_utils.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/label_item.dart';
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@@ -16,6 +15,7 @@ class FarmPage extends GetView<FarmLogic> {
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
hasFilter: false,
|
hasFilter: false,
|
||||||
hasSearch: true,
|
hasSearch: true,
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(
|
Get.bottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
@@ -29,7 +29,7 @@ class FarmPage extends GetView<FarmLogic> {
|
|||||||
},
|
},
|
||||||
routes: controller.routes,
|
routes: controller.routes,
|
||||||
backId: poultryFirstKey,
|
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,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getFarmList(true),
|
onLoadMore: () async => controller.getFarmList(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getFarmList();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.farmList),
|
}, controller.farmList),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -133,4 +133,11 @@ class GenocideLogic extends GetxController {
|
|||||||
return 'تایید شده';
|
return 'تایید شده';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
await getPoultryOrderList();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class GenocidePage extends GetView<GenocideLogic> {
|
|||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
hasSearch: true,
|
hasSearch: true,
|
||||||
hasFilter: true,
|
hasFilter: true,
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onSearchChanged: (data) {
|
onSearchChanged: (data) {
|
||||||
controller.searchedValue.value = data;
|
controller.searchedValue.value = data;
|
||||||
controller.getPoultryOrderList();
|
controller.getPoultryOrderList();
|
||||||
@@ -79,10 +80,7 @@ class GenocidePage extends GetView<GenocideLogic> {
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getPoultryOrderList(true),
|
onLoadMore: () async => controller.getPoultryOrderList(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getPoultryOrderList();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.poultryOrderList);
|
}, controller.poultryOrderList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
|
|||||||
hasNews: true,
|
hasNews: true,
|
||||||
scrollable: true,
|
scrollable: true,
|
||||||
|
|
||||||
widgets: [
|
child: Column(
|
||||||
|
children: [
|
||||||
SizedBox(height: 8.h),
|
SizedBox(height: 8.h),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -78,6 +79,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
|
|||||||
widelyWidget(),
|
widelyWidget(),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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/hatching_models.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.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/pages/poultry_science/root/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
class InspectionPoultryScienceLogic extends GetxController {
|
class InspectionPoultryScienceLogic extends GetxController {
|
||||||
@@ -43,8 +42,6 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
routesName.removeLast();
|
routesName.removeLast();
|
||||||
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -71,7 +68,6 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
baseLogic.clearSearch();
|
baseLogic.clearSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
||||||
if (isLoadingMore) {
|
if (isLoadingMore) {
|
||||||
isLoadingMoreAllocationsMade.value = true;
|
isLoadingMoreAllocationsMade.value = true;
|
||||||
@@ -261,5 +257,10 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
getHatchingList();
|
getHatchingList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
|
||||||
|
await Future.wait([getHatchingList(), getHatchingReport()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,15 +21,18 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(filterBottomSheet());
|
Get.bottomSheet(filterBottomSheet());
|
||||||
},
|
},
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||||
backId: poultryFirstKey,
|
backId: poultryFirstKey,
|
||||||
routesWidget: ContainerBreadcrumb(rxRoutes: controller.routesName),
|
routesWidget: ContainerBreadcrumb(rxRoutes: controller.routesName),
|
||||||
widgets: [
|
child: Column(
|
||||||
|
children: [
|
||||||
SizedBox(height: 50, child: segmentWidget()),
|
SizedBox(height: 50, child: segmentWidget()),
|
||||||
ObxValue((data) {
|
ObxValue((data) {
|
||||||
return data.value == 0 ? hatchingWidget() : reportWidget();
|
return data.value == 0 ? hatchingWidget() : reportWidget();
|
||||||
}, controller.selectedSegmentIndex),
|
}, controller.selectedSegmentIndex),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,10 +63,6 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getHatchingList(true),
|
onLoadMore: () async => controller.getHatchingList(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getHatchingList();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.hatchingList),
|
}, controller.hatchingList),
|
||||||
);
|
);
|
||||||
@@ -356,10 +355,6 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getHatchingReport(true),
|
onLoadMore: () async => controller.getHatchingReport(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getHatchingReport();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.hatchingReportList),
|
}, controller.hatchingReportList),
|
||||||
);
|
);
|
||||||
@@ -518,7 +513,8 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
item.image?[index] ?? '',
|
item.image?[index] ?? '',
|
||||||
loadingBuilder: (context, child, loadingProgress) {
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
if (loadingProgress == null) return child;
|
if (loadingProgress == null) return child;
|
||||||
return Padding(padding: EdgeInsetsGeometry.all(80),
|
return Padding(
|
||||||
|
padding: EdgeInsetsGeometry.all(80),
|
||||||
|
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: AppColor.blueDark,
|
color: AppColor.blueDark,
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ class BuyPage extends GetView<BuyLogic> {
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
isBase: true,
|
isBase: true,
|
||||||
widgets: [
|
child: Column(
|
||||||
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 21.w,
|
spacing: 21.w,
|
||||||
@@ -48,6 +49,7 @@ class BuyPage extends GetView<BuyLogic> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,4 +81,9 @@ class BuyInProvinceLogic extends GetxController {
|
|||||||
buyAllLogic.searchedValue.value = searchedValue.value;
|
buyAllLogic.searchedValue.value = searchedValue.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
final isWaiting = selectedSegmentIndex.value == 0;
|
||||||
|
await Future.wait([buyWaitingLogic.getWaitingArrivals(), buyAllLogic.getAllArrivals()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ class BuyInProvincePage extends GetView<BuyInProvinceLogic> {
|
|||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(filterBottomSheet());
|
Get.bottomSheet(filterBottomSheet());
|
||||||
},
|
},
|
||||||
widgets: [
|
onRefresh: controller.onRefresh,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
inventoryWidget(controller.rootLogic),
|
inventoryWidget(controller.rootLogic),
|
||||||
segmentWidget(),
|
segmentWidget(),
|
||||||
ObxValue((index) {
|
ObxValue((index) {
|
||||||
@@ -31,6 +33,7 @@ class BuyInProvincePage extends GetView<BuyInProvinceLogic> {
|
|||||||
);
|
);
|
||||||
}, controller.selectedSegmentIndex),
|
}, controller.selectedSegmentIndex),
|
||||||
],
|
],
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
eLog("BuyInProvinceAllPage");
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
@@ -38,10 +37,7 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getAllArrivals(true),
|
onLoadMore: () async => controller.getAllArrivals(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getAllArrivals();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.allProduct),
|
}, controller.allProduct),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
eLog("BuyInProvinceWaitingPage");
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: Padding(
|
body: Padding(
|
||||||
@@ -40,28 +39,9 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getWaitingArrivals(true),
|
onLoadMore: () async => controller.getWaitingArrivals(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getWaitingArrivals();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.waitingProduct),
|
}, 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),*/
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
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/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/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/roles_products/roles_products.dart';
|
||||||
@@ -236,4 +235,9 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
await getStewardPurchaseOutOfProvince();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
backId: stewardFirstKey,
|
backId: stewardFirstKey,
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(filterBottomSheet());
|
Get.bottomSheet(filterBottomSheet());
|
||||||
@@ -28,7 +29,8 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(child:Column(
|
Positioned.fill(
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
inventoryWidget(controller.rootLogic),
|
inventoryWidget(controller.rootLogic),
|
||||||
ObxValue((data) {
|
ObxValue((data) {
|
||||||
@@ -54,14 +56,11 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getStewardPurchaseOutOfProvince(true),
|
onLoadMore: () async => controller.getStewardPurchaseOutOfProvince(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getStewardPurchaseOutOfProvince();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}, controller.purchaseOutOfProvinceList)
|
}, controller.purchaseOutOfProvinceList),
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 5,
|
right: 5,
|
||||||
bottom: 95,
|
bottom: 95,
|
||||||
@@ -75,11 +74,10 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
controller.resetSubmitForm();
|
controller.resetSubmitForm();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
))
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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/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/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
|
||||||
@@ -16,9 +14,11 @@ class HomeLogic extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
getGeneralBarsInformation();
|
refreshData();
|
||||||
getTodayBars();
|
}
|
||||||
getDistributionInformation();
|
|
||||||
|
Future<void> refreshData() async {
|
||||||
|
await Future.wait([getGeneralBarsInformation(), getTodayBars(), getDistributionInformation()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getGeneralBarsInformation() async {
|
Future<void> getGeneralBarsInformation() async {
|
||||||
|
|||||||
@@ -16,13 +16,16 @@ class HomePage extends GetView<HomeLogic> {
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
scrollable: true,
|
scrollable: true,
|
||||||
isBase: true,
|
isBase: true,
|
||||||
widgets: [
|
onRefresh: controller.refreshData,
|
||||||
SizedBox(height: 8.h),
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 18.h),
|
||||||
mainInformation(),
|
mainInformation(),
|
||||||
SizedBox(height: 8.h),
|
SizedBox(height: 8.h),
|
||||||
WidelyUsedWidget(),
|
WidelyUsedWidget(),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,12 @@ class StewardRootLogic extends GetxController {
|
|||||||
final nestedKeyId = getNestedKey();
|
final nestedKeyId = getNestedKey();
|
||||||
GlobalKey<NavigatorState>? currentNestedKey = Get.nestedKey(nestedKeyId);
|
GlobalKey<NavigatorState>? currentNestedKey = Get.nestedKey(nestedKeyId);
|
||||||
|
|
||||||
|
final currentRoute = currentNestedKey?.currentState;
|
||||||
|
|
||||||
|
|
||||||
|
fLog(Get.currentRoute);
|
||||||
|
|
||||||
|
/*
|
||||||
fLog("onPopScopTaped ==> ${currentNestedKey?.currentState?.canPop()}");
|
fLog("onPopScopTaped ==> ${currentNestedKey?.currentState?.canPop()}");
|
||||||
if (currentNestedKey?.currentState?.canPop() == true) {
|
if (currentNestedKey?.currentState?.canPop() == true) {
|
||||||
iLog(currentNestedKey?.currentState?.canPop());
|
iLog(currentNestedKey?.currentState?.canPop());
|
||||||
@@ -202,6 +208,6 @@ class StewardRootLogic extends GetxController {
|
|||||||
} else {
|
} else {
|
||||||
await SystemNavigator.pop();
|
await SystemNavigator.pop();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class SalePage extends GetView<SaleLogic> {
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
isBase: true,
|
isBase: true,
|
||||||
widgets: [
|
child: Column(
|
||||||
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 21,
|
spacing: 21,
|
||||||
@@ -37,6 +38,7 @@ class SalePage extends GetView<SaleLogic> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,18 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
Rx<Jalali> fromDateFilter = Jalali
|
||||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
.now()
|
||||||
|
.obs;
|
||||||
|
Rx<Jalali> toDateFilter = Jalali
|
||||||
|
.now()
|
||||||
|
.obs;
|
||||||
Rxn<ProductModel> selectedProductModel = Rxn<ProductModel>();
|
Rxn<ProductModel> selectedProductModel = Rxn<ProductModel>();
|
||||||
Rxn<GuildModel> selectedGuildModel = Rxn<GuildModel>();
|
Rxn<GuildModel> selectedGuildModel = Rxn<GuildModel>();
|
||||||
Rxn<GuildProfile> guildProfile = Rxn<GuildProfile>();
|
Rxn<GuildProfile> guildProfile = Rxn<GuildProfile>();
|
||||||
RxInt saleType = 1.obs;
|
RxInt saleType = 1.obs;
|
||||||
RxInt priceType = 1.obs;
|
RxInt priceType = 1.obs;
|
||||||
|
RxInt quotaType = 1.obs;
|
||||||
RxInt weight = 0.obs;
|
RxInt weight = 0.obs;
|
||||||
RxInt pricePerKilo = 0.obs;
|
RxInt pricePerKilo = 0.obs;
|
||||||
RxInt totalCost = 0.obs;
|
RxInt totalCost = 0.obs;
|
||||||
@@ -71,7 +76,6 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
debounce(weight, time: Duration(milliseconds: 110), (callback) {
|
debounce(weight, time: Duration(milliseconds: 110), (callback) {
|
||||||
|
|
||||||
totalCost.value = callback * pricePerKilo.value;
|
totalCost.value = callback * pricePerKilo.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,7 +84,9 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
totalCost.listen((data) {
|
totalCost.listen((data) {
|
||||||
totalCostController.text = data.toString().separatedByComma;
|
totalCostController.text = data
|
||||||
|
.toString()
|
||||||
|
.separatedByComma;
|
||||||
|
|
||||||
isValid.value =
|
isValid.value =
|
||||||
weight.value > 0 &&
|
weight.value > 0 &&
|
||||||
@@ -127,7 +133,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.getAllocatedMade(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
queryParameters: buildQueryParams(
|
queryParameters: buildQueryParams(
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
@@ -177,7 +184,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
void confirmAllocation(ConformAllocation allocation) {
|
void confirmAllocation(ConformAllocation allocation) {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.confirmAllocation(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.confirmAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
allocation: allocation.toJson(),
|
allocation: allocation.toJson(),
|
||||||
),
|
),
|
||||||
@@ -190,7 +198,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
void denyAllocation(String token) {
|
void denyAllocation(String token) {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.denyAllocation(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.denyAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
allocationToken: token,
|
allocationToken: token,
|
||||||
),
|
),
|
||||||
@@ -203,7 +212,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> confirmAllAllocations() async {
|
Future<void> confirmAllAllocations() async {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.confirmAllAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
allocationTokens: allocatedList.value.data?.results?.map((e) => e.key!).toList() ?? [],
|
allocationTokens: allocatedList.value.data?.results?.map((e) => e.key!).toList() ?? [],
|
||||||
),
|
),
|
||||||
@@ -216,7 +226,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> getRolesProducts() async {
|
Future<void> getRolesProducts() async {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getRolesProducts(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.getRolesProducts(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
@@ -231,7 +242,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> getGuilds() async {
|
Future<void> getGuilds() async {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getGuilds(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.getGuilds(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
queryParameters: buildQueryParams(
|
queryParameters: buildQueryParams(
|
||||||
queryParams: {'free': saleType.value == 2 ? true : false},
|
queryParams: {'free': saleType.value == 2 ? true : false},
|
||||||
@@ -262,7 +274,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> getGuildProfile() async {
|
Future<void> getGuildProfile() async {
|
||||||
await safeCall(
|
await safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getProfile(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.getProfile(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
),
|
),
|
||||||
onError: (error, stackTrace) {},
|
onError: (error, stackTrace) {},
|
||||||
@@ -276,7 +289,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
tmpStewardAllocation = SubmitStewardAllocation(
|
tmpStewardAllocation = SubmitStewardAllocation(
|
||||||
approvedPriceStatus: broadcastPrice.value?.active ?? false,
|
approvedPriceStatus: broadcastPrice.value?.active ?? false,
|
||||||
allocationType:
|
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",
|
sellerType: guildProfile.value?.steward == true ? "Steward" : "Guild",
|
||||||
buyerType: selectedGuildModel.value?.steward == true ? "Steward" : "Guild",
|
buyerType: selectedGuildModel.value?.steward == true ? "Steward" : "Guild",
|
||||||
amount: pricePerKilo.value,
|
amount: pricePerKilo.value,
|
||||||
@@ -284,16 +298,20 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
weightOfCarcasses: weight.value,
|
weightOfCarcasses: weight.value,
|
||||||
sellType: saleType.value == 2 ? "free" : 'exclusive',
|
sellType: saleType.value == 2 ? "free" : 'exclusive',
|
||||||
numberOfCarcasses: 0,
|
numberOfCarcasses: 0,
|
||||||
|
quota: quotaType.value == 1 ? 'governmental' : 'free',
|
||||||
guildKey: selectedGuildModel.value?.key,
|
guildKey: selectedGuildModel.value?.key,
|
||||||
productKey: selectedProductModel.value?.key,
|
productKey: selectedProductModel.value?.key,
|
||||||
date: DateTime.now().formattedDashedGregorian,
|
date: DateTime
|
||||||
|
.now()
|
||||||
|
.formattedDashedGregorian,
|
||||||
type: "manual",
|
type: "manual",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> submitAllocation() async {
|
Future<void> submitAllocation() async {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.postSubmitStewardAllocation(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.postSubmitStewardAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
request: tmpStewardAllocation!,
|
request: tmpStewardAllocation!,
|
||||||
),
|
),
|
||||||
@@ -307,7 +325,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> deleteAllocation(AllocatedMadeModel model) async {
|
Future<void> deleteAllocation(AllocatedMadeModel model) async {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.deleteStewardAllocation(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.deleteStewardAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
queryParameters: {'steward_allocation_key': model.key},
|
queryParameters: {'steward_allocation_key': model.key},
|
||||||
),
|
),
|
||||||
@@ -333,9 +352,15 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
weight.value = item.weightOfCarcasses ?? 0;
|
weight.value = item.weightOfCarcasses ?? 0;
|
||||||
pricePerKilo.value = item.amount ?? 0;
|
pricePerKilo.value = item.amount ?? 0;
|
||||||
totalCost.value = item.totalAmount ?? 0;
|
totalCost.value = item.totalAmount ?? 0;
|
||||||
weightController.text = weight.value.toString().separatedByComma;
|
weightController.text = weight.value
|
||||||
pricePerKiloController.text = pricePerKilo.value.toString().separatedByComma;
|
.toString()
|
||||||
totalCostController.text = totalCost.value.toString().separatedByComma;
|
.separatedByComma;
|
||||||
|
pricePerKiloController.text = pricePerKilo.value
|
||||||
|
.toString()
|
||||||
|
.separatedByComma;
|
||||||
|
totalCostController.text = totalCost.value
|
||||||
|
.toString()
|
||||||
|
.separatedByComma;
|
||||||
isValid.value = true;
|
isValid.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +389,8 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
);
|
);
|
||||||
|
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.updateStewardAllocation(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.updateStewardAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
request: updatedAllocationModel,
|
request: updatedAllocationModel,
|
||||||
),
|
),
|
||||||
@@ -408,17 +434,27 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> getBroadcastPrice() async {
|
Future<void> getBroadcastPrice() async {
|
||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getBroadcastPrice(
|
call: () async =>
|
||||||
|
await rootLogic.chickenRepository.getBroadcastPrice(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
broadcastPrice.value = result;
|
broadcastPrice.value = result;
|
||||||
if (broadcastPrice.value?.active == true) {
|
if (broadcastPrice.value?.active == true) {
|
||||||
pricePerKilo.value = broadcastPrice.value?.stewardPrice ?? 0;
|
pricePerKilo.value = broadcastPrice.value?.stewardPrice ?? 0;
|
||||||
pricePerKiloController.text = pricePerKilo.value.toString().separatedByComma;
|
pricePerKiloController.text = pricePerKilo.value
|
||||||
|
.toString()
|
||||||
|
.separatedByComma;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error, stacktrace) {},
|
onError: (error, stacktrace) {},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
hasMoreDataAllocationsMade.value = true;
|
||||||
|
|
||||||
|
await Future.wait([getAllocatedMade()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
backId: stewardSecondKey,
|
backId: stewardSecondKey,
|
||||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(filterBottomSheet());
|
Get.bottomSheet(filterBottomSheet());
|
||||||
},
|
},
|
||||||
@@ -36,10 +37,6 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
resource: data.value,
|
resource: data.value,
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
isPaginating: controller.isLoadingMoreAllocationsMade.value,
|
isPaginating: controller.isLoadingMoreAllocationsMade.value,
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getAllocatedMade();
|
|
||||||
},
|
|
||||||
onLoadMore: () async {
|
onLoadMore: () async {
|
||||||
controller.currentPage.value++;
|
controller.currentPage.value++;
|
||||||
iLog(controller.currentPage.value);
|
iLog(controller.currentPage.value);
|
||||||
@@ -404,30 +401,23 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
return Row(
|
return RadioGroup(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Radio(
|
|
||||||
value: 1,
|
|
||||||
groupValue: controller.saleType.value,
|
groupValue: controller.saleType.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.saleType.value = value!;
|
controller.saleType.value = value!;
|
||||||
|
|
||||||
controller.selectedGuildModel.value = null;
|
controller.selectedGuildModel.value = null;
|
||||||
controller.selectedGuildModel.refresh();
|
controller.selectedGuildModel.refresh();
|
||||||
},
|
},
|
||||||
),
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Radio(value: 1),
|
||||||
Text('فروش اختصاصی', style: AppFonts.yekan14),
|
Text('فروش اختصاصی', style: AppFonts.yekan14),
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Radio(
|
Radio(value: 2),
|
||||||
value: 2,
|
|
||||||
groupValue: controller.saleType.value,
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.saleType.value = value!;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Text('فروش آزاد', style: AppFonts.yekan14),
|
Text('فروش آزاد', style: AppFonts.yekan14),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}, controller.saleType),
|
}, 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(() {
|
Obx(() {
|
||||||
return Visibility(
|
return Visibility(
|
||||||
visible: controller.broadcastPrice.value?.active == true,
|
visible: controller.broadcastPrice.value?.active == true,
|
||||||
|
|||||||
@@ -211,4 +211,12 @@ class SalesOutOfProvinceLogic extends GetxController {
|
|||||||
selectedProduct.value = null;
|
selectedProduct.value = null;
|
||||||
key = null;
|
key = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
await getOutProvinceSales();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
backId: stewardSecondKey,
|
backId: stewardSecondKey,
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(filterBottomSheet());
|
Get.bottomSheet(filterBottomSheet());
|
||||||
@@ -73,10 +74,6 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
ObxValue((data) {
|
ObxValue((data) {
|
||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
onLoadMore: () async => controller.getOutProvinceSales(true),
|
onLoadMore: () async => controller.getOutProvinceSales(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getOutProvinceSales();
|
|
||||||
},
|
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
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?.fullname ?? 'N/A'),
|
||||||
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
|
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
|
||||||
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
|
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
|
||||||
buildRow(title: 'وزن لاشه (ريال)', value: '${item.weightOfCarcasses?.separatedByCommaFa}'),
|
buildRow(
|
||||||
|
title: 'وزن لاشه (ريال)',
|
||||||
|
value: '${item.weightOfCarcasses?.separatedByCommaFa}',
|
||||||
|
),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@@ -208,4 +208,10 @@ class SalesOutOfProvinceBuyersLogic extends GetxController {
|
|||||||
toDateFilter.value = toDateFilter.value;
|
toDateFilter.value = toDateFilter.value;
|
||||||
getOutProvinceCarcassesBuyer();
|
getOutProvinceCarcassesBuyer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
await getOutProvinceCarcassesBuyer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
|
|||||||
return ChickenBasePage(
|
return ChickenBasePage(
|
||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
backId: stewardSecondKey,
|
backId: stewardSecondKey,
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||||
filteringWidget: filterBottomSheet(),
|
filteringWidget: filterBottomSheet(),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@@ -33,21 +34,16 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
|
|||||||
border: Border.all(color: AppColor.textColor, width: 0.5),
|
border: Border.all(color: AppColor.textColor, width: 0.5),
|
||||||
),
|
),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child:Text(
|
child: Text(
|
||||||
'لیست خریداران خارج از استان',
|
'لیست خریداران خارج از استان',
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkHover),
|
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkHover),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
onLoadMore: () async => controller.getOutProvinceCarcassesBuyer(true),
|
onLoadMore: () async => controller.getOutProvinceCarcassesBuyer(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getOutProvinceCarcassesBuyer();
|
|
||||||
},
|
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
|
|||||||
body: ObxValue((data) {
|
body: ObxValue((data) {
|
||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
onLoadMore: () async => controller.getOutProvinceSales(true),
|
onLoadMore: () async => controller.getOutProvinceSales(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getOutProvinceSales();
|
|
||||||
},
|
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
|
|||||||
@@ -220,4 +220,10 @@ class SegmentationLogic extends GetxController {
|
|||||||
onError: (error, stacktrace) {},
|
onError: (error, stacktrace) {},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> onRefresh() async {
|
||||||
|
currentPage.value = 1;
|
||||||
|
await getAllSegmentation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
|
|||||||
onFilterTap: () {
|
onFilterTap: () {
|
||||||
Get.bottomSheet(filterBottomSheet());
|
Get.bottomSheet(filterBottomSheet());
|
||||||
},
|
},
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
hasBack: false,
|
hasBack: false,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -25,10 +26,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
|
|||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
onLoadMore: () async => controller.getAllSegmentation(true),
|
onLoadMore: () async => controller.getAllSegmentation(true),
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
await controller.getAllSegmentation();
|
|
||||||
},
|
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
BackGroundWidget chickenBackground() {
|
BoxDecoration chickenBackground() {
|
||||||
return BackGroundWidget(
|
return backGroundDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment(1.00, 0.01),
|
begin: Alignment(1.00, 0.01),
|
||||||
end: Alignment(0.04, 0.99),
|
end: Alignment(0.04, 0.99),
|
||||||
@@ -12,6 +12,6 @@ BackGroundWidget chickenBackground() {
|
|||||||
const Color(0xFFD6E4E3).withValues(alpha: .8),
|
const Color(0xFFD6E4E3).withValues(alpha: .8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
vecPath: Assets.vec.chickenPatternSvg.path,
|
backgroundPath: Assets.images.patternChicken.path,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
this.onSearchChanged,
|
this.onSearchChanged,
|
||||||
this.routes,
|
this.routes,
|
||||||
this.routesWidget,
|
this.routesWidget,
|
||||||
this.widgets,
|
|
||||||
this.child,
|
this.child,
|
||||||
this.scrollable = false,
|
this.scrollable = false,
|
||||||
this.floatingActionButtonLocation,
|
this.floatingActionButtonLocation,
|
||||||
@@ -30,6 +29,7 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
this.backGroundWidget,
|
this.backGroundWidget,
|
||||||
this.isFullScreen = false,
|
this.isFullScreen = false,
|
||||||
this.onPopScopTaped,
|
this.onPopScopTaped,
|
||||||
|
this.onRefresh,
|
||||||
});
|
});
|
||||||
|
|
||||||
//AppBar properties`
|
//AppBar properties`
|
||||||
@@ -48,10 +48,10 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
final VoidCallback? onSearchTap;
|
final VoidCallback? onSearchTap;
|
||||||
final VoidCallback? onNewsTap;
|
final VoidCallback? onNewsTap;
|
||||||
final VoidCallback? onNotificationTap;
|
final VoidCallback? onNotificationTap;
|
||||||
|
final RefreshCallback? onRefresh;
|
||||||
|
|
||||||
final List<String>? routes;
|
final List<String>? routes;
|
||||||
final Widget? routesWidget;
|
final Widget? routesWidget;
|
||||||
final List<Widget>? widgets;
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final bool scrollable;
|
final bool scrollable;
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
final Widget? filteringWidget;
|
final Widget? filteringWidget;
|
||||||
final void Function(String?)? onSearchChanged;
|
final void Function(String?)? onSearchChanged;
|
||||||
|
|
||||||
final BackGroundWidget? backGroundWidget;
|
final BoxDecoration? backGroundWidget;
|
||||||
|
|
||||||
void _onFilterTap() {
|
void _onFilterTap() {
|
||||||
if (hasFilter && filteringWidget != null) {
|
if (hasFilter && filteringWidget != null) {
|
||||||
@@ -82,13 +82,12 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
routes: routes,
|
routes: routes,
|
||||||
routesWidget: routesWidget,
|
routesWidget: routesWidget,
|
||||||
onPopScopTaped: onPopScopTaped,
|
onPopScopTaped: onPopScopTaped,
|
||||||
widgets: widgets,
|
onRefresh: onRefresh,
|
||||||
child: child,
|
child: child,
|
||||||
scrollable: scrollable,
|
|
||||||
onSearchChanged: onSearchChanged,
|
onSearchChanged: onSearchChanged,
|
||||||
floatingActionButtonLocation: floatingActionButtonLocation,
|
floatingActionButtonLocation: floatingActionButtonLocation,
|
||||||
floatingActionButton: floatingActionButton,
|
floatingActionButton: floatingActionButton,
|
||||||
backGroundWidget: backGroundWidget ?? chickenBackground(),
|
backGroundDecoration: backGroundWidget ?? chickenBackground(),
|
||||||
appBar: isFullScreen
|
appBar: isFullScreen
|
||||||
? null
|
? null
|
||||||
: chickenAppBar(
|
: chickenAppBar(
|
||||||
|
|||||||
@@ -493,6 +493,9 @@ class $AssetsImagesGen {
|
|||||||
/// File path: assets/images/outter_splash.webp
|
/// File path: assets/images/outter_splash.webp
|
||||||
AssetGenImage get outterSplash => const AssetGenImage('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
|
/// File path: assets/images/place_holder.png
|
||||||
AssetGenImage get placeHolder => const AssetGenImage('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');
|
AssetGenImage get selectRole => const AssetGenImage('assets/images/select_role.webp');
|
||||||
|
|
||||||
/// List of all assets
|
/// 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 {
|
class $AssetsLogosGen {
|
||||||
|
|||||||
@@ -6,30 +6,28 @@ class BasePage extends GetView<BaseLogic> {
|
|||||||
super.key,
|
super.key,
|
||||||
this.routes,
|
this.routes,
|
||||||
this.routesWidget,
|
this.routesWidget,
|
||||||
this.widgets,
|
|
||||||
this.child,
|
this.child,
|
||||||
this.scrollable = false,
|
|
||||||
this.floatingActionButtonLocation,
|
this.floatingActionButtonLocation,
|
||||||
this.floatingActionButton,
|
this.floatingActionButton,
|
||||||
this.appBar,
|
this.appBar,
|
||||||
this.backGroundWidget,
|
this.backGroundDecoration,
|
||||||
this.onPopScopTaped,
|
this.onPopScopTaped,
|
||||||
this.backId,
|
this.backId,
|
||||||
this.onSearchChanged,
|
this.onSearchChanged,
|
||||||
|
this.onRefresh,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<String>? routes;
|
final List<String>? routes;
|
||||||
final Widget? routesWidget;
|
final Widget? routesWidget;
|
||||||
final List<Widget>? widgets;
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final bool scrollable;
|
|
||||||
final RAppBar? appBar;
|
final RAppBar? appBar;
|
||||||
final BackGroundWidget? backGroundWidget;
|
final BoxDecoration? backGroundDecoration;
|
||||||
final FloatingActionButtonLocation? floatingActionButtonLocation;
|
final FloatingActionButtonLocation? floatingActionButtonLocation;
|
||||||
final Widget? floatingActionButton;
|
final Widget? floatingActionButton;
|
||||||
final VoidCallback? onPopScopTaped;
|
final VoidCallback? onPopScopTaped;
|
||||||
final int? backId;
|
final int? backId;
|
||||||
final void Function(String?)? onSearchChanged;
|
final void Function(String?)? onSearchChanged;
|
||||||
|
final RefreshCallback? onRefresh;
|
||||||
|
|
||||||
Widget _buildHeader() {
|
Widget _buildHeader() {
|
||||||
if (appBar?.hasSearch == true) {
|
if (appBar?.hasSearch == true) {
|
||||||
@@ -49,38 +47,30 @@ class BasePage extends GetView<BaseLogic> {
|
|||||||
final content = [
|
final content = [
|
||||||
if (routes != null || routesWidget != null) _buildHeader(),
|
if (routes != null || routesWidget != null) _buildHeader(),
|
||||||
if (child != null) Expanded(child: child!),
|
if (child != null) Expanded(child: child!),
|
||||||
...?widgets,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (scrollable) {
|
if (onRefresh == null) {
|
||||||
if (backGroundWidget != null) {
|
return Container(
|
||||||
return Stack(
|
decoration: backGroundDecoration,
|
||||||
children: [
|
child: Column(mainAxisAlignment: MainAxisAlignment.start, children: content),
|
||||||
?backGroundWidget,
|
);
|
||||||
SingleChildScrollView(
|
} else {
|
||||||
physics: const BouncingScrollPhysics(),
|
return RefreshIndicator.adaptive(
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.h),
|
triggerMode: RefreshIndicatorTriggerMode.anywhere,
|
||||||
child: Column(children: content),
|
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
|
@override
|
||||||
|
|||||||
@@ -2,19 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import '../../../../core.dart';
|
import '../../../../core.dart';
|
||||||
|
|
||||||
class BackGroundWidget extends StatelessWidget {
|
BoxDecoration backGroundDecoration({required Gradient gradient, required String backgroundPath}) {
|
||||||
const BackGroundWidget({super.key, required this.gradient, required this.vecPath});
|
return BoxDecoration(
|
||||||
|
gradient: gradient,
|
||||||
final Gradient gradient;
|
image: DecorationImage(image: AssetGenImage(backgroundPath).provider(), fit: BoxFit.cover),
|
||||||
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),
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class RPaginatedListView<T> extends StatelessWidget {
|
|||||||
required this.itemBuilder,
|
required this.itemBuilder,
|
||||||
required this.itemCount,
|
required this.itemCount,
|
||||||
this.separatorBuilder,
|
this.separatorBuilder,
|
||||||
this.onRefresh,
|
|
||||||
required this.onLoadMore,
|
required this.onLoadMore,
|
||||||
this.isPaginating = false,
|
this.isPaginating = false,
|
||||||
this.hasMore = true,
|
this.hasMore = true,
|
||||||
@@ -27,7 +26,6 @@ class RPaginatedListView<T> extends StatelessWidget {
|
|||||||
final Resource<PaginationModel<T>> resource;
|
final Resource<PaginationModel<T>> resource;
|
||||||
final NullableIndexedWidgetBuilder itemBuilder;
|
final NullableIndexedWidgetBuilder itemBuilder;
|
||||||
final IndexedWidgetBuilder? separatorBuilder;
|
final IndexedWidgetBuilder? separatorBuilder;
|
||||||
final Future<void> Function()? onRefresh;
|
|
||||||
final Future<void> Function() onLoadMore;
|
final Future<void> Function() onLoadMore;
|
||||||
final bool isPaginating;
|
final bool isPaginating;
|
||||||
final bool hasMore;
|
final bool hasMore;
|
||||||
@@ -55,7 +53,7 @@ class RPaginatedListView<T> extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resource.isEmpty || resource.data?.results?.isEmpty == true) {
|
if (resource.isEmpty || resource.data?.results?.isEmpty == true) {
|
||||||
return emptyWidget ?? EmptyWidget(onRefresh: onRefresh);
|
return emptyWidget ?? EmptyWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
final controller = scrollController ?? ScrollController();
|
final controller = scrollController ?? ScrollController();
|
||||||
@@ -69,11 +67,6 @@ class RPaginatedListView<T> extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: RefreshIndicator(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
triggerMode: RefreshIndicatorTriggerMode.anywhere,
|
|
||||||
|
|
||||||
onRefresh: onRefresh ?? () async {},
|
|
||||||
child: listType == ListType.separated
|
child: listType == ListType.separated
|
||||||
? ListView.separated(
|
? ListView.separated(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
@@ -112,7 +105,6 @@ class RPaginatedListView<T> extends StatelessWidget {
|
|||||||
return itemBuilder(context, index);
|
return itemBuilder(context, index);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ class RecordsPage extends GetView<RecordsLogic> {
|
|||||||
resource: data.value,
|
resource: data.value,
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
isPaginating: controller.isLoadingMore.value,
|
isPaginating: controller.isLoadingMore.value,
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
//await controller.getAllocatedMade();
|
|
||||||
},
|
|
||||||
onLoadMore: () async {
|
onLoadMore: () async {
|
||||||
controller.currentPage.value++;
|
controller.currentPage.value++;
|
||||||
iLog(controller.currentPage.value);
|
iLog(controller.currentPage.value);
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ class UsersPage extends GetView<UsersLogic> {
|
|||||||
resource: data.value,
|
resource: data.value,
|
||||||
hasMore: data.value.data?.next != null,
|
hasMore: data.value.data?.next != null,
|
||||||
isPaginating: controller.isLoadingMore.value,
|
isPaginating: controller.isLoadingMore.value,
|
||||||
onRefresh: () async {
|
|
||||||
controller.currentPage.value = 1;
|
|
||||||
//await controller.getAllocatedMade();
|
|
||||||
},
|
|
||||||
onLoadMore: () async {
|
onLoadMore: () async {
|
||||||
controller.currentPage.value++;
|
controller.currentPage.value++;
|
||||||
iLog(controller.currentPage.value);
|
iLog(controller.currentPage.value);
|
||||||
@@ -58,10 +55,7 @@ class UsersPage extends GetView<UsersLogic> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 3,
|
spacing: 3,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text('داود خرم مهری پور', style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal)),
|
||||||
'داود خرم مهری پور',
|
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
|
||||||
),
|
|
||||||
Text(
|
Text(
|
||||||
'09302545455',
|
'09302545455',
|
||||||
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover),
|
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
@@ -72,10 +66,7 @@ class UsersPage extends GetView<UsersLogic> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||||
Text(
|
Text('0 کیلوگرم', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)),
|
||||||
'0 کیلوگرم',
|
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Assets.vec.scanBarcodeSvg.svg(),
|
Assets.vec.scanBarcodeSvg.svg(),
|
||||||
@@ -141,7 +132,7 @@ class UsersPage extends GetView<UsersLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible:true,
|
visible: true,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 16.w,
|
spacing: 16.w,
|
||||||
@@ -176,7 +167,7 @@ class UsersPage extends GetView<UsersLogic> {
|
|||||||
// controller.denyAllocation(item.key ?? '');
|
// controller.denyAllocation(item.key ?? '');
|
||||||
//await controller.deleteAllocation(item);
|
//await controller.deleteAllocation(item);
|
||||||
},
|
},
|
||||||
onRefresh: () async{}
|
onRefresh: () async {},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
borderColor: AppColor.redNormal,
|
borderColor: AppColor.redNormal,
|
||||||
|
|||||||
Reference in New Issue
Block a user