diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0258a40..7c7e1d7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -8,6 +8,7 @@ + setupChickenDI() async { var tokenService = Get.find(); - diAuth.registerLazySingleton( - () => DioRemote(baseUrl: tokenService.baseurl.value), - ); + diAuth.registerLazySingleton(() => DioRemote(baseUrl: tokenService.baseurl.value)); final dioRemote = diAuth.get(); await dioRemote.init(); - diAuth.registerLazySingleton( - () => ChickenRepositoryImpl(dioRemote), - ); + diAuth.registerLazySingleton(() => ChickenRepositoryImpl(dioRemote)); + + diChicken.registerSingleton(ImagePicker()); } diff --git a/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.dart b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.dart new file mode 100644 index 0000000..85a32aa --- /dev/null +++ b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.dart @@ -0,0 +1,21 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'create_steward_free_bar.freezed.dart'; +part 'create_steward_free_bar.g.dart'; + +@freezed +abstract class CreateStewardFreeBar with _$CreateStewardFreeBar { + const factory CreateStewardFreeBar({ + String? productKey, + String? killHouseName, + String? killHouseMobile, + String? province, + String? city, + int? weightOfCarcasses, + String? date, + String? barImage, + }) = _CreateStewardFreeBar; + + factory CreateStewardFreeBar.fromJson(Map json) => + _$CreateStewardFreeBarFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.dart b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.dart new file mode 100644 index 0000000..f46a8f5 --- /dev/null +++ b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.dart @@ -0,0 +1,16 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'iran_province_city_model.freezed.dart'; +part 'iran_province_city_model.g.dart'; + + +@freezed +abstract class IranProvinceCityModel with _$IranProvinceCityModel { + const factory IranProvinceCityModel({ + int? id, + String? name, + }) = _IranProvinceCityModel; + + factory IranProvinceCityModel.fromJson(Map json) => + _$IranProvinceCityModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/pagination_model/pagination_model.dart b/packages/chicken/lib/data/models/response/pagination_model/pagination_model.dart new file mode 100644 index 0000000..61edb74 --- /dev/null +++ b/packages/chicken/lib/data/models/response/pagination_model/pagination_model.dart @@ -0,0 +1,19 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'pagination_model.freezed.dart'; +part 'pagination_model.g.dart'; + +@Freezed(genericArgumentFactories: true) +abstract class PaginationModel with _$PaginationModel { + const factory PaginationModel({ + int? count, + String? next, + String? previous, + List? results, + }) = _PaginationModel; + + factory PaginationModel.fromJson( + Map json, + T Function(Object?) fromJsonT, + ) => _$PaginationModelFromJson(json, fromJsonT); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart index 9247f9f..d09c3a0 100644 --- a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart +++ b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart @@ -6,19 +6,6 @@ part 'steward_free_bar.g.dart'; @freezed abstract class StewardFreeBar with _$StewardFreeBar { const factory StewardFreeBar({ - int? count, - String? next, - String? previous, - List? results, - }) = _StewardFreeBar; - - factory StewardFreeBar.fromJson(Map json) => - _$StewardFreeBarFromJson(json); -} - -@freezed -abstract class Result with _$Result { - const factory Result({ int? id, Steward? steward, dynamic guild, @@ -45,9 +32,10 @@ abstract class Result with _$Result { bool? temporaryDeleted, String? createdBy, String? modifiedBy, - }) = _Result; + }) = _StewardFreeBar; - factory Result.fromJson(Map json) => _$ResultFromJson(json); + factory StewardFreeBar.fromJson(Map json) => + _$StewardFreeBarFromJson(json); } @freezed diff --git a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart index 1e99c86..8e11281 100644 --- a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart +++ b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$StewardFreeBar { - int? get count; String? get next; String? get previous; List? get results; + int? get id; Steward? get steward; dynamic get guild; Product? get product; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get killHouseName; String? get killHouseMobile; String? get killHouseVetName; String? get killHouseVetMobile; String? get province; String? get city; String? get driverName; String? get driverMobile; dynamic get car; String? get pelak; int? get numberOfCarcasses; double? get weightOfCarcasses; String? get barImage; String? get date; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy; /// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -29,16 +29,16 @@ $StewardFreeBarCopyWith get copyWith => _$StewardFreeBarCopyWith @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeBar&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other.results, results)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeBar&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(results)); +int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionEquality().hash(guild),product,key,createDate,modifyDate,trash,killHouseName,killHouseMobile,killHouseVetName,killHouseVetMobile,province,city,driverName,driverMobile,const DeepCollectionEquality().hash(car),pelak,numberOfCarcasses,weightOfCarcasses,barImage,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy]); @override String toString() { - return 'StewardFreeBar(count: $count, next: $next, previous: $previous, results: $results)'; + return 'StewardFreeBar(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)'; } @@ -49,11 +49,11 @@ abstract mixin class $StewardFreeBarCopyWith<$Res> { factory $StewardFreeBarCopyWith(StewardFreeBar value, $Res Function(StewardFreeBar) _then) = _$StewardFreeBarCopyWithImpl; @useResult $Res call({ - int? count, String? next, String? previous, List? results + int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy }); - +$StewardCopyWith<$Res>? get steward;$ProductCopyWith<$Res>? get product; } /// @nodoc @@ -66,156 +66,6 @@ class _$StewardFreeBarCopyWithImpl<$Res> /// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) { - return _then(_self.copyWith( -count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable -as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable -as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable -as String?,results: freezed == results ? _self.results : results // ignore: cast_nullable_to_non_nullable -as List?, - )); -} - -} - - -/// @nodoc -@JsonSerializable() - -class _StewardFreeBar implements StewardFreeBar { - const _StewardFreeBar({this.count, this.next, this.previous, final List? results}): _results = results; - factory _StewardFreeBar.fromJson(Map json) => _$StewardFreeBarFromJson(json); - -@override final int? count; -@override final String? next; -@override final String? previous; - final List? _results; -@override List? get results { - final value = _results; - if (value == null) return null; - if (_results is EqualUnmodifiableListView) return _results; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); -} - - -/// Create a copy of StewardFreeBar -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$StewardFreeBarCopyWith<_StewardFreeBar> get copyWith => __$StewardFreeBarCopyWithImpl<_StewardFreeBar>(this, _$identity); - -@override -Map toJson() { - return _$StewardFreeBarToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeBar&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other._results, _results)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(_results)); - -@override -String toString() { - return 'StewardFreeBar(count: $count, next: $next, previous: $previous, results: $results)'; -} - - -} - -/// @nodoc -abstract mixin class _$StewardFreeBarCopyWith<$Res> implements $StewardFreeBarCopyWith<$Res> { - factory _$StewardFreeBarCopyWith(_StewardFreeBar value, $Res Function(_StewardFreeBar) _then) = __$StewardFreeBarCopyWithImpl; -@override @useResult -$Res call({ - int? count, String? next, String? previous, List? results -}); - - - - -} -/// @nodoc -class __$StewardFreeBarCopyWithImpl<$Res> - implements _$StewardFreeBarCopyWith<$Res> { - __$StewardFreeBarCopyWithImpl(this._self, this._then); - - final _StewardFreeBar _self; - final $Res Function(_StewardFreeBar) _then; - -/// Create a copy of StewardFreeBar -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) { - return _then(_StewardFreeBar( -count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable -as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable -as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable -as String?,results: freezed == results ? _self._results : results // ignore: cast_nullable_to_non_nullable -as List?, - )); -} - - -} - - -/// @nodoc -mixin _$Result { - - int? get id; Steward? get steward; dynamic get guild; Product? get product; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get killHouseName; String? get killHouseMobile; String? get killHouseVetName; String? get killHouseVetMobile; String? get province; String? get city; String? get driverName; String? get driverMobile; dynamic get car; String? get pelak; int? get numberOfCarcasses; double? get weightOfCarcasses; String? get barImage; String? get date; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy; -/// Create a copy of Result -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$ResultCopyWith get copyWith => _$ResultCopyWithImpl(this as Result, _$identity); - - /// Serializes this Result to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is Result&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionEquality().hash(guild),product,key,createDate,modifyDate,trash,killHouseName,killHouseMobile,killHouseVetName,killHouseVetMobile,province,city,driverName,driverMobile,const DeepCollectionEquality().hash(car),pelak,numberOfCarcasses,weightOfCarcasses,barImage,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy]); - -@override -String toString() { - return 'Result(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)'; -} - - -} - -/// @nodoc -abstract mixin class $ResultCopyWith<$Res> { - factory $ResultCopyWith(Result value, $Res Function(Result) _then) = _$ResultCopyWithImpl; -@useResult -$Res call({ - int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy -}); - - -$StewardCopyWith<$Res>? get steward;$ProductCopyWith<$Res>? get product; - -} -/// @nodoc -class _$ResultCopyWithImpl<$Res> - implements $ResultCopyWith<$Res> { - _$ResultCopyWithImpl(this._self, this._then); - - final Result _self; - final $Res Function(Result) _then; - -/// Create a copy of Result -/// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? killHouseVetName = freezed,Object? killHouseVetMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? pelak = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? barImage = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable @@ -247,7 +97,7 @@ as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // as String?, )); } -/// Create a copy of Result +/// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -259,7 +109,7 @@ $StewardCopyWith<$Res>? get steward { return $StewardCopyWith<$Res>(_self.steward!, (value) { return _then(_self.copyWith(steward: value)); }); -}/// Create a copy of Result +}/// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -278,9 +128,9 @@ $ProductCopyWith<$Res>? get product { /// @nodoc @JsonSerializable() -class _Result implements Result { - const _Result({this.id, this.steward, this.guild, this.product, this.key, this.createDate, this.modifyDate, this.trash, this.killHouseName, this.killHouseMobile, this.killHouseVetName, this.killHouseVetMobile, this.province, this.city, this.driverName, this.driverMobile, this.car, this.pelak, this.numberOfCarcasses, this.weightOfCarcasses, this.barImage, this.date, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy}); - factory _Result.fromJson(Map json) => _$ResultFromJson(json); +class _StewardFreeBar implements StewardFreeBar { + const _StewardFreeBar({this.id, this.steward, this.guild, this.product, this.key, this.createDate, this.modifyDate, this.trash, this.killHouseName, this.killHouseMobile, this.killHouseVetName, this.killHouseVetMobile, this.province, this.city, this.driverName, this.driverMobile, this.car, this.pelak, this.numberOfCarcasses, this.weightOfCarcasses, this.barImage, this.date, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy}); + factory _StewardFreeBar.fromJson(Map json) => _$StewardFreeBarFromJson(json); @override final int? id; @override final Steward? steward; @@ -309,20 +159,20 @@ class _Result implements Result { @override final String? createdBy; @override final String? modifiedBy; -/// Create a copy of Result +/// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') -_$ResultCopyWith<_Result> get copyWith => __$ResultCopyWithImpl<_Result>(this, _$identity); +_$StewardFreeBarCopyWith<_StewardFreeBar> get copyWith => __$StewardFreeBarCopyWithImpl<_StewardFreeBar>(this, _$identity); @override Map toJson() { - return _$ResultToJson(this, ); + return _$StewardFreeBarToJson(this, ); } @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _Result&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeBar&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -331,15 +181,15 @@ int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionE @override String toString() { - return 'Result(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)'; + return 'StewardFreeBar(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)'; } } /// @nodoc -abstract mixin class _$ResultCopyWith<$Res> implements $ResultCopyWith<$Res> { - factory _$ResultCopyWith(_Result value, $Res Function(_Result) _then) = __$ResultCopyWithImpl; +abstract mixin class _$StewardFreeBarCopyWith<$Res> implements $StewardFreeBarCopyWith<$Res> { + factory _$StewardFreeBarCopyWith(_StewardFreeBar value, $Res Function(_StewardFreeBar) _then) = __$StewardFreeBarCopyWithImpl; @override @useResult $Res call({ int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy @@ -350,17 +200,17 @@ $Res call({ } /// @nodoc -class __$ResultCopyWithImpl<$Res> - implements _$ResultCopyWith<$Res> { - __$ResultCopyWithImpl(this._self, this._then); +class __$StewardFreeBarCopyWithImpl<$Res> + implements _$StewardFreeBarCopyWith<$Res> { + __$StewardFreeBarCopyWithImpl(this._self, this._then); - final _Result _self; - final $Res Function(_Result) _then; + final _StewardFreeBar _self; + final $Res Function(_StewardFreeBar) _then; -/// Create a copy of Result +/// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? killHouseVetName = freezed,Object? killHouseVetMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? pelak = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? barImage = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) { - return _then(_Result( + return _then(_StewardFreeBar( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as int?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable as Steward?,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable @@ -391,7 +241,7 @@ as String?, )); } -/// Create a copy of Result +/// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -403,7 +253,7 @@ $StewardCopyWith<$Res>? get steward { return $StewardCopyWith<$Res>(_self.steward!, (value) { return _then(_self.copyWith(steward: value)); }); -}/// Create a copy of Result +}/// Create a copy of StewardFreeBar /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') diff --git a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart index b895764..8a9d5bd 100644 --- a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart +++ b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart @@ -8,84 +8,68 @@ part of 'steward_free_bar.dart'; _StewardFreeBar _$StewardFreeBarFromJson(Map json) => _StewardFreeBar( - count: (json['count'] as num?)?.toInt(), - next: json['next'] as String?, - previous: json['previous'] as String?, - results: (json['results'] as List?) - ?.map((e) => Result.fromJson(e as Map)) - .toList(), + id: (json['id'] as num?)?.toInt(), + steward: json['steward'] == null + ? null + : Steward.fromJson(json['steward'] as Map), + guild: json['guild'], + product: json['product'] == null + ? null + : Product.fromJson(json['product'] as Map), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + killHouseName: json['kill_house_name'] as String?, + killHouseMobile: json['kill_house_mobile'] as String?, + killHouseVetName: json['kill_house_vet_name'] as String?, + killHouseVetMobile: json['kill_house_vet_mobile'] as String?, + province: json['province'] as String?, + city: json['city'] as String?, + driverName: json['driver_name'] as String?, + driverMobile: json['driver_mobile'] as String?, + car: json['car'], + pelak: json['pelak'] as String?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(), + barImage: json['bar_image'] as String?, + date: json['date'] as String?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + createdBy: json['created_by'] as String?, + modifiedBy: json['modified_by'] as String?, ); Map _$StewardFreeBarToJson(_StewardFreeBar instance) => { - 'count': instance.count, - 'next': instance.next, - 'previous': instance.previous, - 'results': instance.results, + 'id': instance.id, + 'steward': instance.steward, + 'guild': instance.guild, + 'product': instance.product, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'kill_house_name': instance.killHouseName, + 'kill_house_mobile': instance.killHouseMobile, + 'kill_house_vet_name': instance.killHouseVetName, + 'kill_house_vet_mobile': instance.killHouseVetMobile, + 'province': instance.province, + 'city': instance.city, + 'driver_name': instance.driverName, + 'driver_mobile': instance.driverMobile, + 'car': instance.car, + 'pelak': instance.pelak, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'bar_image': instance.barImage, + 'date': instance.date, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, }; -_Result _$ResultFromJson(Map json) => _Result( - id: (json['id'] as num?)?.toInt(), - steward: json['steward'] == null - ? null - : Steward.fromJson(json['steward'] as Map), - guild: json['guild'], - product: json['product'] == null - ? null - : Product.fromJson(json['product'] as Map), - key: json['key'] as String?, - createDate: json['create_date'] as String?, - modifyDate: json['modify_date'] as String?, - trash: json['trash'] as bool?, - killHouseName: json['kill_house_name'] as String?, - killHouseMobile: json['kill_house_mobile'] as String?, - killHouseVetName: json['kill_house_vet_name'] as String?, - killHouseVetMobile: json['kill_house_vet_mobile'] as String?, - province: json['province'] as String?, - city: json['city'] as String?, - driverName: json['driver_name'] as String?, - driverMobile: json['driver_mobile'] as String?, - car: json['car'], - pelak: json['pelak'] as String?, - numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), - weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(), - barImage: json['bar_image'] as String?, - date: json['date'] as String?, - temporaryTrash: json['temporary_trash'] as bool?, - temporaryDeleted: json['temporary_deleted'] as bool?, - createdBy: json['created_by'] as String?, - modifiedBy: json['modified_by'] as String?, -); - -Map _$ResultToJson(_Result instance) => { - 'id': instance.id, - 'steward': instance.steward, - 'guild': instance.guild, - 'product': instance.product, - 'key': instance.key, - 'create_date': instance.createDate, - 'modify_date': instance.modifyDate, - 'trash': instance.trash, - 'kill_house_name': instance.killHouseName, - 'kill_house_mobile': instance.killHouseMobile, - 'kill_house_vet_name': instance.killHouseVetName, - 'kill_house_vet_mobile': instance.killHouseVetMobile, - 'province': instance.province, - 'city': instance.city, - 'driver_name': instance.driverName, - 'driver_mobile': instance.driverMobile, - 'car': instance.car, - 'pelak': instance.pelak, - 'number_of_carcasses': instance.numberOfCarcasses, - 'weight_of_carcasses': instance.weightOfCarcasses, - 'bar_image': instance.barImage, - 'date': instance.date, - 'temporary_trash': instance.temporaryTrash, - 'temporary_deleted': instance.temporaryDeleted, - 'created_by': instance.createdBy, - 'modified_by': instance.modifiedBy, -}; - _Steward _$StewardFromJson(Map json) => _Steward( user: json['user'] == null ? null diff --git a/packages/chicken/lib/data/repositories/chicken_repository.dart b/packages/chicken/lib/data/repositories/chicken_repository.dart index a3b6eef..a880f85 100644 --- a/packages/chicken/lib/data/repositories/chicken_repository.dart +++ b/packages/chicken/lib/data/repositories/chicken_repository.dart @@ -6,79 +6,67 @@ import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/data/models/response/pagination_model/pagination_model.dart'; import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; -import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' - hide ProductModel; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' hide ProductModel; + +import '../models/request/create_steward_free_bar/create_steward_free_bar.dart'; abstract class ChickenRepository { Future?> getInventory({required String token}); - Future getIKillHouseDistributionInfo({ - required String token, - }); + Future getIKillHouseDistributionInfo({required String token}); - Future getGeneralBarInformation({required String token,Map? queryParameters}); + Future getGeneralBarInformation({required String token, Map? queryParameters}); - Future getWaitingArrivals({ - required String token, - int? page, - }); + Future getWaitingArrivals({required String token, int? page}); - Future setSateForArrivals({ - required String token, - required Map request, - }); + Future setSateForArrivals({required String token, required Map request}); - Future getImportedLoadsModel({ - required String token, - required int page, - }); + Future getImportedLoadsModel({required String token, required int page}); - Future getAllocatedMade({ - required String token, - required int page, - }); + Future getAllocatedMade({required String token, required int page}); - Future confirmAllocation({ - required String token, - required Map allocation, - }); + Future confirmAllocation({required String token, required Map allocation}); - Future denyAllocation({ - required String token, - required String allocationToken, - }); + Future denyAllocation({required String token, required String allocationToken}); - Future confirmAllAllocation({ - required String token, - required List allocationTokens, - }); + Future confirmAllAllocation({required String token, required List allocationTokens}); Future?> getRolesProducts({required String token}); - Future?> getGuilds({ - required String token, - required bool isFree, - }); + Future?> getGuilds({required String token, required bool isFree}); Future getProfile({required String token}); - Future postSubmitStewardAllocation({ - required String token, - required SubmitStewardAllocation request, - }); + Future postSubmitStewardAllocation({required String token, required SubmitStewardAllocation request}); - Future getStewardDashboard({ + Future getStewardDashboard({ required String token, required String stratDate, required String endDate, }); - Future getDashboardKillHouseFreeBar({ + Future getDashboardKillHouseFreeBar({ required String token, required String stratDate, required String endDate, }); + + Future?> getStewardPurchasesOutSideOfTheProvince({ + required String token, + Map? queryParameters, + }); + + Future createStewardPurchasesOutSideOfTheProvince({required String token, required CreateStewardFreeBar body}); + + Future deleteStewardPurchasesOutSideOfTheProvince({required String token, required String stewardFreeBarKey}); + + Future?> getProvince(); + + Future?> getCity({required String provinceName}); } diff --git a/packages/chicken/lib/data/repositories/chicken_repository_imp.dart b/packages/chicken/lib/data/repositories/chicken_repository_imp.dart index 8cc819b..e1a59e9 100644 --- a/packages/chicken/lib/data/repositories/chicken_repository_imp.dart +++ b/packages/chicken/lib/data/repositories/chicken_repository_imp.dart @@ -1,3 +1,4 @@ +import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart'; import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart'; import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; @@ -6,11 +7,13 @@ import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/data/models/response/pagination_model/pagination_model.dart'; import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; -import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' - hide ProductModel; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' hide ProductModel; import 'package:rasadyar_core/core.dart'; import 'chicken_repository.dart'; @@ -25,18 +28,14 @@ class ChickenRepositoryImpl implements ChickenRepository { var res = await _httpClient.get( '/roles-products/?role=Steward', headers: {'Authorization': 'Bearer $token'}, - fromJsonList: (json) => (json) - .map((item) => InventoryModel.fromJson(item as Map)) - .toList(), + fromJsonList: (json) => (json).map((item) => InventoryModel.fromJson(item as Map)).toList(), ); return res.data; } @override - Future getIKillHouseDistributionInfo({ - required String token, - }) async { + Future getIKillHouseDistributionInfo({required String token}) async { var res = await _httpClient.get( '/kill-house-distribution-info/?role=Steward', headers: {'Authorization': 'Bearer $token'}, @@ -49,7 +48,7 @@ class ChickenRepositoryImpl implements ChickenRepository { @override Future getGeneralBarInformation({ required String token, - Map? queryParameters + Map? queryParameters, }) async { var res = await _httpClient.get( '/bars_for_kill_house_dashboard/?role=Steward', @@ -61,10 +60,7 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future getWaitingArrivals({ - required String token, - int? page, - }) async { + Future getWaitingArrivals({required String token, int? page}) async { var res = await _httpClient.get( '/steward-allocation/?search=filter&value=&role=Steward&page=${page ?? 1}&page_size=10&type=not_entered', headers: {'Authorization': 'Bearer $token'}, @@ -74,22 +70,12 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future setSateForArrivals({ - required String token, - required Map request, - }) async { - await _httpClient.put( - '/steward-allocation/0/', - headers: {'Authorization': 'Bearer $token'}, - data: request, - ); + Future setSateForArrivals({required String token, required Map request}) async { + await _httpClient.put('/steward-allocation/0/', headers: {'Authorization': 'Bearer $token'}, data: request); } @override - Future getImportedLoadsModel({ - required String token, - required int page, - }) async { + Future getImportedLoadsModel({required String token, required int page}) async { var res = await _httpClient.get( '/steward-allocation/?role=Steward&search=filter&page=$page&page_size=10&value=&type=entered', headers: {'Authorization': 'Bearer $token'}, @@ -99,10 +85,7 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future getAllocatedMade({ - required String token, - required int page, - }) async { + Future getAllocatedMade({required String token, required int page}) async { var res = await _httpClient.get( '/steward-allocation/?search=filter&value=&role=Steward&page=$page&page_size=100', headers: {'Authorization': 'Bearer $token'}, @@ -112,10 +95,7 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future confirmAllocation({ - required String token, - required Map allocation, - }) async { + Future confirmAllocation({required String token, required Map allocation}) async { var res = await _httpClient.put( '/steward-allocation/0/', headers: {'Authorization': 'Bearer $token'}, @@ -124,10 +104,7 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future denyAllocation({ - required String token, - required String allocationToken, - }) async { + Future denyAllocation({required String token, required String allocationToken}) async { await _httpClient.delete( '/steward-allocation/0/?steward_allocation_key=$allocationToken', headers: {'Authorization': 'Bearer $token'}, @@ -135,10 +112,7 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future confirmAllAllocation({ - required String token, - required List allocationTokens, - }) async { + Future confirmAllAllocation({required String token, required List allocationTokens}) async { await _httpClient.put( '/steward-allocation/0/', headers: {'Authorization': 'Bearer $token'}, @@ -151,25 +125,18 @@ class ChickenRepositoryImpl implements ChickenRepository { var res = await _httpClient.get( '/roles-products/?role=Steward', headers: {'Authorization': 'Bearer $token'}, - fromJsonList: (json) => json - .map((item) => ProductModel.fromJson(item as Map)) - .toList(), + fromJsonList: (json) => json.map((item) => ProductModel.fromJson(item as Map)).toList(), ); return res.data; } @override - Future?> getGuilds({ - required String token, - required bool isFree, - }) async { + Future?> getGuilds({required String token, required bool isFree}) async { var res = await _httpClient.get( '/guilds/?role=Steward&free=$isFree', headers: {'Authorization': 'Bearer $token'}, - fromJsonList: (json) => json - .map((item) => GuildModel.fromJson(item as Map)) - .toList(), + fromJsonList: (json) => json.map((item) => GuildModel.fromJson(item as Map)).toList(), ); return res.data; } @@ -185,15 +152,8 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future postSubmitStewardAllocation({ - required String token, - required SubmitStewardAllocation request, - }) async { - await _httpClient.post( - '/steward-allocation/', - headers: {'Authorization': 'Bearer $token'}, - data: request.toJson(), - ); + Future postSubmitStewardAllocation({required String token, required SubmitStewardAllocation request}) async { + await _httpClient.post('/steward-allocation/', headers: {'Authorization': 'Bearer $token'}, data: request.toJson()); } @override @@ -223,4 +183,64 @@ class ChickenRepositoryImpl implements ChickenRepository { ); return res.data; } + + @override + Future?> getStewardPurchasesOutSideOfTheProvince({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/steward_free_bar/?', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => StewardFreeBar.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future?> getCity({required String provinceName}) async { + var res = await _httpClient.get( + '/iran_city/?', + queryParameters: {'name': provinceName}, + fromJsonList: (json) => json.map((item) => IranProvinceCityModel.fromJson(item as Map)).toList(), + ); + return res.data; + } + + @override + Future?> getProvince() async { + var res = await _httpClient.get( + '/iran_province/', + fromJsonList: (json) => json.map((item) => IranProvinceCityModel.fromJson(item as Map)).toList(), + ); + return res.data; + } + + @override + Future createStewardPurchasesOutSideOfTheProvince({ + required String token, + required CreateStewardFreeBar body, + }) async { + var res = await _httpClient.post( + '/steward_free_bar/', + headers: {'Authorization': 'Bearer $token'}, + data: body.toJson(), + ); + } + + @override + Future deleteStewardPurchasesOutSideOfTheProvince({ + required String token, + required String stewardFreeBarKey, + }) async { + await _httpClient.delete( + '/steward_free_bar/0/?', + headers: {'Authorization': 'Bearer $token'}, + queryParameters: {'key': stewardFreeBarKey}, + ); + } } diff --git a/packages/chicken/lib/presentation/pages/out_of_province/logic.dart b/packages/chicken/lib/presentation/pages/out_of_province/logic.dart index 35fd35c..d39eb9e 100644 --- a/packages/chicken/lib/presentation/pages/out_of_province/logic.dart +++ b/packages/chicken/lib/presentation/pages/out_of_province/logic.dart @@ -22,6 +22,7 @@ class OutOfProvinceLogic extends GetxController { void onInit() { super.onInit(); getStewardDashBord(); + getRolesProducts(); } Future getAllocatedMade() async { diff --git a/packages/chicken/lib/presentation/pages/root/logic.dart b/packages/chicken/lib/presentation/pages/root/logic.dart index 7a24a03..352f0e9 100644 --- a/packages/chicken/lib/presentation/pages/root/logic.dart +++ b/packages/chicken/lib/presentation/pages/root/logic.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart' show Colors; import 'package:flutter/widgets.dart'; import 'package:rasadyar_auth/data/services/token_storage_service.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; import 'package:rasadyar_chicken/data/repositories/chicken_repository.dart'; import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart'; import 'package:rasadyar_chicken/presentation/pages/home/view.dart'; @@ -28,8 +29,6 @@ class RootLogic extends GetxController { GlobalKey(), ]; - - late DioRemote dioRemote; var tokenService = Get.find(); late ChickenRepository chickenRepository; @@ -37,6 +36,8 @@ class RootLogic extends GetxController { RxList errorLocationType = RxList(); RxMap inventoryExpandedList = RxMap(); + RxList provinces = [].obs; + @override void onInit() { super.onInit(); @@ -44,6 +45,8 @@ class RootLogic extends GetxController { dioRemote.init(); chickenRepository = ChickenRepositoryImpl(dioRemote); + getProvinces(); + /*getInventory(); getKillHouseDistributionInfo();*/ } @@ -65,4 +68,16 @@ class RootLogic extends GetxController { void changePage(int index) { currentPage.value = index; } + + Future getProvinces() async { + try { + final res = await chickenRepository.getProvince(); + if (res != null) { + provinces.clear(); + provinces.value = res; + } + } catch (e) { + provinces.clear(); + } + } } diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart index 4e6359d..ccb35a8 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart @@ -1,29 +1,191 @@ +import 'package:flutter/cupertino.dart'; +import 'package:rasadyar_auth/data/utils/safe_call.dart'; +import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/presentation/pages/out_of_province/logic.dart'; import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; import 'package:rasadyar_core/core.dart'; class SalesOutOfProvinceLogic extends GetxController { RxBool isExpanded = false.obs; + RxBool isSubmitButtonEnabled = false.obs; RxList isExpandedList = [].obs; + RxBool searchIsSelected = false.obs; + + //TODO add this to Di + ImagePicker imagePicker = ImagePicker(); + + Rx>> purchaseOutOfProvinceList = Resource>.loading().obs; + Rxn selectedProduct = Rxn(); + + RxList cites = [].obs; + Rxn selectedProvince = Rxn(); + Rxn selectedCity = Rxn(); + Rxn selectedImage = Rxn(); + RxnString _base64Image = RxnString(); + RxnString editImageUrl = RxnString(); RootLogic get rootLogic => Get.find(); + OutOfProvinceLogic get outOfTheProvinceLogic => Get.find(); + TextEditingController sellerNameController = TextEditingController(); + TextEditingController sellerPhoneController = TextEditingController(); + TextEditingController carcassVolumeController = TextEditingController(); + TextEditingController carcassWeightController = TextEditingController(); - - - - - + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); @override void onReady() { - // TODO: implement onReady super.onReady(); + getStewardPurchaseOutOfProvince(); + selectedProvince.listen((p0) => getCites()); + setupListeners(); + debounce(searchedValue, (callback) => getStewardPurchaseOutOfProvince(), time: Duration(milliseconds: 2000)); + ever(searchIsSelected, (data) { + if (data == false) { + searchedValue.value = null; + } + }); } @override void onClose() { - // TODO: implement onClose + sellerNameController.dispose(); + sellerPhoneController.dispose(); + carcassVolumeController.dispose(); + carcassWeightController.dispose(); super.onClose(); } + + Future getStewardPurchaseOutOfProvince() async { + await safeCall( + call: () => rootLogic.chickenRepository.getStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + pageSize: 10, + page: 1, + search: 'filter', + role: 'Steward', + value: searchedValue.value, + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), + ), + ), + onSuccess: (res) { + if ((res?.count ?? 0) == 0) { + purchaseOutOfProvinceList.value = Resource>.empty(); + } else { + purchaseOutOfProvinceList.value = Resource>.success(res!.results!); + } + }, + ); + } + + Future getCites() async { + await safeCall( + call: () => rootLogic.chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''), + onSuccess: (result) { + if (result != null && result.isNotEmpty) { + cites.value = result; + } + }, + ); + } + + void setupListeners() { + sellerNameController.addListener(checkFormValid); + sellerPhoneController.addListener(checkFormValid); + carcassVolumeController.addListener(checkFormValid); + carcassWeightController.addListener(checkFormValid); + + ever(selectedProvince, (_) => checkFormValid()); + ever(selectedCity, (_) => checkFormValid()); + ever(selectedProduct, (_) => checkFormValid()); + ever(selectedImage, (data) async { + checkFormValid(); + if (data?.path != null) { + _base64Image.value = await convertImageToBase64(data!.path); + } + }); + } + + void checkFormValid() { + isSubmitButtonEnabled.value = + sellerNameController.text.isNotEmpty && + sellerPhoneController.text.isNotEmpty && + carcassVolumeController.text.isNotEmpty && + carcassWeightController.text.isNotEmpty && + selectedProvince.value != null && + selectedCity.value != null && + selectedProduct.value != null && + selectedImage.value != null; + } + + Future createStewardPurchaseOutOfProvince() async => await safeCall( + call: () async { + CreateStewardFreeBar createStewardFreeBar = CreateStewardFreeBar( + productKey: selectedProduct.value!.key, + killHouseName: sellerNameController.text, + killHouseMobile: sellerPhoneController.text, + province: selectedProvince.value!.name, + city: selectedCity.value!.name, + weightOfCarcasses: int.parse(carcassWeightController.text), + barImage: _base64Image.value, + date: DateTime.now().formattedYHMS, + ); + final res = await rootLogic.chickenRepository.createStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + body: createStewardFreeBar, + ); + }, + onSuccess: (result) { + getStewardPurchaseOutOfProvince(); + resetSubmitForm(); + }, + ); + + void resetSubmitForm() { + sellerNameController.clear(); + sellerPhoneController.clear(); + carcassVolumeController.clear(); + carcassWeightController.clear(); + selectedProvince.value = null; + selectedCity.value = null; + selectedProduct.value = null; + selectedImage.value = null; + _base64Image.value = null; + editImageUrl.value = null; + + isSubmitButtonEnabled.value = false; + } + + void setEditData(StewardFreeBar item) { + iLog(item.barImage); + editImageUrl.value = item.barImage; + sellerNameController.text = item.killHouseName ?? ''; + sellerPhoneController.text = item.killHouseMobile ?? ''; + carcassVolumeController.text = item.weightOfCarcasses?.toString() ?? ''; + carcassWeightController.text = item.weightOfCarcasses?.toString() ?? ''; + selectedProvince.value = IranProvinceCityModel(name: item.province); + selectedCity.value = IranProvinceCityModel(name: item.city); + selectedProduct.value = outOfTheProvinceLogic.rolesProductsModel.firstWhere( + (element) => element.key == item.product!.key, + ); + isSubmitButtonEnabled.value = true; + } + + Future deleteStewardPurchaseOutOfProvince(String key) async { + await safeCall( + call: () => rootLogic.chickenRepository.deleteStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + stewardFreeBarKey: key, + ), + ); + } } diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart index b5cc18b..f3d7a77 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart @@ -1,5 +1,10 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; import 'package:rasadyar_core/core.dart'; import 'logic.dart'; @@ -25,28 +30,34 @@ class SalesOutOfProvincePage extends GetView { Assets.vec.chickenSvg.svg( width: 24, height: 24, - colorFilter: const ColorFilter.mode( - Colors.white, - BlendMode.srcIn, - ), - ), - Text( - 'رصدطیور', - style: AppFonts.yekan16Bold.copyWith(color: Colors.white), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), ), + Text('رصدطیور', style: AppFonts.yekan16Bold.copyWith(color: Colors.white)), ], ), additionalActions: [ - Assets.vec.searchSvg.svg( - width: 24, - height: 24, - colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + GestureDetector( + onTap: (){ + + controller.searchIsSelected.value = !controller.searchIsSelected.value; + + }, + child: Assets.vec.searchSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), ), SizedBox(width: 8), - Assets.vec.filterOutlineSvg.svg( - width: 20, - height: 20, - colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + GestureDetector( + onTap: () { + Get.bottomSheet(filterBottomSheet()); + }, + child: Assets.vec.filterOutlineSvg.svg( + width: 20, + height: 20, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), ), SizedBox(width: 8), ], @@ -55,43 +66,62 @@ class SalesOutOfProvincePage extends GetView { crossAxisAlignment: CrossAxisAlignment.start, children: [ routePageWidget(), + _buildSearchWidget(), Expanded(child: saleListWidget()), ], ), - floatingActionButton: RFab.add(onPressed: () {}), + floatingActionButton: RFab.add( + onPressed: () { + Get.bottomSheet(addPurchasedInformationBottomSheet(), isScrollControlled: true); + }, + ), floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, ); } - ListView saleListWidget() { - return ListView.separated( - shrinkWrap: true, - physics: BouncingScrollPhysics(), - padding: EdgeInsets.fromLTRB(8, 8, 18, 80), - itemBuilder: (context, index) { - return ObxValue( - (data) => saleListItem(data, index), - controller.isExpandedList, - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 8), - itemCount: 5, - ); + Widget saleListWidget() { + return ObxValue((data) { + switch (data.value.status) { + case Status.initial: + case Status.loading: + return Center(child: CupertinoActivityIndicator()); + case Status.success: + return ListView.separated( + shrinkWrap: true, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.fromLTRB(8, 8, 18, 80), + itemBuilder: (context, index) { + return ObxValue( + (expandList) => saleListItem(expandList: expandList, index: index, item: data.value.data![index]), + controller.isExpandedList, + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 8), + itemCount: data.value.data?.length ?? 0, + ); + case Status.error: + return Center( + child: Text( + data.value.message ?? 'خطا در دریافت اطلاعات', + style: AppFonts.yekan16.copyWith(color: AppColor.error), + ), + ); + case Status.empty: + return emptyWidget(); + } + }, controller.purchaseOutOfProvinceList); } Widget emptyWidget() { return Center( - child: Text( - 'داده ای دریافت نشد!', - style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkHover), - ), + child: Text('داده ای دریافت نشد!', style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkHover)), ); } - GestureDetector saleListItem(RxList data, int index) { + GestureDetector saleListItem({required RxList expandList, required int index, required StewardFreeBar item}) { return GestureDetector( onTap: () { - if (data.contains(index)) { + if (expandList.contains(index)) { controller.isExpandedList.remove(index); } else { controller.isExpandedList.add(index); @@ -100,7 +130,7 @@ class SalesOutOfProvincePage extends GetView { child: AnimatedContainer( duration: Duration(milliseconds: 400), alignment: Alignment.center, - height: data.contains(index) ? 210 : 56, + height: expandList.contains(index) ? 170 : 56, child: Stack( clipBehavior: Clip.none, alignment: Alignment.centerRight, @@ -108,7 +138,7 @@ class SalesOutOfProvincePage extends GetView { AnimatedContainer( width: Get.width - 30, duration: Duration(milliseconds: 300), - height: data.contains(index) ? 210 : 56, + height: expandList.contains(index) ? 170 : 56, alignment: Alignment.center, decoration: BoxDecoration( color: Colors.transparent, @@ -121,27 +151,23 @@ class SalesOutOfProvincePage extends GetView { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Text( - '1403/5/5', + item.date?.formattedJalaliDate ?? 'N/A', textAlign: TextAlign.center, style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), ), Text( - 'افلاک', + item.killHouseName ?? 'N/A', textAlign: TextAlign.center, - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), ), Text( - 'kg 200 مرغ گرم ', + 'kg ${item.weightOfCarcasses} ${item.product?.name}', textAlign: TextAlign.center, - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), ), Text( - 'لرستان-خرم آباد', + '${item.province}-${item.city}', textAlign: TextAlign.center, style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), ), @@ -152,39 +178,46 @@ class SalesOutOfProvincePage extends GetView { secondChild: Container( padding: EdgeInsets.fromLTRB(8, 12, 14, 12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), child: Column( spacing: 8, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Assets.vec.editSvg.svg( - width: 20, - height: 20, - colorFilter: ColorFilter.mode( - AppColor.blueNormal, - BlendMode.srcIn, + GestureDetector( + onTap: () { + controller.setEditData(item); + Get.bottomSheet( + addPurchasedInformationBottomSheet(true), + isScrollControlled: true, + ).whenComplete(() { + controller.resetSubmitForm(); + }); + }, + child: Assets.vec.editSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), ), ), Text( - 'لرستان - خرم آباد', + '${item.province}-${item.city}', textAlign: TextAlign.center, - style: AppFonts.yekan16.copyWith( - color: AppColor.greenDark, - ), + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), ), - Assets.vec.trashSvg.svg( - width: 20, - height: 20, - colorFilter: ColorFilter.mode( - AppColor.error, - BlendMode.srcIn, + GestureDetector( + onTap: () { + buildDeleteDialog( + onConfirm: () => controller.deleteStewardPurchaseOutOfProvince(item.key!), + ); + }, + child: Assets.vec.trashSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn), ), ), ], @@ -195,19 +228,15 @@ class SalesOutOfProvincePage extends GetView { decoration: ShapeDecoration( color: AppColor.blueLight, shape: RoundedRectangleBorder( - side: BorderSide( - width: 1, - color: AppColor.blueLightHover, - ), + side: BorderSide(width: 1, color: AppColor.blueLightHover), borderRadius: BorderRadius.circular(8), ), ), - child: buildRow('تاریخ', '07:15:00 - 1402/07/01'), + child: buildRow('تاریخ', item.date?.formattedJalaliDateYHMS ?? 'N/A'), ), - buildRow('مشخصات فروشنده', 'افلاک - 09203659874'), - buildRow('وزن خریداری شده', '200 کیلوگرم'), - buildRow('لاشه خریداری شده', '200 عدد'), + buildRow('مشخصات فروشنده', '${item.killHouseName} - ${item.killHouseMobile ?? 'N/A'}'), + buildRow('وزن خریداری شده', '${item.weightOfCarcasses?.toInt()} کیلوگرم'), Row( mainAxisAlignment: MainAxisAlignment.end, children: [Icon(CupertinoIcons.chevron_up, size: 12)], @@ -215,9 +244,7 @@ class SalesOutOfProvincePage extends GetView { ], ), ), - crossFadeState: data.contains(index) - ? CrossFadeState.showSecond - : CrossFadeState.showFirst, + crossFadeState: expandList.contains(index) ? CrossFadeState.showSecond : CrossFadeState.showFirst, duration: Duration(milliseconds: 300), ), ), @@ -230,16 +257,10 @@ class SalesOutOfProvincePage extends GetView { decoration: BoxDecoration( color: AppColor.greenLightHover, borderRadius: BorderRadius.circular(4), - border: Border.all( - width: 0.50, - color: AppColor.greenDarkActive, - ), + border: Border.all(width: 0.50, color: AppColor.greenDarkActive), ), alignment: Alignment.center, - child: Text( - (index + 1).toString(), - style: AppFonts.yekan12.copyWith(color: Colors.black), - ), + child: Text((index + 1).toString(), style: AppFonts.yekan12.copyWith(color: Colors.black)), ), ), ], @@ -262,10 +283,7 @@ class SalesOutOfProvincePage extends GetView { Assets.vec.cubeSearchSvg.svg( width: 24, height: 24, - colorFilter: const ColorFilter.mode( - AppColor.blueNormal, - BlendMode.srcIn, - ), + colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), ), SizedBox(width: 6), ], @@ -293,9 +311,7 @@ class SalesOutOfProvincePage extends GetView { child: Text( title, textAlign: TextAlign.right, - style: AppFonts.yekan14.copyWith( - color: AppColor.darkGreyDarkHover, - ), + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), ), ), Flexible( @@ -303,8 +319,354 @@ class SalesOutOfProvincePage extends GetView { child: Text( value, textAlign: TextAlign.left, - style: AppFonts.yekan14.copyWith( - color: AppColor.darkGreyDarkHover, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + ], + ), + ); + } + + Widget addPurchasedInformationBottomSheet([bool isOnEdit = false]) { + return BaseBottomSheet( + child: SingleChildScrollView( + child: Column( + spacing: 16, + children: [ + Text( + isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), + ), + _productTypeWidget(), + RTextField( + controller: controller.sellerNameController, + label: 'نام فروشنده', + borderColor: AppColor.darkGreyLight, + ), + RTextField( + controller: controller.sellerPhoneController, + label: 'تلفن فروشنده', + keyboardType: TextInputType.phone, + borderColor: AppColor.darkGreyLight, + ), + _provinceWidget(), + _cityWidget(), + RTextField( + controller: controller.carcassWeightController, + label: 'وزن لاشه', + keyboardType: TextInputType.number, + borderColor: AppColor.darkGreyLight, + ), + RTextField( + controller: controller.carcassVolumeController, + label: 'حجم لاشه', + onChanged: (p0) { + iLog(controller.carcassVolumeController.text); + }, + keyboardType: TextInputType.number, + borderColor: AppColor.darkGreyLight, + ), + _imageCarcasesWidget(isOnEdit), + submitButtonWidget(isOnEdit), + SizedBox(), + ], + ), + ), + ); + } + + Widget submitButtonWidget(bool isOnEdit) { + return ObxValue((data) { + return RElevated( + text: isOnEdit ? 'ویرایش خرید' : 'ثبت خرید جدید', + onPressed: data.value + ? () async { + await controller.createStewardPurchaseOutOfProvince(); + Get.back(); + } + : null, + height: 40, + ); + }, controller.isSubmitButtonEnabled); + } + + Widget _productTypeWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.outOfTheProvinceLogic.rolesProductsModel, + onChanged: (value) { + controller.selectedProduct.value = value; + print('Selected Product: ${value.name}'); + }, + selectedItem: controller.selectedProduct.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب محصول'), + ); + }); + } + + Widget _provinceWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.provinces, + onChanged: (value) { + controller.selectedProvince.value = value; + print('Selected Product: ${value.name}'); + }, + selectedItem: controller.selectedProvince.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'), + ); + }); + } + + Widget _cityWidget() { + return ObxValue((data) { + return OverlayDropdownWidget( + items: data, + onChanged: (value) { + controller.selectedCity.value = value; + print('Selected Product: ${value.name}'); + }, + selectedItem: controller.selectedCity.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'), + ); + }, controller.cites); + } + + SizedBox _imageCarcasesWidget(bool isOnEdit) { + return SizedBox( + width: Get.width, + height: 250, + child: Card( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Expanded( + child: ObxValue((data) { + return Container( + width: Get.width, + decoration: BoxDecoration(color: AppColor.lightGreyNormal, borderRadius: BorderRadius.circular(8)), + child: Center( + child: isOnEdit + ? Image.network(controller.editImageUrl.value ?? '') + : data.value == null + ? Assets.images.placeHolder.image(height: 150, width: 200) + : Image.file(File(data.value!.path), fit: BoxFit.cover), + ), + ); + }, controller.selectedImage), + ), + SizedBox(height: 15), + Container( + width: Get.width, + height: 40, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text('تصویر بار', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + Spacer(), + GestureDetector( + onTap: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.camera, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + child: Container( + decoration: ShapeDecoration( + color: AppColor.blueNormal, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + padding: EdgeInsetsGeometry.symmetric(horizontal: 6, vertical: 4), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text('دوربین', style: AppFonts.yekan14.copyWith(color: Colors.white)), + SizedBox(width: 8), + Icon(CupertinoIcons.camera, color: Colors.white), + ], + ), + ), + ), + SizedBox(width: 16), + GestureDetector( + onTap: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.gallery, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + child: Container( + decoration: ShapeDecoration( + color: AppColor.blueNormal, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + padding: EdgeInsetsGeometry.symmetric(horizontal: 6, vertical: 4), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text('گالری', style: AppFonts.yekan14.copyWith(color: Colors.white)), + SizedBox(width: 8), + Icon(CupertinoIcons.photo, color: Colors.white), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + Future buildDeleteDialog({required Future Function() onConfirm}) async { + await Get.defaultDialog( + title: 'حذف خرید', + middleText: 'آیا از حذف این خرید مطمئن هستید؟', + confirm: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: AppColor.error, foregroundColor: Colors.white), + onPressed: () async { + await onConfirm(); + Get.back(); + }, + child: Text('بله'), + ), + cancel: ElevatedButton( + onPressed: () { + Get.back(); + }, + child: Text('خیر'), + ), + ).whenComplete(() => controller.getStewardPurchaseOutOfProvince()); + } + + Widget filterBottomSheet() { + return BaseBottomSheet( + height: 250, + child: Column( + spacing: 16, + children: [ + Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover)), + Row( + spacing: 8, + children: [ + Expanded( + child: timeFilterWidget( + date: controller.fromDateFilter, + onChanged: (jalali) => controller.fromDateFilter.value = jalali, + ), + ), + Expanded( + child: timeFilterWidget( + isFrom: false, + date: controller.toDateFilter, + onChanged: (jalali) => controller.toDateFilter.value = jalali, + ), + ), + ], + ), + SizedBox(height: 2), + RElevated( + text: 'اعمال فیلتر', + onPressed: () { + controller.getStewardPurchaseOutOfProvince(); + Get.back(); + }, + height: 40, + ), + SizedBox(height: 16), + ], + ), + ); + } + + GestureDetector timeFilterWidget({ + isFrom = true, + required Rx date, + required Function(Jalali jalali) onChanged, + }) { + return GestureDetector( + onTap: () { + Get.bottomSheet(modalDatePicker((value) => onChanged(value))); + }, + child: Container( + height: 35, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blueNormal), + ), + padding: EdgeInsets.symmetric(horizontal: 11, vertical: 4), + child: Row( + spacing: 8, + children: [ + Assets.vec.calendarSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + Text(isFrom ? 'از' : 'تا', style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal)), + Expanded( + child: ObxValue((data) { + return Text( + date.value.formatCompactDate(), + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive), + ); + }, date), + ), + ], + ), + ), + ); + } + + Container modalDatePicker(ValueChanged onDateSelected) { + Jalali? tempPickedDate; + return Container( + height: 250, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + CupertinoButton( + child: Text('تایید', style: AppFonts.yekan14), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + ), + CupertinoButton( + child: Text('لغو', style: AppFonts.yekan14.copyWith(color: AppColor.error)), + onPressed: () => Get.back(), + ), + ], + ), + ), + Divider(height: 0, thickness: 1), + Expanded( + child: Container( + child: PersianCupertinoDatePicker( + initialDateTime: Jalali.now(), + mode: PersianCupertinoDatePickerMode.date, + onDateTimeChanged: (dateTime) { + tempPickedDate = dateTime; + }, ), ), ), @@ -312,4 +674,36 @@ class SalesOutOfProvincePage extends GetView { ), ); } + + ObxValue _buildSearchWidget() { + return ObxValue((data) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + padding: EdgeInsets.only(top: 5), + curve: Curves.easeInOut, + height: data.value ? 50 : 0, + child: Visibility( + visible: data.value, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: RTextField( + suffixIcon: Padding( + padding: const EdgeInsets.all(12.0), + child: Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + hintText: 'جستجو', + onChanged: (value) { + controller.searchedValue.value = value; + }, + controller: TextEditingController(), + ), + ), + ), + ); + }, controller.searchIsSelected); + } } diff --git a/packages/core/lib/core.dart b/packages/core/lib/core.dart index a2b70e5..cd79f4b 100644 --- a/packages/core/lib/core.dart +++ b/packages/core/lib/core.dart @@ -39,9 +39,13 @@ export 'infrastructure/remote/dio_form_data.dart'; export 'infrastructure/remote/dio_remote.dart'; export 'infrastructure/remote/dio_response.dart'; export 'injection/di.dart'; + +///image picker +export 'package:image_picker/image_picker.dart'; + //utils export 'utils/logger_utils.dart'; -export 'utils/safe_call_utils.dart'; +export 'utils/network/network.dart'; export 'utils/date_time_utils.dart'; export 'utils/num_utils.dart'; export 'utils/map_utils.dart'; diff --git a/packages/core/lib/presentation/utils/image_utils.dart b/packages/core/lib/presentation/utils/image_utils.dart new file mode 100644 index 0000000..eb5c2b9 --- /dev/null +++ b/packages/core/lib/presentation/utils/image_utils.dart @@ -0,0 +1,8 @@ +import 'dart:convert'; +import 'dart:io'; + +Future convertImageToBase64(String imagePath) async { + final bytes = await File(imagePath).readAsBytes(); + String base64String = base64Encode(bytes); + return base64String; +} diff --git a/packages/core/lib/presentation/utils/utils.dart b/packages/core/lib/presentation/utils/utils.dart index 507c240..88258e2 100644 --- a/packages/core/lib/presentation/utils/utils.dart +++ b/packages/core/lib/presentation/utils/utils.dart @@ -1,3 +1,4 @@ -export 'color_utils.dart'; +export 'color_utils.dart'; +export 'data_time_utils.dart'; +export 'image_utils.dart'; export 'list_extensions.dart'; -export 'data_time_utils.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart index 91826d5..8ba0671 100644 --- a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart @@ -20,7 +20,6 @@ class DraggableBottomSheet2 extends GetView { return ObxValue((data) { return Stack( children: [ - // پس‌زمینه تیره Positioned.fill( child: GestureDetector( onTap: () {}, diff --git a/packages/core/lib/presentation/widget/inputs/r_input.dart b/packages/core/lib/presentation/widget/inputs/r_input.dart index 2780b59..3debe30 100644 --- a/packages/core/lib/presentation/widget/inputs/r_input.dart +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -26,6 +26,7 @@ class RTextField extends StatefulWidget { final RTextFieldVariant variant; final bool filled; final Color? filledColor; + final Color? borderColor; final bool showCounter; final bool isDense; final TextInputType? keyboardType; @@ -67,6 +68,7 @@ class RTextField extends StatefulWidget { this.validator, this.onChanged, this.onSubmitted, + this.borderColor, }); @@ -82,7 +84,7 @@ class RTextField extends StatefulWidget { _noBorder || _passwordNoBorder ? InputBorder.none : OutlineInputBorder( borderRadius: BorderRadius.circular(8), borderSide: BorderSide( - color: AppColor.lightGreyDarkActive, + color: borderColor ?? AppColor.lightGreyDarkActive, width: 1, ), ); diff --git a/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart b/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart index 8d8496d..df217a3 100644 --- a/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart +++ b/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart @@ -134,6 +134,7 @@ class _OverlayDropdownState extends State> { _isOpen.value ? CupertinoIcons.chevron_up : CupertinoIcons.chevron_down, + size: 14, ), ], ), diff --git a/packages/core/lib/utils/date_time_utils.dart b/packages/core/lib/utils/date_time_utils.dart index 3244f49..32d439d 100644 --- a/packages/core/lib/utils/date_time_utils.dart +++ b/packages/core/lib/utils/date_time_utils.dart @@ -1,10 +1,38 @@ +import 'package:intl/intl.dart'; import 'package:persian_datetime_picker/persian_datetime_picker.dart'; -extension xDateTime on String{ +extension XDateTime on String{ get toDateTime => DateTime.parse(this); + get formattedJalaliDate{ final dateTime = DateTime.parse(this); final jalaliDate = Jalali.fromDateTime(dateTime); return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; } -} \ No newline at end of file + + get formattedJalaliDateYHMS { + final dateTime = DateTime.parse(this); + final jalaliDate = Jalali.fromDateTime(dateTime); + return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')} - ${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')}"; + } + + + get formattedYHMS{ + return DateFormat('yyyy-MM-dd HH:mm:ss').format(toDateTime); + } +} + + + +extension XDateTime2 on DateTime{ + + + get formattedJalaliDate{ + final jalaliDate = Jalali.fromDateTime(this); + return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; + } + + get formattedYHMS{ + return DateFormat('yyyy-MM-dd HH:mm:ss').format(this); + } +} diff --git a/packages/core/lib/utils/map_utils.dart b/packages/core/lib/utils/map_utils.dart index 99866c8..943ab2a 100644 --- a/packages/core/lib/utils/map_utils.dart +++ b/packages/core/lib/utils/map_utils.dart @@ -8,6 +8,7 @@ Map buildQueryParams({ int? pageSize, DateTime? fromDate, DateTime? toDate, + String? role, }) { final params = {}; @@ -40,5 +41,9 @@ Map buildQueryParams({ params['page_size'] = pageSize; } + if(role != null && role.isNotEmpty) { + params['role'] = role; + } + return params; } diff --git a/packages/core/lib/utils/network/network.dart b/packages/core/lib/utils/network/network.dart new file mode 100644 index 0000000..0ff8a3c --- /dev/null +++ b/packages/core/lib/utils/network/network.dart @@ -0,0 +1,2 @@ +export 'resource.dart'; +export 'safe_call_utils.dart'; \ No newline at end of file diff --git a/packages/core/lib/utils/network/resource.dart b/packages/core/lib/utils/network/resource.dart new file mode 100644 index 0000000..3d44df0 --- /dev/null +++ b/packages/core/lib/utils/network/resource.dart @@ -0,0 +1,46 @@ +enum Status { + initial, + loading, + success, + error, + empty, +} + + +class Resource { + final Status status; + final T? data; + final String? message; + + const Resource._({ + required this.status, + this.data, + this.message, + }); + + const Resource.initial() : this._(status: Status.initial); + + const Resource.loading() : this._(status: Status.loading); + + const Resource.success(T data) : this._(status: Status.success, data: data); + + const Resource.error(String message) : this._(status: Status.error, message: message); + + const Resource.empty() : this._(status: Status.empty); + + + bool get isInitial => status == Status.initial; + + bool get isLoading => status == Status.loading; + + bool get isSuccess => status == Status.success; + + bool get isError => status == Status.error; + + bool get isEmpty => status == Status.empty; + + @override + String toString() { + return 'Resource{status: $status, data: $data, message: $message}'; + } +} \ No newline at end of file diff --git a/packages/core/lib/utils/safe_call_utils.dart b/packages/core/lib/utils/network/safe_call_utils.dart similarity index 98% rename from packages/core/lib/utils/safe_call_utils.dart rename to packages/core/lib/utils/network/safe_call_utils.dart index c4baa0b..882a549 100644 --- a/packages/core/lib/utils/safe_call_utils.dart +++ b/packages/core/lib/utils/network/safe_call_utils.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; -import '../core.dart'; +import '../../core.dart'; typedef AppAsyncCallback = Future Function(); typedef ErrorCallback = void Function(dynamic error, StackTrace? stackTrace); diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock index d023e16..625014b 100644 --- a/packages/core/pubspec.lock +++ b/packages/core/pubspec.lock @@ -177,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -281,6 +289,38 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" + url: "https://pub.dev" + source: hosted + version: "0.9.4+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" + url: "https://pub.dev" + source: hosted + version: "0.9.3+4" fixnum: dependency: transitive description: @@ -339,6 +379,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e + url: "https://pub.dev" + source: hosted + version: "2.0.28" flutter_rating_bar: dependency: "direct main" description: @@ -597,6 +645,70 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb" + url: "https://pub.dev" + source: hosted + version: "0.8.12+23" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + url: "https://pub.dev" + source: hosted + version: "0.8.12+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + url: "https://pub.dev" + source: hosted + version: "2.10.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" image_size_getter: dependency: transitive description: diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 5cd944d..ee443df 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -15,6 +15,9 @@ dependencies: #utils device_info_plus: ^11.4.0 + ##image_picker + image_picker: ^1.1.2 + #UI cupertino_icons: ^1.0.8 diff --git a/pubspec.lock b/pubspec.lock index c2ae1cd..5866c33 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -193,6 +193,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -297,6 +305,38 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" + url: "https://pub.dev" + source: hosted + version: "0.9.4+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" + url: "https://pub.dev" + source: hosted + version: "0.9.3+4" fixnum: dependency: transitive description: @@ -363,6 +403,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e + url: "https://pub.dev" + source: hosted + version: "2.0.28" flutter_rating_bar: dependency: transitive description: @@ -629,6 +677,70 @@ packages: url: "https://pub.dev" source: hosted version: "4.5.4" + image_picker: + dependency: transitive + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb" + url: "https://pub.dev" + source: hosted + version: "0.8.12+23" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + url: "https://pub.dev" + source: hosted + version: "0.8.12+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + url: "https://pub.dev" + source: hosted + version: "2.10.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" image_size_getter: dependency: transitive description: