From d10e0459aec9b314d46113e5a252e3e36b796527 Mon Sep 17 00:00:00 2001 From: llsajjad Date: Mon, 11 Aug 2025 15:52:13 +0330 Subject: [PATCH] Added logic to YourTenders --- lib/core/config/dependencies.dart | 10 + .../repositories/your_tenders_repository.dart | 15 + .../mock_data/mock_your_tenders_data.dart | 62 ++ .../home_request_model.freezed.dart | 368 ++++------- .../home_request/home_request_model.g.dart | 10 +- .../home_response_model.freezed.dart | 609 ++++++++++-------- .../home_response/home_response_model.g.dart | 52 +- .../home/tender/tender_model.freezed.dart | 545 ++++++++-------- .../model/home/tender/tender_model.g.dart | 21 +- .../tender_detail_request.freezed.dart | 14 +- .../your_tender_model/your_tender_model.dart | 20 + .../your_tender_model.freezed.dart | 329 ++++++++++ .../your_tender_model.g.dart | 31 + .../your_tenders_request_model.dart | 14 + .../your_tenders_request_model.freezed.dart | 181 ++++++ .../your_tenders_request_model.g.dart | 15 + .../your_tender_model_response.dart | 16 + .../your_tender_model_response.freezed.dart | 233 +++++++ .../your_tender_model_response.g.dart | 27 + lib/data/services/your_tenders_service.dart | 16 + lib/gen/assets.gen.dart | 22 +- lib/view_models/your_tenders_view_model.dart | 37 ++ .../pages/your_tenders_desktop_page.dart | 11 +- .../widgets/approved_tenders.dart | 71 +- .../widgets/tenders_submitted.dart | 67 +- 25 files changed, 1958 insertions(+), 838 deletions(-) create mode 100644 lib/data/repositories/your_tenders_repository.dart create mode 100644 lib/data/services/mock_data/mock_your_tenders_data.dart create mode 100644 lib/data/services/model/your_tender_model/your_tender_model.dart create mode 100644 lib/data/services/model/your_tender_model/your_tender_model.freezed.dart create mode 100644 lib/data/services/model/your_tender_model/your_tender_model.g.dart create mode 100644 lib/data/services/model/your_tender_model_request/your_tenders_request_model.dart create mode 100644 lib/data/services/model/your_tender_model_request/your_tenders_request_model.freezed.dart create mode 100644 lib/data/services/model/your_tender_model_request/your_tenders_request_model.g.dart create mode 100644 lib/data/services/model/your_tender_model_response/your_tender_model_response.dart create mode 100644 lib/data/services/model/your_tender_model_response/your_tender_model_response.freezed.dart create mode 100644 lib/data/services/model/your_tender_model_response/your_tender_model_response.g.dart create mode 100644 lib/data/services/your_tenders_service.dart create mode 100644 lib/view_models/your_tenders_view_model.dart diff --git a/lib/core/config/dependencies.dart b/lib/core/config/dependencies.dart index de9236d..4b0c832 100644 --- a/lib/core/config/dependencies.dart +++ b/lib/core/config/dependencies.dart @@ -3,10 +3,13 @@ import 'package:provider/single_child_widget.dart'; import 'package:tm_app/core/theme/theme_provider.dart'; import 'package:tm_app/data/repositories/home_repository.dart'; import 'package:tm_app/data/repositories/tender_detail_repository.dart'; +import 'package:tm_app/data/repositories/your_tenders_repository.dart'; import 'package:tm_app/data/services/home_service.dart'; import 'package:tm_app/data/services/tender_detail_service.dart'; +import 'package:tm_app/data/services/your_tenders_service.dart'; import 'package:tm_app/view_models/tender_detail_view_model.dart'; import 'package:tm_app/view_models/tenders_view_model.dart'; +import 'package:tm_app/view_models/your_tenders_view_model.dart'; import '../../data/repositories/auth_repository.dart'; import '../../data/services/auth_service.dart'; @@ -32,6 +35,7 @@ List get apiClients { Provider( create: (context) => TenderDetailService(networkManager: context.read()), ), + Provider(create: (context) => YourTendersService()), ]; } @@ -44,6 +48,9 @@ List get repositories { (context) => TenderDetailRepository(tenderDetailService: context.read()), ), + Provider( + create: (context) => YourTendersRepository(yourTendersService: context.read()), + ), ]; } @@ -61,6 +68,9 @@ List get viewModels { TenderDetailViewModel(tenderDetailRepository: context.read()), ), ChangeNotifierProvider(create: (context) => TendersViewModel()), + ChangeNotifierProvider( + create: (context) => YourTendersViewModel(yourTendersRepository: context.read()), + ), ]; } diff --git a/lib/data/repositories/your_tenders_repository.dart b/lib/data/repositories/your_tenders_repository.dart new file mode 100644 index 0000000..700aac1 --- /dev/null +++ b/lib/data/repositories/your_tenders_repository.dart @@ -0,0 +1,15 @@ +import 'package:tm_app/core/utils/result.dart'; +import 'package:tm_app/data/services/model/your_tender_model_request/your_tenders_request_model.dart'; +import 'package:tm_app/data/services/model/your_tender_model_response/your_tender_model_response.dart'; +import 'package:tm_app/data/services/your_tenders_service.dart'; + +class YourTendersRepository { + final YourTendersService yourTendersService; + YourTendersRepository({required this.yourTendersService}); + + Future> getYourTenders({ + required YourTendersRequestModel request, + }) { + return yourTendersService.getYourTenders(request: request); + } +} diff --git a/lib/data/services/mock_data/mock_your_tenders_data.dart b/lib/data/services/mock_data/mock_your_tenders_data.dart new file mode 100644 index 0000000..4071345 --- /dev/null +++ b/lib/data/services/mock_data/mock_your_tenders_data.dart @@ -0,0 +1,62 @@ +const String mockYourTendersData = ''' +{ + "approvedTenders": [ + { + "date": "2025-05-21", + "title": "Lorem ipsum dolor sit amet consectetur. Sed mi tortor eu purus senectus.", + "description": "Lorem ipsum dolor sit amet consectetur. Volutpat velit tincidunt amet diam. Placerat congue ut Sed facilisis faucibus porttitor. Proin suspendisse eu euismod sit lorem quis. Suscipit ...", + "location": "Sweden", + "countryFlag": "assets/icons/SE.png", + "status": "Completed", + "projectStatus": "Self Control" + }, + { + "date": "2025-05-21", + "title": "Lorem ipsum dolor sit amet consectetur. Sed mi tortor eu purus senectus.", + "description": "Lorem ipsum dolor sit amet consectetur. Volutpat velit tincidunt amet diam. Placerat congue ut Sed facilisis faucibus porttitor.", + "location": "Thailand", + "countryFlag": "assets/icons/SE.png", + "status": "Completed", + "projectStatus": "Partner Ship" + }, + { + "date": "2025-05-21", + "title": "Lorem ipsum dolor sit amet consectetur.", + "description": "Lorem ipsum dolor sit amet consectetur. Volutpat facilisis faucibus porttitor. Proin suspendisse eu euismod sit lorem quis.", + "location": "Italy", + "countryFlag": "assets/icons/SE.png", + "status": "Completed", + "projectStatus": "Self Control" + } + ], + "tendersSubmitted": [ + { + "date": "2025-05-21", + "title": "Lorem ipsum dolor sit amet consectetur. Sed mi tortor eu purus senectus.", + "description": "Lorem ipsum dolor sit amet consectetur. Volutpat velit tincidunt amet diam. Placerat congue ut Sed facilisis faucibus porttitor. Proin suspendisse eu euismod sit lorem quis.", + "location": "Sweden", + "countryFlag": "assets/icons/SE.png", + "status": "Won", + "projectStatus": "Self Control" + }, + { + "date": "2025-05-21", + "title": "Lorem ipsum dolor sit amet consectetur. Sed mi tortor eu purus senectus.", + "description": "Lorem ipsum dolor sit amet consectetur. Volutpat velit tincidunt amet diam. Placerat congue ut Sed facilisis faucibus porttitor.", + "location": "Thailand", + "countryFlag": "assets/icons/SE.png", + "status": "Reject", + "projectStatus": "Partner Ship" + }, + { + "date": "2025-05-21", + "title": "Lorem ipsum dolor sit amet consectetur.", + "description": "Lorem ipsum dolor sit amet consectetur. Volutpat facilisis faucibus porttitor. Proin suspendisse eu euismod sit lorem quis.", + "location": "Italy", + "countryFlag": "assets/icons/SE.png", + "status": "Won", + "projectStatus": "Self Control" + } + ] +} +'''; diff --git a/lib/data/services/model/home/home_request/home_request_model.freezed.dart b/lib/data/services/model/home/home_request/home_request_model.freezed.dart index fcf8014..934cc65 100644 --- a/lib/data/services/model/home/home_request/home_request_model.freezed.dart +++ b/lib/data/services/model/home/home_request/home_request_model.freezed.dart @@ -1,5 +1,5 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,269 +9,165 @@ part of 'home_request_model.dart'; // FreezedGenerator // ************************************************************************** -// dart format off T _$identity(T value) => value; +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +HomeRequestModel _$HomeRequestModelFromJson(Map json) { + return _HomeRequestModel.fromJson(json); +} + /// @nodoc mixin _$HomeRequestModel { - - String get id; -/// Create a copy of HomeRequestModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$HomeRequestModelCopyWith get copyWith => _$HomeRequestModelCopyWithImpl(this as HomeRequestModel, _$identity); + String get id => throw _privateConstructorUsedError; /// Serializes this HomeRequestModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is HomeRequestModel&&(identical(other.id, id) || other.id == id)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id); - -@override -String toString() { - return 'HomeRequestModel(id: $id)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of HomeRequestModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $HomeRequestModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $HomeRequestModelCopyWith<$Res> { - factory $HomeRequestModelCopyWith(HomeRequestModel value, $Res Function(HomeRequestModel) _then) = _$HomeRequestModelCopyWithImpl; -@useResult -$Res call({ - String id -}); - - - - +abstract class $HomeRequestModelCopyWith<$Res> { + factory $HomeRequestModelCopyWith( + HomeRequestModel value, + $Res Function(HomeRequestModel) then, + ) = _$HomeRequestModelCopyWithImpl<$Res, HomeRequestModel>; + @useResult + $Res call({String id}); } + /// @nodoc -class _$HomeRequestModelCopyWithImpl<$Res> +class _$HomeRequestModelCopyWithImpl<$Res, $Val extends HomeRequestModel> implements $HomeRequestModelCopyWith<$Res> { - _$HomeRequestModelCopyWithImpl(this._self, this._then); + _$HomeRequestModelCopyWithImpl(this._value, this._then); - final HomeRequestModel _self; - final $Res Function(HomeRequestModel) _then; + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; -/// Create a copy of HomeRequestModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,}) { - return _then(_self.copyWith( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String, - )); + /// Create a copy of HomeRequestModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? id = null}) { + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } } +/// @nodoc +abstract class _$$HomeRequestModelImplCopyWith<$Res> + implements $HomeRequestModelCopyWith<$Res> { + factory _$$HomeRequestModelImplCopyWith( + _$HomeRequestModelImpl value, + $Res Function(_$HomeRequestModelImpl) then, + ) = __$$HomeRequestModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String id}); } +/// @nodoc +class __$$HomeRequestModelImplCopyWithImpl<$Res> + extends _$HomeRequestModelCopyWithImpl<$Res, _$HomeRequestModelImpl> + implements _$$HomeRequestModelImplCopyWith<$Res> { + __$$HomeRequestModelImplCopyWithImpl( + _$HomeRequestModelImpl _value, + $Res Function(_$HomeRequestModelImpl) _then, + ) : super(_value, _then); -/// Adds pattern-matching-related methods to [HomeRequestModel]. -extension HomeRequestModelPatterns on HomeRequestModel { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _HomeRequestModel value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _HomeRequestModel() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _HomeRequestModel value) $default,){ -final _that = this; -switch (_that) { -case _HomeRequestModel(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _HomeRequestModel value)? $default,){ -final _that = this; -switch (_that) { -case _HomeRequestModel() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String id)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _HomeRequestModel() when $default != null: -return $default(_that.id);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String id) $default,) {final _that = this; -switch (_that) { -case _HomeRequestModel(): -return $default(_that.id);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id)? $default,) {final _that = this; -switch (_that) { -case _HomeRequestModel() when $default != null: -return $default(_that.id);case _: - return null; - -} -} - + /// Create a copy of HomeRequestModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? id = null}) { + return _then( + _$HomeRequestModelImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$HomeRequestModelImpl implements _HomeRequestModel { + const _$HomeRequestModelImpl({required this.id}); -class _HomeRequestModel implements HomeRequestModel { - const _HomeRequestModel({required this.id}); - factory _HomeRequestModel.fromJson(Map json) => _$HomeRequestModelFromJson(json); + factory _$HomeRequestModelImpl.fromJson(Map json) => + _$$HomeRequestModelImplFromJson(json); -@override final String id; + @override + final String id; -/// Create a copy of HomeRequestModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$HomeRequestModelCopyWith<_HomeRequestModel> get copyWith => __$HomeRequestModelCopyWithImpl<_HomeRequestModel>(this, _$identity); + @override + String toString() { + return 'HomeRequestModel(id: $id)'; + } -@override -Map toJson() { - return _$HomeRequestModelToJson(this, ); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$HomeRequestModelImpl && + (identical(other.id, id) || other.id == id)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, id); + + /// Create a copy of HomeRequestModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$HomeRequestModelImplCopyWith<_$HomeRequestModelImpl> get copyWith => + __$$HomeRequestModelImplCopyWithImpl<_$HomeRequestModelImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$HomeRequestModelImplToJson(this); + } } -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _HomeRequestModel&&(identical(other.id, id) || other.id == id)); +abstract class _HomeRequestModel implements HomeRequestModel { + const factory _HomeRequestModel({required final String id}) = + _$HomeRequestModelImpl; + + factory _HomeRequestModel.fromJson(Map json) = + _$HomeRequestModelImpl.fromJson; + + @override + String get id; + + /// Create a copy of HomeRequestModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$HomeRequestModelImplCopyWith<_$HomeRequestModelImpl> get copyWith => + throw _privateConstructorUsedError; } - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id); - -@override -String toString() { - return 'HomeRequestModel(id: $id)'; -} - - -} - -/// @nodoc -abstract mixin class _$HomeRequestModelCopyWith<$Res> implements $HomeRequestModelCopyWith<$Res> { - factory _$HomeRequestModelCopyWith(_HomeRequestModel value, $Res Function(_HomeRequestModel) _then) = __$HomeRequestModelCopyWithImpl; -@override @useResult -$Res call({ - String id -}); - - - - -} -/// @nodoc -class __$HomeRequestModelCopyWithImpl<$Res> - implements _$HomeRequestModelCopyWith<$Res> { - __$HomeRequestModelCopyWithImpl(this._self, this._then); - - final _HomeRequestModel _self; - final $Res Function(_HomeRequestModel) _then; - -/// Create a copy of HomeRequestModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,}) { - return _then(_HomeRequestModel( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - -} - -// dart format on diff --git a/lib/data/services/model/home/home_request/home_request_model.g.dart b/lib/data/services/model/home/home_request/home_request_model.g.dart index 56f28e1..6f59972 100644 --- a/lib/data/services/model/home/home_request/home_request_model.g.dart +++ b/lib/data/services/model/home/home_request/home_request_model.g.dart @@ -6,8 +6,10 @@ part of 'home_request_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_HomeRequestModel _$HomeRequestModelFromJson(Map json) => - _HomeRequestModel(id: json['id'] as String); +_$HomeRequestModelImpl _$$HomeRequestModelImplFromJson( + Map json, +) => _$HomeRequestModelImpl(id: json['id'] as String); -Map _$HomeRequestModelToJson(_HomeRequestModel instance) => - {'id': instance.id}; +Map _$$HomeRequestModelImplToJson( + _$HomeRequestModelImpl instance, +) => {'id': instance.id}; diff --git a/lib/data/services/model/home/home_response/home_response_model.freezed.dart b/lib/data/services/model/home/home_response/home_response_model.freezed.dart index b9978d6..da3f4fb 100644 --- a/lib/data/services/model/home/home_response/home_response_model.freezed.dart +++ b/lib/data/services/model/home/home_response/home_response_model.freezed.dart @@ -1,5 +1,5 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,298 +9,377 @@ part of 'home_response_model.dart'; // FreezedGenerator // ************************************************************************** -// dart format off T _$identity(T value) => value; +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +HomeResponseModel _$HomeResponseModelFromJson(Map json) { + return _HomeResponseModel.fromJson(json); +} + /// @nodoc mixin _$HomeResponseModel { - - String? get partnership;@JsonKey(name: 'self_apply') String? get selfApply; String? get contracting;@JsonKey(name: 'tender_submitted') String? get tenderSubmitted;@JsonKey(name: 'approved_tenders') String? get approvedTenders;@JsonKey(name: 'tender_value') String? get tenderValue;@JsonKey(name: 'thunder_status') String? get thunderStatus;@JsonKey(name: 'your_tenders') List? get yourTenders; -/// Create a copy of HomeResponseModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$HomeResponseModelCopyWith get copyWith => _$HomeResponseModelCopyWithImpl(this as HomeResponseModel, _$identity); + String? get partnership => throw _privateConstructorUsedError; + @JsonKey(name: 'self_apply') + String? get selfApply => throw _privateConstructorUsedError; + String? get contracting => throw _privateConstructorUsedError; + @JsonKey(name: 'tender_submitted') + String? get tenderSubmitted => throw _privateConstructorUsedError; + @JsonKey(name: 'approved_tenders') + String? get approvedTenders => throw _privateConstructorUsedError; + @JsonKey(name: 'tender_value') + String? get tenderValue => throw _privateConstructorUsedError; + @JsonKey(name: 'thunder_status') + String? get thunderStatus => throw _privateConstructorUsedError; + @JsonKey(name: 'your_tenders') + List? get yourTenders => throw _privateConstructorUsedError; /// Serializes this HomeResponseModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is HomeResponseModel&&(identical(other.partnership, partnership) || other.partnership == partnership)&&(identical(other.selfApply, selfApply) || other.selfApply == selfApply)&&(identical(other.contracting, contracting) || other.contracting == contracting)&&(identical(other.tenderSubmitted, tenderSubmitted) || other.tenderSubmitted == tenderSubmitted)&&(identical(other.approvedTenders, approvedTenders) || other.approvedTenders == approvedTenders)&&(identical(other.tenderValue, tenderValue) || other.tenderValue == tenderValue)&&(identical(other.thunderStatus, thunderStatus) || other.thunderStatus == thunderStatus)&&const DeepCollectionEquality().equals(other.yourTenders, yourTenders)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,partnership,selfApply,contracting,tenderSubmitted,approvedTenders,tenderValue,thunderStatus,const DeepCollectionEquality().hash(yourTenders)); - -@override -String toString() { - return 'HomeResponseModel(partnership: $partnership, selfApply: $selfApply, contracting: $contracting, tenderSubmitted: $tenderSubmitted, approvedTenders: $approvedTenders, tenderValue: $tenderValue, thunderStatus: $thunderStatus, yourTenders: $yourTenders)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of HomeResponseModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $HomeResponseModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $HomeResponseModelCopyWith<$Res> { - factory $HomeResponseModelCopyWith(HomeResponseModel value, $Res Function(HomeResponseModel) _then) = _$HomeResponseModelCopyWithImpl; -@useResult -$Res call({ - String? partnership,@JsonKey(name: 'self_apply') String? selfApply, String? contracting,@JsonKey(name: 'tender_submitted') String? tenderSubmitted,@JsonKey(name: 'approved_tenders') String? approvedTenders,@JsonKey(name: 'tender_value') String? tenderValue,@JsonKey(name: 'thunder_status') String? thunderStatus,@JsonKey(name: 'your_tenders') List? yourTenders -}); - - - - +abstract class $HomeResponseModelCopyWith<$Res> { + factory $HomeResponseModelCopyWith( + HomeResponseModel value, + $Res Function(HomeResponseModel) then, + ) = _$HomeResponseModelCopyWithImpl<$Res, HomeResponseModel>; + @useResult + $Res call({ + String? partnership, + @JsonKey(name: 'self_apply') String? selfApply, + String? contracting, + @JsonKey(name: 'tender_submitted') String? tenderSubmitted, + @JsonKey(name: 'approved_tenders') String? approvedTenders, + @JsonKey(name: 'tender_value') String? tenderValue, + @JsonKey(name: 'thunder_status') String? thunderStatus, + @JsonKey(name: 'your_tenders') List? yourTenders, + }); } + /// @nodoc -class _$HomeResponseModelCopyWithImpl<$Res> +class _$HomeResponseModelCopyWithImpl<$Res, $Val extends HomeResponseModel> implements $HomeResponseModelCopyWith<$Res> { - _$HomeResponseModelCopyWithImpl(this._self, this._then); + _$HomeResponseModelCopyWithImpl(this._value, this._then); - final HomeResponseModel _self; - final $Res Function(HomeResponseModel) _then; + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; -/// Create a copy of HomeResponseModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? partnership = freezed,Object? selfApply = freezed,Object? contracting = freezed,Object? tenderSubmitted = freezed,Object? approvedTenders = freezed,Object? tenderValue = freezed,Object? thunderStatus = freezed,Object? yourTenders = freezed,}) { - return _then(_self.copyWith( -partnership: freezed == partnership ? _self.partnership : partnership // ignore: cast_nullable_to_non_nullable -as String?,selfApply: freezed == selfApply ? _self.selfApply : selfApply // ignore: cast_nullable_to_non_nullable -as String?,contracting: freezed == contracting ? _self.contracting : contracting // ignore: cast_nullable_to_non_nullable -as String?,tenderSubmitted: freezed == tenderSubmitted ? _self.tenderSubmitted : tenderSubmitted // ignore: cast_nullable_to_non_nullable -as String?,approvedTenders: freezed == approvedTenders ? _self.approvedTenders : approvedTenders // ignore: cast_nullable_to_non_nullable -as String?,tenderValue: freezed == tenderValue ? _self.tenderValue : tenderValue // ignore: cast_nullable_to_non_nullable -as String?,thunderStatus: freezed == thunderStatus ? _self.thunderStatus : thunderStatus // ignore: cast_nullable_to_non_nullable -as String?,yourTenders: freezed == yourTenders ? _self.yourTenders : yourTenders // ignore: cast_nullable_to_non_nullable -as List?, - )); + /// Create a copy of HomeResponseModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? partnership = freezed, + Object? selfApply = freezed, + Object? contracting = freezed, + Object? tenderSubmitted = freezed, + Object? approvedTenders = freezed, + Object? tenderValue = freezed, + Object? thunderStatus = freezed, + Object? yourTenders = freezed, + }) { + return _then( + _value.copyWith( + partnership: + freezed == partnership + ? _value.partnership + : partnership // ignore: cast_nullable_to_non_nullable + as String?, + selfApply: + freezed == selfApply + ? _value.selfApply + : selfApply // ignore: cast_nullable_to_non_nullable + as String?, + contracting: + freezed == contracting + ? _value.contracting + : contracting // ignore: cast_nullable_to_non_nullable + as String?, + tenderSubmitted: + freezed == tenderSubmitted + ? _value.tenderSubmitted + : tenderSubmitted // ignore: cast_nullable_to_non_nullable + as String?, + approvedTenders: + freezed == approvedTenders + ? _value.approvedTenders + : approvedTenders // ignore: cast_nullable_to_non_nullable + as String?, + tenderValue: + freezed == tenderValue + ? _value.tenderValue + : tenderValue // ignore: cast_nullable_to_non_nullable + as String?, + thunderStatus: + freezed == thunderStatus + ? _value.thunderStatus + : thunderStatus // ignore: cast_nullable_to_non_nullable + as String?, + yourTenders: + freezed == yourTenders + ? _value.yourTenders + : yourTenders // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); + } } +/// @nodoc +abstract class _$$HomeResponseModelImplCopyWith<$Res> + implements $HomeResponseModelCopyWith<$Res> { + factory _$$HomeResponseModelImplCopyWith( + _$HomeResponseModelImpl value, + $Res Function(_$HomeResponseModelImpl) then, + ) = __$$HomeResponseModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String? partnership, + @JsonKey(name: 'self_apply') String? selfApply, + String? contracting, + @JsonKey(name: 'tender_submitted') String? tenderSubmitted, + @JsonKey(name: 'approved_tenders') String? approvedTenders, + @JsonKey(name: 'tender_value') String? tenderValue, + @JsonKey(name: 'thunder_status') String? thunderStatus, + @JsonKey(name: 'your_tenders') List? yourTenders, + }); } +/// @nodoc +class __$$HomeResponseModelImplCopyWithImpl<$Res> + extends _$HomeResponseModelCopyWithImpl<$Res, _$HomeResponseModelImpl> + implements _$$HomeResponseModelImplCopyWith<$Res> { + __$$HomeResponseModelImplCopyWithImpl( + _$HomeResponseModelImpl _value, + $Res Function(_$HomeResponseModelImpl) _then, + ) : super(_value, _then); -/// Adds pattern-matching-related methods to [HomeResponseModel]. -extension HomeResponseModelPatterns on HomeResponseModel { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _HomeResponseModel value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _HomeResponseModel() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _HomeResponseModel value) $default,){ -final _that = this; -switch (_that) { -case _HomeResponseModel(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _HomeResponseModel value)? $default,){ -final _that = this; -switch (_that) { -case _HomeResponseModel() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String? partnership, @JsonKey(name: 'self_apply') String? selfApply, String? contracting, @JsonKey(name: 'tender_submitted') String? tenderSubmitted, @JsonKey(name: 'approved_tenders') String? approvedTenders, @JsonKey(name: 'tender_value') String? tenderValue, @JsonKey(name: 'thunder_status') String? thunderStatus, @JsonKey(name: 'your_tenders') List? yourTenders)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _HomeResponseModel() when $default != null: -return $default(_that.partnership,_that.selfApply,_that.contracting,_that.tenderSubmitted,_that.approvedTenders,_that.tenderValue,_that.thunderStatus,_that.yourTenders);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String? partnership, @JsonKey(name: 'self_apply') String? selfApply, String? contracting, @JsonKey(name: 'tender_submitted') String? tenderSubmitted, @JsonKey(name: 'approved_tenders') String? approvedTenders, @JsonKey(name: 'tender_value') String? tenderValue, @JsonKey(name: 'thunder_status') String? thunderStatus, @JsonKey(name: 'your_tenders') List? yourTenders) $default,) {final _that = this; -switch (_that) { -case _HomeResponseModel(): -return $default(_that.partnership,_that.selfApply,_that.contracting,_that.tenderSubmitted,_that.approvedTenders,_that.tenderValue,_that.thunderStatus,_that.yourTenders);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? partnership, @JsonKey(name: 'self_apply') String? selfApply, String? contracting, @JsonKey(name: 'tender_submitted') String? tenderSubmitted, @JsonKey(name: 'approved_tenders') String? approvedTenders, @JsonKey(name: 'tender_value') String? tenderValue, @JsonKey(name: 'thunder_status') String? thunderStatus, @JsonKey(name: 'your_tenders') List? yourTenders)? $default,) {final _that = this; -switch (_that) { -case _HomeResponseModel() when $default != null: -return $default(_that.partnership,_that.selfApply,_that.contracting,_that.tenderSubmitted,_that.approvedTenders,_that.tenderValue,_that.thunderStatus,_that.yourTenders);case _: - return null; - -} -} - + /// Create a copy of HomeResponseModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? partnership = freezed, + Object? selfApply = freezed, + Object? contracting = freezed, + Object? tenderSubmitted = freezed, + Object? approvedTenders = freezed, + Object? tenderValue = freezed, + Object? thunderStatus = freezed, + Object? yourTenders = freezed, + }) { + return _then( + _$HomeResponseModelImpl( + partnership: + freezed == partnership + ? _value.partnership + : partnership // ignore: cast_nullable_to_non_nullable + as String?, + selfApply: + freezed == selfApply + ? _value.selfApply + : selfApply // ignore: cast_nullable_to_non_nullable + as String?, + contracting: + freezed == contracting + ? _value.contracting + : contracting // ignore: cast_nullable_to_non_nullable + as String?, + tenderSubmitted: + freezed == tenderSubmitted + ? _value.tenderSubmitted + : tenderSubmitted // ignore: cast_nullable_to_non_nullable + as String?, + approvedTenders: + freezed == approvedTenders + ? _value.approvedTenders + : approvedTenders // ignore: cast_nullable_to_non_nullable + as String?, + tenderValue: + freezed == tenderValue + ? _value.tenderValue + : tenderValue // ignore: cast_nullable_to_non_nullable + as String?, + thunderStatus: + freezed == thunderStatus + ? _value.thunderStatus + : thunderStatus // ignore: cast_nullable_to_non_nullable + as String?, + yourTenders: + freezed == yourTenders + ? _value._yourTenders + : yourTenders // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$HomeResponseModelImpl implements _HomeResponseModel { + const _$HomeResponseModelImpl({ + required this.partnership, + @JsonKey(name: 'self_apply') required this.selfApply, + required this.contracting, + @JsonKey(name: 'tender_submitted') required this.tenderSubmitted, + @JsonKey(name: 'approved_tenders') required this.approvedTenders, + @JsonKey(name: 'tender_value') required this.tenderValue, + @JsonKey(name: 'thunder_status') required this.thunderStatus, + @JsonKey(name: 'your_tenders') + required final List? yourTenders, + }) : _yourTenders = yourTenders; -class _HomeResponseModel implements HomeResponseModel { - const _HomeResponseModel({required this.partnership, @JsonKey(name: 'self_apply') required this.selfApply, required this.contracting, @JsonKey(name: 'tender_submitted') required this.tenderSubmitted, @JsonKey(name: 'approved_tenders') required this.approvedTenders, @JsonKey(name: 'tender_value') required this.tenderValue, @JsonKey(name: 'thunder_status') required this.thunderStatus, @JsonKey(name: 'your_tenders') required final List? yourTenders}): _yourTenders = yourTenders; - factory _HomeResponseModel.fromJson(Map json) => _$HomeResponseModelFromJson(json); + factory _$HomeResponseModelImpl.fromJson(Map json) => + _$$HomeResponseModelImplFromJson(json); -@override final String? partnership; -@override@JsonKey(name: 'self_apply') final String? selfApply; -@override final String? contracting; -@override@JsonKey(name: 'tender_submitted') final String? tenderSubmitted; -@override@JsonKey(name: 'approved_tenders') final String? approvedTenders; -@override@JsonKey(name: 'tender_value') final String? tenderValue; -@override@JsonKey(name: 'thunder_status') final String? thunderStatus; - final List? _yourTenders; -@override@JsonKey(name: 'your_tenders') List? get yourTenders { - final value = _yourTenders; - if (value == null) return null; - if (_yourTenders is EqualUnmodifiableListView) return _yourTenders; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); + @override + final String? partnership; + @override + @JsonKey(name: 'self_apply') + final String? selfApply; + @override + final String? contracting; + @override + @JsonKey(name: 'tender_submitted') + final String? tenderSubmitted; + @override + @JsonKey(name: 'approved_tenders') + final String? approvedTenders; + @override + @JsonKey(name: 'tender_value') + final String? tenderValue; + @override + @JsonKey(name: 'thunder_status') + final String? thunderStatus; + final List? _yourTenders; + @override + @JsonKey(name: 'your_tenders') + List? get yourTenders { + final value = _yourTenders; + if (value == null) return null; + if (_yourTenders is EqualUnmodifiableListView) return _yourTenders; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } + + @override + String toString() { + return 'HomeResponseModel(partnership: $partnership, selfApply: $selfApply, contracting: $contracting, tenderSubmitted: $tenderSubmitted, approvedTenders: $approvedTenders, tenderValue: $tenderValue, thunderStatus: $thunderStatus, yourTenders: $yourTenders)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$HomeResponseModelImpl && + (identical(other.partnership, partnership) || + other.partnership == partnership) && + (identical(other.selfApply, selfApply) || + other.selfApply == selfApply) && + (identical(other.contracting, contracting) || + other.contracting == contracting) && + (identical(other.tenderSubmitted, tenderSubmitted) || + other.tenderSubmitted == tenderSubmitted) && + (identical(other.approvedTenders, approvedTenders) || + other.approvedTenders == approvedTenders) && + (identical(other.tenderValue, tenderValue) || + other.tenderValue == tenderValue) && + (identical(other.thunderStatus, thunderStatus) || + other.thunderStatus == thunderStatus) && + const DeepCollectionEquality().equals( + other._yourTenders, + _yourTenders, + )); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + partnership, + selfApply, + contracting, + tenderSubmitted, + approvedTenders, + tenderValue, + thunderStatus, + const DeepCollectionEquality().hash(_yourTenders), + ); + + /// Create a copy of HomeResponseModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$HomeResponseModelImplCopyWith<_$HomeResponseModelImpl> get copyWith => + __$$HomeResponseModelImplCopyWithImpl<_$HomeResponseModelImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$HomeResponseModelImplToJson(this); + } } +abstract class _HomeResponseModel implements HomeResponseModel { + const factory _HomeResponseModel({ + required final String? partnership, + @JsonKey(name: 'self_apply') required final String? selfApply, + required final String? contracting, + @JsonKey(name: 'tender_submitted') required final String? tenderSubmitted, + @JsonKey(name: 'approved_tenders') required final String? approvedTenders, + @JsonKey(name: 'tender_value') required final String? tenderValue, + @JsonKey(name: 'thunder_status') required final String? thunderStatus, + @JsonKey(name: 'your_tenders') + required final List? yourTenders, + }) = _$HomeResponseModelImpl; -/// Create a copy of HomeResponseModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$HomeResponseModelCopyWith<_HomeResponseModel> get copyWith => __$HomeResponseModelCopyWithImpl<_HomeResponseModel>(this, _$identity); + factory _HomeResponseModel.fromJson(Map json) = + _$HomeResponseModelImpl.fromJson; -@override -Map toJson() { - return _$HomeResponseModelToJson(this, ); + @override + String? get partnership; + @override + @JsonKey(name: 'self_apply') + String? get selfApply; + @override + String? get contracting; + @override + @JsonKey(name: 'tender_submitted') + String? get tenderSubmitted; + @override + @JsonKey(name: 'approved_tenders') + String? get approvedTenders; + @override + @JsonKey(name: 'tender_value') + String? get tenderValue; + @override + @JsonKey(name: 'thunder_status') + String? get thunderStatus; + @override + @JsonKey(name: 'your_tenders') + List? get yourTenders; + + /// Create a copy of HomeResponseModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$HomeResponseModelImplCopyWith<_$HomeResponseModelImpl> get copyWith => + throw _privateConstructorUsedError; } - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _HomeResponseModel&&(identical(other.partnership, partnership) || other.partnership == partnership)&&(identical(other.selfApply, selfApply) || other.selfApply == selfApply)&&(identical(other.contracting, contracting) || other.contracting == contracting)&&(identical(other.tenderSubmitted, tenderSubmitted) || other.tenderSubmitted == tenderSubmitted)&&(identical(other.approvedTenders, approvedTenders) || other.approvedTenders == approvedTenders)&&(identical(other.tenderValue, tenderValue) || other.tenderValue == tenderValue)&&(identical(other.thunderStatus, thunderStatus) || other.thunderStatus == thunderStatus)&&const DeepCollectionEquality().equals(other._yourTenders, _yourTenders)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,partnership,selfApply,contracting,tenderSubmitted,approvedTenders,tenderValue,thunderStatus,const DeepCollectionEquality().hash(_yourTenders)); - -@override -String toString() { - return 'HomeResponseModel(partnership: $partnership, selfApply: $selfApply, contracting: $contracting, tenderSubmitted: $tenderSubmitted, approvedTenders: $approvedTenders, tenderValue: $tenderValue, thunderStatus: $thunderStatus, yourTenders: $yourTenders)'; -} - - -} - -/// @nodoc -abstract mixin class _$HomeResponseModelCopyWith<$Res> implements $HomeResponseModelCopyWith<$Res> { - factory _$HomeResponseModelCopyWith(_HomeResponseModel value, $Res Function(_HomeResponseModel) _then) = __$HomeResponseModelCopyWithImpl; -@override @useResult -$Res call({ - String? partnership,@JsonKey(name: 'self_apply') String? selfApply, String? contracting,@JsonKey(name: 'tender_submitted') String? tenderSubmitted,@JsonKey(name: 'approved_tenders') String? approvedTenders,@JsonKey(name: 'tender_value') String? tenderValue,@JsonKey(name: 'thunder_status') String? thunderStatus,@JsonKey(name: 'your_tenders') List? yourTenders -}); - - - - -} -/// @nodoc -class __$HomeResponseModelCopyWithImpl<$Res> - implements _$HomeResponseModelCopyWith<$Res> { - __$HomeResponseModelCopyWithImpl(this._self, this._then); - - final _HomeResponseModel _self; - final $Res Function(_HomeResponseModel) _then; - -/// Create a copy of HomeResponseModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? partnership = freezed,Object? selfApply = freezed,Object? contracting = freezed,Object? tenderSubmitted = freezed,Object? approvedTenders = freezed,Object? tenderValue = freezed,Object? thunderStatus = freezed,Object? yourTenders = freezed,}) { - return _then(_HomeResponseModel( -partnership: freezed == partnership ? _self.partnership : partnership // ignore: cast_nullable_to_non_nullable -as String?,selfApply: freezed == selfApply ? _self.selfApply : selfApply // ignore: cast_nullable_to_non_nullable -as String?,contracting: freezed == contracting ? _self.contracting : contracting // ignore: cast_nullable_to_non_nullable -as String?,tenderSubmitted: freezed == tenderSubmitted ? _self.tenderSubmitted : tenderSubmitted // ignore: cast_nullable_to_non_nullable -as String?,approvedTenders: freezed == approvedTenders ? _self.approvedTenders : approvedTenders // ignore: cast_nullable_to_non_nullable -as String?,tenderValue: freezed == tenderValue ? _self.tenderValue : tenderValue // ignore: cast_nullable_to_non_nullable -as String?,thunderStatus: freezed == thunderStatus ? _self.thunderStatus : thunderStatus // ignore: cast_nullable_to_non_nullable -as String?,yourTenders: freezed == yourTenders ? _self._yourTenders : yourTenders // ignore: cast_nullable_to_non_nullable -as List?, - )); -} - - -} - -// dart format on diff --git a/lib/data/services/model/home/home_response/home_response_model.g.dart b/lib/data/services/model/home/home_response/home_response_model.g.dart index fa6d441..a53cada 100644 --- a/lib/data/services/model/home/home_response/home_response_model.g.dart +++ b/lib/data/services/model/home/home_response/home_response_model.g.dart @@ -6,29 +6,31 @@ part of 'home_response_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_HomeResponseModel _$HomeResponseModelFromJson(Map json) => - _HomeResponseModel( - partnership: json['partnership'] as String?, - selfApply: json['self_apply'] as String?, - contracting: json['contracting'] as String?, - tenderSubmitted: json['tender_submitted'] as String?, - approvedTenders: json['approved_tenders'] as String?, - tenderValue: json['tender_value'] as String?, - thunderStatus: json['thunder_status'] as String?, - yourTenders: - (json['your_tenders'] as List?) - ?.map((e) => TenderModel.fromJson(e as Map)) - .toList(), - ); +_$HomeResponseModelImpl _$$HomeResponseModelImplFromJson( + Map json, +) => _$HomeResponseModelImpl( + partnership: json['partnership'] as String?, + selfApply: json['self_apply'] as String?, + contracting: json['contracting'] as String?, + tenderSubmitted: json['tender_submitted'] as String?, + approvedTenders: json['approved_tenders'] as String?, + tenderValue: json['tender_value'] as String?, + thunderStatus: json['thunder_status'] as String?, + yourTenders: + (json['your_tenders'] as List?) + ?.map((e) => TenderModel.fromJson(e as Map)) + .toList(), +); -Map _$HomeResponseModelToJson(_HomeResponseModel instance) => - { - 'partnership': instance.partnership, - 'self_apply': instance.selfApply, - 'contracting': instance.contracting, - 'tender_submitted': instance.tenderSubmitted, - 'approved_tenders': instance.approvedTenders, - 'tender_value': instance.tenderValue, - 'thunder_status': instance.thunderStatus, - 'your_tenders': instance.yourTenders, - }; +Map _$$HomeResponseModelImplToJson( + _$HomeResponseModelImpl instance, +) => { + 'partnership': instance.partnership, + 'self_apply': instance.selfApply, + 'contracting': instance.contracting, + 'tender_submitted': instance.tenderSubmitted, + 'approved_tenders': instance.approvedTenders, + 'tender_value': instance.tenderValue, + 'thunder_status': instance.thunderStatus, + 'your_tenders': instance.yourTenders, +}; diff --git a/lib/data/services/model/home/tender/tender_model.freezed.dart b/lib/data/services/model/home/tender/tender_model.freezed.dart index 08a0c2d..beeef8d 100644 --- a/lib/data/services/model/home/tender/tender_model.freezed.dart +++ b/lib/data/services/model/home/tender/tender_model.freezed.dart @@ -1,5 +1,5 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,287 +9,324 @@ part of 'tender_model.dart'; // FreezedGenerator // ************************************************************************** -// dart format off T _$identity(T value) => value; +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +TenderModel _$TenderModelFromJson(Map json) { + return _TenderModel.fromJson(json); +} + /// @nodoc mixin _$TenderModel { - -@JsonKey(name: 'created_time') String? get createdTime;@JsonKey(name: 'tender_id') String? get tenderId; String? get status; String? get title; String? get description; String? get location; String? get type; -/// Create a copy of TenderModel -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$TenderModelCopyWith get copyWith => _$TenderModelCopyWithImpl(this as TenderModel, _$identity); + @JsonKey(name: 'created_time') + String? get createdTime => throw _privateConstructorUsedError; + @JsonKey(name: 'tender_id') + String? get tenderId => throw _privateConstructorUsedError; + String? get status => throw _privateConstructorUsedError; + String? get title => throw _privateConstructorUsedError; + String? get description => throw _privateConstructorUsedError; + String? get location => throw _privateConstructorUsedError; + String? get type => throw _privateConstructorUsedError; /// Serializes this TenderModel to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderModel&&(identical(other.createdTime, createdTime) || other.createdTime == createdTime)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.status, status) || other.status == status)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.location, location) || other.location == location)&&(identical(other.type, type) || other.type == type)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,createdTime,tenderId,status,title,description,location,type); - -@override -String toString() { - return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of TenderModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $TenderModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $TenderModelCopyWith<$Res> { - factory $TenderModelCopyWith(TenderModel value, $Res Function(TenderModel) _then) = _$TenderModelCopyWithImpl; -@useResult -$Res call({ -@JsonKey(name: 'created_time') String? createdTime,@JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type -}); - - - - +abstract class $TenderModelCopyWith<$Res> { + factory $TenderModelCopyWith( + TenderModel value, + $Res Function(TenderModel) then, + ) = _$TenderModelCopyWithImpl<$Res, TenderModel>; + @useResult + $Res call({ + @JsonKey(name: 'created_time') String? createdTime, + @JsonKey(name: 'tender_id') String? tenderId, + String? status, + String? title, + String? description, + String? location, + String? type, + }); } + /// @nodoc -class _$TenderModelCopyWithImpl<$Res> +class _$TenderModelCopyWithImpl<$Res, $Val extends TenderModel> implements $TenderModelCopyWith<$Res> { - _$TenderModelCopyWithImpl(this._self, this._then); + _$TenderModelCopyWithImpl(this._value, this._then); - final TenderModel _self; - final $Res Function(TenderModel) _then; + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; -/// Create a copy of TenderModel -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? createdTime = freezed,Object? tenderId = freezed,Object? status = freezed,Object? title = freezed,Object? description = freezed,Object? location = freezed,Object? type = freezed,}) { - return _then(_self.copyWith( -createdTime: freezed == createdTime ? _self.createdTime : createdTime // ignore: cast_nullable_to_non_nullable -as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable -as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable -as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable -as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String?,location: freezed == location ? _self.location : location // ignore: cast_nullable_to_non_nullable -as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable -as String?, - )); + /// Create a copy of TenderModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? createdTime = freezed, + Object? tenderId = freezed, + Object? status = freezed, + Object? title = freezed, + Object? description = freezed, + Object? location = freezed, + Object? type = freezed, + }) { + return _then( + _value.copyWith( + createdTime: + freezed == createdTime + ? _value.createdTime + : createdTime // ignore: cast_nullable_to_non_nullable + as String?, + tenderId: + freezed == tenderId + ? _value.tenderId + : tenderId // ignore: cast_nullable_to_non_nullable + as String?, + status: + freezed == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String?, + title: + freezed == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String?, + description: + freezed == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String?, + location: + freezed == location + ? _value.location + : location // ignore: cast_nullable_to_non_nullable + as String?, + type: + freezed == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); + } } +/// @nodoc +abstract class _$$TenderModelImplCopyWith<$Res> + implements $TenderModelCopyWith<$Res> { + factory _$$TenderModelImplCopyWith( + _$TenderModelImpl value, + $Res Function(_$TenderModelImpl) then, + ) = __$$TenderModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'created_time') String? createdTime, + @JsonKey(name: 'tender_id') String? tenderId, + String? status, + String? title, + String? description, + String? location, + String? type, + }); } +/// @nodoc +class __$$TenderModelImplCopyWithImpl<$Res> + extends _$TenderModelCopyWithImpl<$Res, _$TenderModelImpl> + implements _$$TenderModelImplCopyWith<$Res> { + __$$TenderModelImplCopyWithImpl( + _$TenderModelImpl _value, + $Res Function(_$TenderModelImpl) _then, + ) : super(_value, _then); -/// Adds pattern-matching-related methods to [TenderModel]. -extension TenderModelPatterns on TenderModel { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _TenderModel value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _TenderModel() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _TenderModel value) $default,){ -final _that = this; -switch (_that) { -case _TenderModel(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _TenderModel value)? $default,){ -final _that = this; -switch (_that) { -case _TenderModel() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _TenderModel() when $default != null: -return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type) $default,) {final _that = this; -switch (_that) { -case _TenderModel(): -return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type)? $default,) {final _that = this; -switch (_that) { -case _TenderModel() when $default != null: -return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type);case _: - return null; - -} -} - + /// Create a copy of TenderModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? createdTime = freezed, + Object? tenderId = freezed, + Object? status = freezed, + Object? title = freezed, + Object? description = freezed, + Object? location = freezed, + Object? type = freezed, + }) { + return _then( + _$TenderModelImpl( + createdTime: + freezed == createdTime + ? _value.createdTime + : createdTime // ignore: cast_nullable_to_non_nullable + as String?, + tenderId: + freezed == tenderId + ? _value.tenderId + : tenderId // ignore: cast_nullable_to_non_nullable + as String?, + status: + freezed == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String?, + title: + freezed == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String?, + description: + freezed == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String?, + location: + freezed == location + ? _value.location + : location // ignore: cast_nullable_to_non_nullable + as String?, + type: + freezed == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$TenderModelImpl implements _TenderModel { + const _$TenderModelImpl({ + @JsonKey(name: 'created_time') required this.createdTime, + @JsonKey(name: 'tender_id') required this.tenderId, + required this.status, + required this.title, + required this.description, + required this.location, + required this.type, + }); -class _TenderModel implements TenderModel { - const _TenderModel({@JsonKey(name: 'created_time') required this.createdTime, @JsonKey(name: 'tender_id') required this.tenderId, required this.status, required this.title, required this.description, required this.location, required this.type}); - factory _TenderModel.fromJson(Map json) => _$TenderModelFromJson(json); + factory _$TenderModelImpl.fromJson(Map json) => + _$$TenderModelImplFromJson(json); -@override@JsonKey(name: 'created_time') final String? createdTime; -@override@JsonKey(name: 'tender_id') final String? tenderId; -@override final String? status; -@override final String? title; -@override final String? description; -@override final String? location; -@override final String? type; + @override + @JsonKey(name: 'created_time') + final String? createdTime; + @override + @JsonKey(name: 'tender_id') + final String? tenderId; + @override + final String? status; + @override + final String? title; + @override + final String? description; + @override + final String? location; + @override + final String? type; -/// Create a copy of TenderModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$TenderModelCopyWith<_TenderModel> get copyWith => __$TenderModelCopyWithImpl<_TenderModel>(this, _$identity); + @override + String toString() { + return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type)'; + } -@override -Map toJson() { - return _$TenderModelToJson(this, ); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$TenderModelImpl && + (identical(other.createdTime, createdTime) || + other.createdTime == createdTime) && + (identical(other.tenderId, tenderId) || + other.tenderId == tenderId) && + (identical(other.status, status) || other.status == status) && + (identical(other.title, title) || other.title == title) && + (identical(other.description, description) || + other.description == description) && + (identical(other.location, location) || + other.location == location) && + (identical(other.type, type) || other.type == type)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + createdTime, + tenderId, + status, + title, + description, + location, + type, + ); + + /// Create a copy of TenderModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$TenderModelImplCopyWith<_$TenderModelImpl> get copyWith => + __$$TenderModelImplCopyWithImpl<_$TenderModelImpl>(this, _$identity); + + @override + Map toJson() { + return _$$TenderModelImplToJson(this); + } } -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderModel&&(identical(other.createdTime, createdTime) || other.createdTime == createdTime)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.status, status) || other.status == status)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.location, location) || other.location == location)&&(identical(other.type, type) || other.type == type)); +abstract class _TenderModel implements TenderModel { + const factory _TenderModel({ + @JsonKey(name: 'created_time') required final String? createdTime, + @JsonKey(name: 'tender_id') required final String? tenderId, + required final String? status, + required final String? title, + required final String? description, + required final String? location, + required final String? type, + }) = _$TenderModelImpl; + + factory _TenderModel.fromJson(Map json) = + _$TenderModelImpl.fromJson; + + @override + @JsonKey(name: 'created_time') + String? get createdTime; + @override + @JsonKey(name: 'tender_id') + String? get tenderId; + @override + String? get status; + @override + String? get title; + @override + String? get description; + @override + String? get location; + @override + String? get type; + + /// Create a copy of TenderModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$TenderModelImplCopyWith<_$TenderModelImpl> get copyWith => + throw _privateConstructorUsedError; } - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,createdTime,tenderId,status,title,description,location,type); - -@override -String toString() { - return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type)'; -} - - -} - -/// @nodoc -abstract mixin class _$TenderModelCopyWith<$Res> implements $TenderModelCopyWith<$Res> { - factory _$TenderModelCopyWith(_TenderModel value, $Res Function(_TenderModel) _then) = __$TenderModelCopyWithImpl; -@override @useResult -$Res call({ -@JsonKey(name: 'created_time') String? createdTime,@JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type -}); - - - - -} -/// @nodoc -class __$TenderModelCopyWithImpl<$Res> - implements _$TenderModelCopyWith<$Res> { - __$TenderModelCopyWithImpl(this._self, this._then); - - final _TenderModel _self; - final $Res Function(_TenderModel) _then; - -/// Create a copy of TenderModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? createdTime = freezed,Object? tenderId = freezed,Object? status = freezed,Object? title = freezed,Object? description = freezed,Object? location = freezed,Object? type = freezed,}) { - return _then(_TenderModel( -createdTime: freezed == createdTime ? _self.createdTime : createdTime // ignore: cast_nullable_to_non_nullable -as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable -as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable -as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable -as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String?,location: freezed == location ? _self.location : location // ignore: cast_nullable_to_non_nullable -as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - - -} - -// dart format on diff --git a/lib/data/services/model/home/tender/tender_model.g.dart b/lib/data/services/model/home/tender/tender_model.g.dart index d2eb371..d213c95 100644 --- a/lib/data/services/model/home/tender/tender_model.g.dart +++ b/lib/data/services/model/home/tender/tender_model.g.dart @@ -6,17 +6,18 @@ part of 'tender_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_TenderModel _$TenderModelFromJson(Map json) => _TenderModel( - createdTime: json['created_time'] as String?, - tenderId: json['tender_id'] as String?, - status: json['status'] as String?, - title: json['title'] as String?, - description: json['description'] as String?, - location: json['location'] as String?, - type: json['type'] as String?, -); +_$TenderModelImpl _$$TenderModelImplFromJson(Map json) => + _$TenderModelImpl( + createdTime: json['created_time'] as String?, + tenderId: json['tender_id'] as String?, + status: json['status'] as String?, + title: json['title'] as String?, + description: json['description'] as String?, + location: json['location'] as String?, + type: json['type'] as String?, + ); -Map _$TenderModelToJson(_TenderModel instance) => +Map _$$TenderModelImplToJson(_$TenderModelImpl instance) => { 'created_time': instance.createdTime, 'tender_id': instance.tenderId, diff --git a/lib/data/services/model/tender_detail_request/tender_detail_request.freezed.dart b/lib/data/services/model/tender_detail_request/tender_detail_request.freezed.dart index 25106c6..2ded6ce 100644 --- a/lib/data/services/model/tender_detail_request/tender_detail_request.freezed.dart +++ b/lib/data/services/model/tender_detail_request/tender_detail_request.freezed.dart @@ -21,7 +21,7 @@ TenderDetailRequest _$TenderDetailRequestFromJson(Map json) { /// @nodoc mixin _$TenderDetailRequest { - @JsonKey(name: "id") + @JsonKey(name: 'id') String get id => throw _privateConstructorUsedError; /// Serializes this TenderDetailRequest to a JSON map. @@ -41,7 +41,7 @@ abstract class $TenderDetailRequestCopyWith<$Res> { $Res Function(TenderDetailRequest) then, ) = _$TenderDetailRequestCopyWithImpl<$Res, TenderDetailRequest>; @useResult - $Res call({@JsonKey(name: "id") String id}); + $Res call({@JsonKey(name: 'id') String id}); } /// @nodoc @@ -81,7 +81,7 @@ abstract class _$$TenderDetailRequestImplCopyWith<$Res> ) = __$$TenderDetailRequestImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "id") String id}); + $Res call({@JsonKey(name: 'id') String id}); } /// @nodoc @@ -113,13 +113,13 @@ class __$$TenderDetailRequestImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$TenderDetailRequestImpl implements _TenderDetailRequest { - const _$TenderDetailRequestImpl({@JsonKey(name: "id") required this.id}); + const _$TenderDetailRequestImpl({@JsonKey(name: 'id') required this.id}); factory _$TenderDetailRequestImpl.fromJson(Map json) => _$$TenderDetailRequestImplFromJson(json); @override - @JsonKey(name: "id") + @JsonKey(name: 'id') final String id; @override @@ -158,14 +158,14 @@ class _$TenderDetailRequestImpl implements _TenderDetailRequest { abstract class _TenderDetailRequest implements TenderDetailRequest { const factory _TenderDetailRequest({ - @JsonKey(name: "id") required final String id, + @JsonKey(name: 'id') required final String id, }) = _$TenderDetailRequestImpl; factory _TenderDetailRequest.fromJson(Map json) = _$TenderDetailRequestImpl.fromJson; @override - @JsonKey(name: "id") + @JsonKey(name: 'id') String get id; /// Create a copy of TenderDetailRequest diff --git a/lib/data/services/model/your_tender_model/your_tender_model.dart b/lib/data/services/model/your_tender_model/your_tender_model.dart new file mode 100644 index 0000000..fd67542 --- /dev/null +++ b/lib/data/services/model/your_tender_model/your_tender_model.dart @@ -0,0 +1,20 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'your_tender_model.freezed.dart'; +part 'your_tender_model.g.dart'; + +@freezed +class YourTenderModel with _$YourTenderModel { + const factory YourTenderModel({ + required String date, + required String title, + required String description, + required String location, + required String countryFlag, + required String status, + required String projectStatus, + }) = _YourTenderModel; + + factory YourTenderModel.fromJson(Map json) => + _$YourTenderModelFromJson(json); +} diff --git a/lib/data/services/model/your_tender_model/your_tender_model.freezed.dart b/lib/data/services/model/your_tender_model/your_tender_model.freezed.dart new file mode 100644 index 0000000..820cdb2 --- /dev/null +++ b/lib/data/services/model/your_tender_model/your_tender_model.freezed.dart @@ -0,0 +1,329 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'your_tender_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +YourTenderModel _$YourTenderModelFromJson(Map json) { + return _YourTenderModel.fromJson(json); +} + +/// @nodoc +mixin _$YourTenderModel { + String get date => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + String get location => throw _privateConstructorUsedError; + String get countryFlag => throw _privateConstructorUsedError; + String get status => throw _privateConstructorUsedError; + String get projectStatus => throw _privateConstructorUsedError; + + /// Serializes this YourTenderModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of YourTenderModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $YourTenderModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $YourTenderModelCopyWith<$Res> { + factory $YourTenderModelCopyWith( + YourTenderModel value, + $Res Function(YourTenderModel) then, + ) = _$YourTenderModelCopyWithImpl<$Res, YourTenderModel>; + @useResult + $Res call({ + String date, + String title, + String description, + String location, + String countryFlag, + String status, + String projectStatus, + }); +} + +/// @nodoc +class _$YourTenderModelCopyWithImpl<$Res, $Val extends YourTenderModel> + implements $YourTenderModelCopyWith<$Res> { + _$YourTenderModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of YourTenderModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? title = null, + Object? description = null, + Object? location = null, + Object? countryFlag = null, + Object? status = null, + Object? projectStatus = null, + }) { + return _then( + _value.copyWith( + date: + null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as String, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + description: + null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + location: + null == location + ? _value.location + : location // ignore: cast_nullable_to_non_nullable + as String, + countryFlag: + null == countryFlag + ? _value.countryFlag + : countryFlag // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + projectStatus: + null == projectStatus + ? _value.projectStatus + : projectStatus // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$YourTenderModelImplCopyWith<$Res> + implements $YourTenderModelCopyWith<$Res> { + factory _$$YourTenderModelImplCopyWith( + _$YourTenderModelImpl value, + $Res Function(_$YourTenderModelImpl) then, + ) = __$$YourTenderModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String date, + String title, + String description, + String location, + String countryFlag, + String status, + String projectStatus, + }); +} + +/// @nodoc +class __$$YourTenderModelImplCopyWithImpl<$Res> + extends _$YourTenderModelCopyWithImpl<$Res, _$YourTenderModelImpl> + implements _$$YourTenderModelImplCopyWith<$Res> { + __$$YourTenderModelImplCopyWithImpl( + _$YourTenderModelImpl _value, + $Res Function(_$YourTenderModelImpl) _then, + ) : super(_value, _then); + + /// Create a copy of YourTenderModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? title = null, + Object? description = null, + Object? location = null, + Object? countryFlag = null, + Object? status = null, + Object? projectStatus = null, + }) { + return _then( + _$YourTenderModelImpl( + date: + null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as String, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + description: + null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + location: + null == location + ? _value.location + : location // ignore: cast_nullable_to_non_nullable + as String, + countryFlag: + null == countryFlag + ? _value.countryFlag + : countryFlag // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + projectStatus: + null == projectStatus + ? _value.projectStatus + : projectStatus // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$YourTenderModelImpl implements _YourTenderModel { + const _$YourTenderModelImpl({ + required this.date, + required this.title, + required this.description, + required this.location, + required this.countryFlag, + required this.status, + required this.projectStatus, + }); + + factory _$YourTenderModelImpl.fromJson(Map json) => + _$$YourTenderModelImplFromJson(json); + + @override + final String date; + @override + final String title; + @override + final String description; + @override + final String location; + @override + final String countryFlag; + @override + final String status; + @override + final String projectStatus; + + @override + String toString() { + return 'YourTenderModel(date: $date, title: $title, description: $description, location: $location, countryFlag: $countryFlag, status: $status, projectStatus: $projectStatus)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$YourTenderModelImpl && + (identical(other.date, date) || other.date == date) && + (identical(other.title, title) || other.title == title) && + (identical(other.description, description) || + other.description == description) && + (identical(other.location, location) || + other.location == location) && + (identical(other.countryFlag, countryFlag) || + other.countryFlag == countryFlag) && + (identical(other.status, status) || other.status == status) && + (identical(other.projectStatus, projectStatus) || + other.projectStatus == projectStatus)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + date, + title, + description, + location, + countryFlag, + status, + projectStatus, + ); + + /// Create a copy of YourTenderModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$YourTenderModelImplCopyWith<_$YourTenderModelImpl> get copyWith => + __$$YourTenderModelImplCopyWithImpl<_$YourTenderModelImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$YourTenderModelImplToJson(this); + } +} + +abstract class _YourTenderModel implements YourTenderModel { + const factory _YourTenderModel({ + required final String date, + required final String title, + required final String description, + required final String location, + required final String countryFlag, + required final String status, + required final String projectStatus, + }) = _$YourTenderModelImpl; + + factory _YourTenderModel.fromJson(Map json) = + _$YourTenderModelImpl.fromJson; + + @override + String get date; + @override + String get title; + @override + String get description; + @override + String get location; + @override + String get countryFlag; + @override + String get status; + @override + String get projectStatus; + + /// Create a copy of YourTenderModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$YourTenderModelImplCopyWith<_$YourTenderModelImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/data/services/model/your_tender_model/your_tender_model.g.dart b/lib/data/services/model/your_tender_model/your_tender_model.g.dart new file mode 100644 index 0000000..fc21693 --- /dev/null +++ b/lib/data/services/model/your_tender_model/your_tender_model.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'your_tender_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$YourTenderModelImpl _$$YourTenderModelImplFromJson( + Map json, +) => _$YourTenderModelImpl( + date: json['date'] as String, + title: json['title'] as String, + description: json['description'] as String, + location: json['location'] as String, + countryFlag: json['countryFlag'] as String, + status: json['status'] as String, + projectStatus: json['projectStatus'] as String, +); + +Map _$$YourTenderModelImplToJson( + _$YourTenderModelImpl instance, +) => { + 'date': instance.date, + 'title': instance.title, + 'description': instance.description, + 'location': instance.location, + 'countryFlag': instance.countryFlag, + 'status': instance.status, + 'projectStatus': instance.projectStatus, +}; diff --git a/lib/data/services/model/your_tender_model_request/your_tenders_request_model.dart b/lib/data/services/model/your_tender_model_request/your_tenders_request_model.dart new file mode 100644 index 0000000..12178fe --- /dev/null +++ b/lib/data/services/model/your_tender_model_request/your_tenders_request_model.dart @@ -0,0 +1,14 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'your_tenders_request_model.freezed.dart'; +part 'your_tenders_request_model.g.dart'; + +@freezed +class YourTendersRequestModel with _$YourTendersRequestModel { + const factory YourTendersRequestModel({ + required String id, + }) = _YourTendersRequestModel; + + factory YourTendersRequestModel.fromJson(Map json) => + _$YourTendersRequestModelFromJson(json); +} diff --git a/lib/data/services/model/your_tender_model_request/your_tenders_request_model.freezed.dart b/lib/data/services/model/your_tender_model_request/your_tenders_request_model.freezed.dart new file mode 100644 index 0000000..245617b --- /dev/null +++ b/lib/data/services/model/your_tender_model_request/your_tenders_request_model.freezed.dart @@ -0,0 +1,181 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'your_tenders_request_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +YourTendersRequestModel _$YourTendersRequestModelFromJson( + Map json, +) { + return _YourTendersRequestModel.fromJson(json); +} + +/// @nodoc +mixin _$YourTendersRequestModel { + String get id => throw _privateConstructorUsedError; + + /// Serializes this YourTendersRequestModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of YourTendersRequestModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $YourTendersRequestModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $YourTendersRequestModelCopyWith<$Res> { + factory $YourTendersRequestModelCopyWith( + YourTendersRequestModel value, + $Res Function(YourTendersRequestModel) then, + ) = _$YourTendersRequestModelCopyWithImpl<$Res, YourTendersRequestModel>; + @useResult + $Res call({String id}); +} + +/// @nodoc +class _$YourTendersRequestModelCopyWithImpl< + $Res, + $Val extends YourTendersRequestModel +> + implements $YourTendersRequestModelCopyWith<$Res> { + _$YourTendersRequestModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of YourTendersRequestModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? id = null}) { + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$YourTendersRequestModelImplCopyWith<$Res> + implements $YourTendersRequestModelCopyWith<$Res> { + factory _$$YourTendersRequestModelImplCopyWith( + _$YourTendersRequestModelImpl value, + $Res Function(_$YourTendersRequestModelImpl) then, + ) = __$$YourTendersRequestModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String id}); +} + +/// @nodoc +class __$$YourTendersRequestModelImplCopyWithImpl<$Res> + extends + _$YourTendersRequestModelCopyWithImpl< + $Res, + _$YourTendersRequestModelImpl + > + implements _$$YourTendersRequestModelImplCopyWith<$Res> { + __$$YourTendersRequestModelImplCopyWithImpl( + _$YourTendersRequestModelImpl _value, + $Res Function(_$YourTendersRequestModelImpl) _then, + ) : super(_value, _then); + + /// Create a copy of YourTendersRequestModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? id = null}) { + return _then( + _$YourTendersRequestModelImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$YourTendersRequestModelImpl implements _YourTendersRequestModel { + const _$YourTendersRequestModelImpl({required this.id}); + + factory _$YourTendersRequestModelImpl.fromJson(Map json) => + _$$YourTendersRequestModelImplFromJson(json); + + @override + final String id; + + @override + String toString() { + return 'YourTendersRequestModel(id: $id)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$YourTendersRequestModelImpl && + (identical(other.id, id) || other.id == id)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, id); + + /// Create a copy of YourTendersRequestModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$YourTendersRequestModelImplCopyWith<_$YourTendersRequestModelImpl> + get copyWith => __$$YourTendersRequestModelImplCopyWithImpl< + _$YourTendersRequestModelImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$YourTendersRequestModelImplToJson(this); + } +} + +abstract class _YourTendersRequestModel implements YourTendersRequestModel { + const factory _YourTendersRequestModel({required final String id}) = + _$YourTendersRequestModelImpl; + + factory _YourTendersRequestModel.fromJson(Map json) = + _$YourTendersRequestModelImpl.fromJson; + + @override + String get id; + + /// Create a copy of YourTendersRequestModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$YourTendersRequestModelImplCopyWith<_$YourTendersRequestModelImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/data/services/model/your_tender_model_request/your_tenders_request_model.g.dart b/lib/data/services/model/your_tender_model_request/your_tenders_request_model.g.dart new file mode 100644 index 0000000..5cc6bc4 --- /dev/null +++ b/lib/data/services/model/your_tender_model_request/your_tenders_request_model.g.dart @@ -0,0 +1,15 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'your_tenders_request_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$YourTendersRequestModelImpl _$$YourTendersRequestModelImplFromJson( + Map json, +) => _$YourTendersRequestModelImpl(id: json['id'] as String); + +Map _$$YourTendersRequestModelImplToJson( + _$YourTendersRequestModelImpl instance, +) => {'id': instance.id}; diff --git a/lib/data/services/model/your_tender_model_response/your_tender_model_response.dart b/lib/data/services/model/your_tender_model_response/your_tender_model_response.dart new file mode 100644 index 0000000..015c77a --- /dev/null +++ b/lib/data/services/model/your_tender_model_response/your_tender_model_response.dart @@ -0,0 +1,16 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:tm_app/data/services/model/your_tender_model/your_tender_model.dart'; + +part 'your_tender_model_response.freezed.dart'; +part 'your_tender_model_response.g.dart'; + +@freezed +class YourTendersResponseModel with _$YourTendersResponseModel { + const factory YourTendersResponseModel({ + required List approvedTenders, + required List tendersSubmitted, + }) = _YourTendersResponseModel; + + factory YourTendersResponseModel.fromJson(Map json) => + _$YourTendersResponseModelFromJson(json); +} diff --git a/lib/data/services/model/your_tender_model_response/your_tender_model_response.freezed.dart b/lib/data/services/model/your_tender_model_response/your_tender_model_response.freezed.dart new file mode 100644 index 0000000..0bb479a --- /dev/null +++ b/lib/data/services/model/your_tender_model_response/your_tender_model_response.freezed.dart @@ -0,0 +1,233 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'your_tender_model_response.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +YourTendersResponseModel _$YourTendersResponseModelFromJson( + Map json, +) { + return _YourTendersResponseModel.fromJson(json); +} + +/// @nodoc +mixin _$YourTendersResponseModel { + List get approvedTenders => + throw _privateConstructorUsedError; + List get tendersSubmitted => + throw _privateConstructorUsedError; + + /// Serializes this YourTendersResponseModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of YourTendersResponseModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $YourTendersResponseModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $YourTendersResponseModelCopyWith<$Res> { + factory $YourTendersResponseModelCopyWith( + YourTendersResponseModel value, + $Res Function(YourTendersResponseModel) then, + ) = _$YourTendersResponseModelCopyWithImpl<$Res, YourTendersResponseModel>; + @useResult + $Res call({ + List approvedTenders, + List tendersSubmitted, + }); +} + +/// @nodoc +class _$YourTendersResponseModelCopyWithImpl< + $Res, + $Val extends YourTendersResponseModel +> + implements $YourTendersResponseModelCopyWith<$Res> { + _$YourTendersResponseModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of YourTendersResponseModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? approvedTenders = null, Object? tendersSubmitted = null}) { + return _then( + _value.copyWith( + approvedTenders: + null == approvedTenders + ? _value.approvedTenders + : approvedTenders // ignore: cast_nullable_to_non_nullable + as List, + tendersSubmitted: + null == tendersSubmitted + ? _value.tendersSubmitted + : tendersSubmitted // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$YourTendersResponseModelImplCopyWith<$Res> + implements $YourTendersResponseModelCopyWith<$Res> { + factory _$$YourTendersResponseModelImplCopyWith( + _$YourTendersResponseModelImpl value, + $Res Function(_$YourTendersResponseModelImpl) then, + ) = __$$YourTendersResponseModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + List approvedTenders, + List tendersSubmitted, + }); +} + +/// @nodoc +class __$$YourTendersResponseModelImplCopyWithImpl<$Res> + extends + _$YourTendersResponseModelCopyWithImpl< + $Res, + _$YourTendersResponseModelImpl + > + implements _$$YourTendersResponseModelImplCopyWith<$Res> { + __$$YourTendersResponseModelImplCopyWithImpl( + _$YourTendersResponseModelImpl _value, + $Res Function(_$YourTendersResponseModelImpl) _then, + ) : super(_value, _then); + + /// Create a copy of YourTendersResponseModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? approvedTenders = null, Object? tendersSubmitted = null}) { + return _then( + _$YourTendersResponseModelImpl( + approvedTenders: + null == approvedTenders + ? _value._approvedTenders + : approvedTenders // ignore: cast_nullable_to_non_nullable + as List, + tendersSubmitted: + null == tendersSubmitted + ? _value._tendersSubmitted + : tendersSubmitted // ignore: cast_nullable_to_non_nullable + as List, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$YourTendersResponseModelImpl implements _YourTendersResponseModel { + const _$YourTendersResponseModelImpl({ + required final List approvedTenders, + required final List tendersSubmitted, + }) : _approvedTenders = approvedTenders, + _tendersSubmitted = tendersSubmitted; + + factory _$YourTendersResponseModelImpl.fromJson(Map json) => + _$$YourTendersResponseModelImplFromJson(json); + + final List _approvedTenders; + @override + List get approvedTenders { + if (_approvedTenders is EqualUnmodifiableListView) return _approvedTenders; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_approvedTenders); + } + + final List _tendersSubmitted; + @override + List get tendersSubmitted { + if (_tendersSubmitted is EqualUnmodifiableListView) + return _tendersSubmitted; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_tendersSubmitted); + } + + @override + String toString() { + return 'YourTendersResponseModel(approvedTenders: $approvedTenders, tendersSubmitted: $tendersSubmitted)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$YourTendersResponseModelImpl && + const DeepCollectionEquality().equals( + other._approvedTenders, + _approvedTenders, + ) && + const DeepCollectionEquality().equals( + other._tendersSubmitted, + _tendersSubmitted, + )); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_approvedTenders), + const DeepCollectionEquality().hash(_tendersSubmitted), + ); + + /// Create a copy of YourTendersResponseModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$YourTendersResponseModelImplCopyWith<_$YourTendersResponseModelImpl> + get copyWith => __$$YourTendersResponseModelImplCopyWithImpl< + _$YourTendersResponseModelImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$YourTendersResponseModelImplToJson(this); + } +} + +abstract class _YourTendersResponseModel implements YourTendersResponseModel { + const factory _YourTendersResponseModel({ + required final List approvedTenders, + required final List tendersSubmitted, + }) = _$YourTendersResponseModelImpl; + + factory _YourTendersResponseModel.fromJson(Map json) = + _$YourTendersResponseModelImpl.fromJson; + + @override + List get approvedTenders; + @override + List get tendersSubmitted; + + /// Create a copy of YourTendersResponseModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$YourTendersResponseModelImplCopyWith<_$YourTendersResponseModelImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/data/services/model/your_tender_model_response/your_tender_model_response.g.dart b/lib/data/services/model/your_tender_model_response/your_tender_model_response.g.dart new file mode 100644 index 0000000..368d8c8 --- /dev/null +++ b/lib/data/services/model/your_tender_model_response/your_tender_model_response.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'your_tender_model_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$YourTendersResponseModelImpl _$$YourTendersResponseModelImplFromJson( + Map json, +) => _$YourTendersResponseModelImpl( + approvedTenders: + (json['approvedTenders'] as List) + .map((e) => YourTenderModel.fromJson(e as Map)) + .toList(), + tendersSubmitted: + (json['tendersSubmitted'] as List) + .map((e) => YourTenderModel.fromJson(e as Map)) + .toList(), +); + +Map _$$YourTendersResponseModelImplToJson( + _$YourTendersResponseModelImpl instance, +) => { + 'approvedTenders': instance.approvedTenders, + 'tendersSubmitted': instance.tendersSubmitted, +}; diff --git a/lib/data/services/your_tenders_service.dart b/lib/data/services/your_tenders_service.dart new file mode 100644 index 0000000..a4e4ac7 --- /dev/null +++ b/lib/data/services/your_tenders_service.dart @@ -0,0 +1,16 @@ +import 'dart:convert'; +import 'package:tm_app/core/utils/result.dart'; +import 'package:tm_app/data/services/mock_data/mock_your_tenders_data.dart'; +import 'package:tm_app/data/services/model/your_tender_model_request/your_tenders_request_model.dart'; +import 'package:tm_app/data/services/model/your_tender_model_response/your_tender_model_response.dart'; + +class YourTendersService { + Future> getYourTenders({ + required YourTendersRequestModel request, + }) async { + await Future.delayed(const Duration(seconds: 1)); + return Result.ok( + YourTendersResponseModel.fromJson(jsonDecode(mockYourTendersData)), + ); + } +} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index d03ffa2..db866a9 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -35,6 +35,9 @@ class $AssetsIconsGen { /// File path: assets/icons/arrows.svg String get arrows => 'assets/icons/arrows.svg'; + /// File path: assets/icons/calendar.svg + String get calendar => 'assets/icons/calendar.svg'; + /// File path: assets/icons/close-circle.svg String get closeCircle => 'assets/icons/close-circle.svg'; @@ -56,6 +59,12 @@ class $AssetsIconsGen { /// File path: assets/icons/location.svg String get location => 'assets/icons/location.svg'; + /// File path: assets/icons/menu.svg + String get menu => 'assets/icons/menu.svg'; + + /// File path: assets/icons/notification.svg + String get notification => 'assets/icons/notification.svg'; + /// File path: assets/icons/profile-circle.svg String get profileCircle => 'assets/icons/profile-circle.svg'; @@ -84,6 +93,9 @@ class $AssetsIconsGen { /// File path: assets/icons/tick-circle.svg String get tickCircle => 'assets/icons/tick-circle.svg'; + /// File path: assets/icons/tick.svg + String get tick => 'assets/icons/tick.svg'; + /// List of all assets List get values => [ se, @@ -93,6 +105,7 @@ class $AssetsIconsGen { arrowRightSmall, arrowRight, arrows, + calendar, closeCircle, dislike, edit, @@ -100,6 +113,8 @@ class $AssetsIconsGen { homeActive, like, location, + menu, + notification, profileCircle, profileCircleActive, shield, @@ -109,6 +124,7 @@ class $AssetsIconsGen { tenderLogoSvg, thumb, tickCircle, + tick, ]; } @@ -118,8 +134,12 @@ class $AssetsPngsGen { /// File path: assets/pngs/logo.png AssetGenImage get logo => const AssetGenImage('assets/pngs/logo.png'); + /// File path: assets/pngs/web_login_image.png + AssetGenImage get webLoginImage => + const AssetGenImage('assets/pngs/web_login_image.png'); + /// List of all assets - List get values => [logo]; + List get values => [logo, webLoginImage]; } class $AssetsSvgsGen { diff --git a/lib/view_models/your_tenders_view_model.dart b/lib/view_models/your_tenders_view_model.dart new file mode 100644 index 0000000..2eaec79 --- /dev/null +++ b/lib/view_models/your_tenders_view_model.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:tm_app/core/utils/result.dart'; +import 'package:tm_app/data/repositories/your_tenders_repository.dart'; +import 'package:tm_app/data/services/model/your_tender_model_request/your_tenders_request_model.dart'; +import 'package:tm_app/data/services/model/your_tender_model_response/your_tender_model_response.dart'; + +class YourTendersViewModel with ChangeNotifier { + final YourTendersRepository yourTendersRepository; + YourTendersViewModel({required this.yourTendersRepository}) { + getTenders(); + } + + bool isLoading = false; + String? errorMessage; + YourTendersResponseModel? data; + + Future getTenders() async { + isLoading = true; + notifyListeners(); + + final result = await yourTendersRepository.getYourTenders( + request: const YourTendersRequestModel(id: '1'), + ); + + switch (result) { + case Ok(): + data = result.value; + break; + case Error(): + errorMessage = result.error.toString(); + break; + } + + isLoading = false; + notifyListeners(); + } +} diff --git a/lib/views/your_tenders/pages/your_tenders_desktop_page.dart b/lib/views/your_tenders/pages/your_tenders_desktop_page.dart index 902c0f9..aab4967 100644 --- a/lib/views/your_tenders/pages/your_tenders_desktop_page.dart +++ b/lib/views/your_tenders/pages/your_tenders_desktop_page.dart @@ -1,10 +1,12 @@ import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:tm_app/core/constants/strings.dart'; import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/views/shared/main_tab_bar.dart'; import 'package:tm_app/views/shared/tender_app_bar.dart'; import 'package:tm_app/views/your_tenders/widgets/approved_tenders.dart'; import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart'; +import 'package:tm_app/view_models/your_tenders_view_model.dart'; class YourTendersDesktopPage extends StatefulWidget { const YourTendersDesktopPage({super.key}); @@ -21,6 +23,10 @@ class _YourTendersDesktopPageState extends State void initState() { super.initState(); controller = TabController(length: 2, vsync: this); + + WidgetsBinding.instance.addPostFrameCallback((_) { + context.read().getTenders(); + }); } @override @@ -50,7 +56,10 @@ class _YourTendersDesktopPageState extends State Expanded( child: TabBarView( controller: controller, - children: [ApprovedTenders(), TendersSubmitted()], + children: const [ + ApprovedTenders(), + TendersSubmitted(), + ], ), ), ], diff --git a/lib/views/your_tenders/widgets/approved_tenders.dart b/lib/views/your_tenders/widgets/approved_tenders.dart index 2e8b3a1..ab0d7f7 100644 --- a/lib/views/your_tenders/widgets/approved_tenders.dart +++ b/lib/views/your_tenders/widgets/approved_tenders.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:tm_app/core/utils/size_config.dart'; -import 'package:tm_app/views/your_tenders/model/tender_model.dart'; +import 'package:provider/provider.dart'; +import 'package:tm_app/core/constants/assets.dart'; +import 'package:tm_app/core/theme/colors.dart'; +import 'package:tm_app/view_models/your_tenders_view_model.dart'; import 'package:tm_app/views/your_tenders/widgets/tender_card.dart'; class ApprovedTenders extends StatelessWidget { @@ -8,22 +10,61 @@ class ApprovedTenders extends StatelessWidget { @override Widget build(BuildContext context) { + final vm = Provider.of(context); + + if (vm.isLoading) { + return const Center(child: CircularProgressIndicator()); + } + + if (vm.errorMessage != null) { + return Center(child: Text(vm.errorMessage!)); + } + + final tenders = vm.data?.approvedTenders ?? []; + return ListView.builder( - padding: EdgeInsets.only(top: 20.0.h()), - itemCount: approvedTenders.length, + padding: const EdgeInsets.only(top: 20), + itemCount: tenders.length, itemBuilder: (context, index) { - final tender = approvedTenders[index]; + final t = tenders[index]; return TenderCard( - date: tender.date, - title: tender.title, - description: tender.description, - location: tender.location, - countryFlag: tender.countryFlag, - status: tender.status, - projectStatus: tender.projectStatus, - backgroundColor: tender.backgroundColor, - borderColor: tender.borderColor, - statusIcon: tender.statusIcon, + date: t.date, + title: t.title, + description: t.description, + location: t.location, + countryFlag: t.countryFlag, + status: t.status, + projectStatus: t.projectStatus, + backgroundColor: + t.status == 'Won' + ? AppColors.gren0 + : t.status == 'Completed' + ? AppColors.white + : AppColors.red0.withValues(alpha: 0.2), + borderColor: + t.status == 'Won' + ? AppColors.green10 + : t.status == 'Completed' + ? AppColors.cyanAqua + : AppColors.red0, + statusIcon: + t.status == 'Won' + ? AssetsManager.tickCircle + : t.status == 'Completed' + ? null + : AssetsManager.closeCircle, + statusCardColor: + t.status == 'Won' + ? AppColors.green20 + : t.status == 'Completed' + ? AppColors.cyanAqua + : AppColors.red0, + statusTextColor: + t.status == 'Won' + ? AppColors.gren30 + : t.status == 'Completed' + ? AppColors.cyanTeal + : AppColors.red10, ); }, ); diff --git a/lib/views/your_tenders/widgets/tenders_submitted.dart b/lib/views/your_tenders/widgets/tenders_submitted.dart index b8a44bb..a5e091e 100644 --- a/lib/views/your_tenders/widgets/tenders_submitted.dart +++ b/lib/views/your_tenders/widgets/tenders_submitted.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:tm_app/core/constants/assets.dart'; import 'package:tm_app/core/theme/colors.dart'; -import 'package:tm_app/core/utils/size_config.dart'; -import 'package:tm_app/views/your_tenders/model/tender_model.dart'; +import 'package:tm_app/view_models/your_tenders_view_model.dart'; import 'package:tm_app/views/your_tenders/widgets/tender_card.dart'; class TendersSubmitted extends StatelessWidget { @@ -10,34 +10,61 @@ class TendersSubmitted extends StatelessWidget { @override Widget build(BuildContext context) { - return ListView.builder( - padding: EdgeInsets.only(top: 20.0.h()), - itemCount: tendersSubmitted.length, - itemBuilder: (context, index) { - final tender = tendersSubmitted[index]; - return TenderCard( - date: tender.date, - title: tender.title, - description: tender.description, - location: tender.location, - countryFlag: tender.countryFlag, - status: tender.status, - projectStatus: tender.projectStatus, + final vm = Provider.of(context); + if (vm.isLoading) { + return const Center(child: CircularProgressIndicator()); + } + + if (vm.errorMessage != null) { + return Center(child: Text(vm.errorMessage!)); + } + + final tenders = vm.data?.tendersSubmitted ?? []; + + return ListView.builder( + padding: const EdgeInsets.only(top: 20), + itemCount: tenders.length, + itemBuilder: (context, index) { + final t = tenders[index]; + return TenderCard( + date: t.date, + title: t.title, + description: t.description, + location: t.location, + countryFlag: t.countryFlag, + status: t.status, + projectStatus: t.projectStatus, backgroundColor: - tender.status == 'Won' + t.status == 'Won' ? AppColors.gren0 + : t.status == 'Completed' + ? AppColors.white : AppColors.red0.withValues(alpha: 0.2), borderColor: - tender.status == 'Won' ? AppColors.green10 : AppColors.red0, + t.status == 'Won' + ? AppColors.green10 + : t.status == 'Completed' + ? AppColors.cyanAqua + : AppColors.red0, statusIcon: - tender.status == 'Won' + t.status == 'Won' ? AssetsManager.tickCircle + : t.status == 'Completed' + ? null : AssetsManager.closeCircle, statusCardColor: - tender.status == 'Won' ? AppColors.green20 : AppColors.red0, + t.status == 'Won' + ? AppColors.green20 + : t.status == 'Completed' + ? AppColors.cyanAqua + : AppColors.red0, statusTextColor: - tender.status == 'Won' ? AppColors.gren30 : AppColors.red10, + t.status == 'Won' + ? AppColors.gren30 + : t.status == 'Completed' + ? AppColors.cyanTeal + : AppColors.red10, ); }, );