fixed your tenders filters and service and home your tneders use your tenders service

This commit is contained in:
amirrezaghabeli
2025-09-08 09:53:21 +03:30
parent 326f2deeec
commit 9a1ec0b34e
23 changed files with 180 additions and 1279 deletions
@@ -0,0 +1,15 @@
class GetTendersRequestModel {
final String status;
final String createdFrom;
final String createdTo;
final int limit;
final int offset;
GetTendersRequestModel({
this.status = '',
this.createdFrom = '',
this.createdTo = '',
this.limit = 10,
this.offset = 0,
});
}
@@ -1,20 +0,0 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'your_tender_model.freezed.dart';
part 'your_tender_model.g.dart';
@freezed
abstract 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<String, dynamic> json) =>
_$YourTenderModelFromJson(json);
}
@@ -1,295 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$YourTenderModel {
String get date; String get title; String get description; String get location; String get countryFlag; String get status; String get projectStatus;
/// Create a copy of YourTenderModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$YourTenderModelCopyWith<YourTenderModel> get copyWith => _$YourTenderModelCopyWithImpl<YourTenderModel>(this as YourTenderModel, _$identity);
/// Serializes this YourTenderModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is YourTenderModel&&(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);
@override
String toString() {
return 'YourTenderModel(date: $date, title: $title, description: $description, location: $location, countryFlag: $countryFlag, status: $status, projectStatus: $projectStatus)';
}
}
/// @nodoc
abstract mixin class $YourTenderModelCopyWith<$Res> {
factory $YourTenderModelCopyWith(YourTenderModel value, $Res Function(YourTenderModel) _then) = _$YourTenderModelCopyWithImpl;
@useResult
$Res call({
String date, String title, String description, String location, String countryFlag, String status, String projectStatus
});
}
/// @nodoc
class _$YourTenderModelCopyWithImpl<$Res>
implements $YourTenderModelCopyWith<$Res> {
_$YourTenderModelCopyWithImpl(this._self, this._then);
final YourTenderModel _self;
final $Res Function(YourTenderModel) _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(_self.copyWith(
date: null == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as String,countryFlag: null == countryFlag ? _self.countryFlag : countryFlag // ignore: cast_nullable_to_non_nullable
as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,projectStatus: null == projectStatus ? _self.projectStatus : projectStatus // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [YourTenderModel].
extension YourTenderModelPatterns on YourTenderModel {
/// 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 extends Object?>(TResult Function( _YourTenderModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _YourTenderModel() 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 extends Object?>(TResult Function( _YourTenderModel value) $default,){
final _that = this;
switch (_that) {
case _YourTenderModel():
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 extends Object?>(TResult? Function( _YourTenderModel value)? $default,){
final _that = this;
switch (_that) {
case _YourTenderModel() 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 extends Object?>(TResult Function( String date, String title, String description, String location, String countryFlag, String status, String projectStatus)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _YourTenderModel() when $default != null:
return $default(_that.date,_that.title,_that.description,_that.location,_that.countryFlag,_that.status,_that.projectStatus);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 extends Object?>(TResult Function( String date, String title, String description, String location, String countryFlag, String status, String projectStatus) $default,) {final _that = this;
switch (_that) {
case _YourTenderModel():
return $default(_that.date,_that.title,_that.description,_that.location,_that.countryFlag,_that.status,_that.projectStatus);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 extends Object?>(TResult? Function( String date, String title, String description, String location, String countryFlag, String status, String projectStatus)? $default,) {final _that = this;
switch (_that) {
case _YourTenderModel() when $default != null:
return $default(_that.date,_that.title,_that.description,_that.location,_that.countryFlag,_that.status,_that.projectStatus);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _YourTenderModel implements YourTenderModel {
const _YourTenderModel({required this.date, required this.title, required this.description, required this.location, required this.countryFlag, required this.status, required this.projectStatus});
factory _YourTenderModel.fromJson(Map<String, dynamic> json) => _$YourTenderModelFromJson(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;
/// Create a copy of YourTenderModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$YourTenderModelCopyWith<_YourTenderModel> get copyWith => __$YourTenderModelCopyWithImpl<_YourTenderModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$YourTenderModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _YourTenderModel&&(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);
@override
String toString() {
return 'YourTenderModel(date: $date, title: $title, description: $description, location: $location, countryFlag: $countryFlag, status: $status, projectStatus: $projectStatus)';
}
}
/// @nodoc
abstract mixin class _$YourTenderModelCopyWith<$Res> implements $YourTenderModelCopyWith<$Res> {
factory _$YourTenderModelCopyWith(_YourTenderModel value, $Res Function(_YourTenderModel) _then) = __$YourTenderModelCopyWithImpl;
@override @useResult
$Res call({
String date, String title, String description, String location, String countryFlag, String status, String projectStatus
});
}
/// @nodoc
class __$YourTenderModelCopyWithImpl<$Res>
implements _$YourTenderModelCopyWith<$Res> {
__$YourTenderModelCopyWithImpl(this._self, this._then);
final _YourTenderModel _self;
final $Res Function(_YourTenderModel) _then;
/// Create a copy of YourTenderModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $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(_YourTenderModel(
date: null == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as String,countryFlag: null == countryFlag ? _self.countryFlag : countryFlag // ignore: cast_nullable_to_non_nullable
as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,projectStatus: null == projectStatus ? _self.projectStatus : projectStatus // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on
@@ -1,29 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'your_tender_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_YourTenderModel _$YourTenderModelFromJson(Map<String, dynamic> json) =>
_YourTenderModel(
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<String, dynamic> _$YourTenderModelToJson(_YourTenderModel instance) =>
<String, dynamic>{
'date': instance.date,
'title': instance.title,
'description': instance.description,
'location': instance.location,
'countryFlag': instance.countryFlag,
'status': instance.status,
'projectStatus': instance.projectStatus,
};
@@ -1,13 +0,0 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'your_tenders_request_model.freezed.dart';
part 'your_tenders_request_model.g.dart';
@freezed
abstract class YourTendersRequestModel with _$YourTendersRequestModel {
const factory YourTendersRequestModel({required String id}) =
_YourTendersRequestModel;
factory YourTendersRequestModel.fromJson(Map<String, dynamic> json) =>
_$YourTendersRequestModelFromJson(json);
}
@@ -1,277 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$YourTendersRequestModel {
String get id;
/// Create a copy of YourTendersRequestModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$YourTendersRequestModelCopyWith<YourTendersRequestModel> get copyWith => _$YourTendersRequestModelCopyWithImpl<YourTendersRequestModel>(this as YourTendersRequestModel, _$identity);
/// Serializes this YourTendersRequestModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is YourTendersRequestModel&&(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id);
@override
String toString() {
return 'YourTendersRequestModel(id: $id)';
}
}
/// @nodoc
abstract mixin class $YourTendersRequestModelCopyWith<$Res> {
factory $YourTendersRequestModelCopyWith(YourTendersRequestModel value, $Res Function(YourTendersRequestModel) _then) = _$YourTendersRequestModelCopyWithImpl;
@useResult
$Res call({
String id
});
}
/// @nodoc
class _$YourTendersRequestModelCopyWithImpl<$Res>
implements $YourTendersRequestModelCopyWith<$Res> {
_$YourTendersRequestModelCopyWithImpl(this._self, this._then);
final YourTendersRequestModel _self;
final $Res Function(YourTendersRequestModel) _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(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [YourTendersRequestModel].
extension YourTendersRequestModelPatterns on YourTendersRequestModel {
/// 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 extends Object?>(TResult Function( _YourTendersRequestModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _YourTendersRequestModel() 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 extends Object?>(TResult Function( _YourTendersRequestModel value) $default,){
final _that = this;
switch (_that) {
case _YourTendersRequestModel():
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 extends Object?>(TResult? Function( _YourTendersRequestModel value)? $default,){
final _that = this;
switch (_that) {
case _YourTendersRequestModel() 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 extends Object?>(TResult Function( String id)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _YourTendersRequestModel() 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 extends Object?>(TResult Function( String id) $default,) {final _that = this;
switch (_that) {
case _YourTendersRequestModel():
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 extends Object?>(TResult? Function( String id)? $default,) {final _that = this;
switch (_that) {
case _YourTendersRequestModel() when $default != null:
return $default(_that.id);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _YourTendersRequestModel implements YourTendersRequestModel {
const _YourTendersRequestModel({required this.id});
factory _YourTendersRequestModel.fromJson(Map<String, dynamic> json) => _$YourTendersRequestModelFromJson(json);
@override final String id;
/// Create a copy of YourTendersRequestModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$YourTendersRequestModelCopyWith<_YourTendersRequestModel> get copyWith => __$YourTendersRequestModelCopyWithImpl<_YourTendersRequestModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$YourTendersRequestModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _YourTendersRequestModel&&(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id);
@override
String toString() {
return 'YourTendersRequestModel(id: $id)';
}
}
/// @nodoc
abstract mixin class _$YourTendersRequestModelCopyWith<$Res> implements $YourTendersRequestModelCopyWith<$Res> {
factory _$YourTendersRequestModelCopyWith(_YourTendersRequestModel value, $Res Function(_YourTendersRequestModel) _then) = __$YourTendersRequestModelCopyWithImpl;
@override @useResult
$Res call({
String id
});
}
/// @nodoc
class __$YourTendersRequestModelCopyWithImpl<$Res>
implements _$YourTendersRequestModelCopyWith<$Res> {
__$YourTendersRequestModelCopyWithImpl(this._self, this._then);
final _YourTendersRequestModel _self;
final $Res Function(_YourTendersRequestModel) _then;
/// Create a copy of YourTendersRequestModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,}) {
return _then(_YourTendersRequestModel(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on
@@ -1,15 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'your_tenders_request_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_YourTendersRequestModel _$YourTendersRequestModelFromJson(
Map<String, dynamic> json,
) => _YourTendersRequestModel(id: json['id'] as String);
Map<String, dynamic> _$YourTendersRequestModelToJson(
_YourTendersRequestModel instance,
) => <String, dynamic>{'id': instance.id};
@@ -1,16 +0,0 @@
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
abstract class YourTendersResponseModel with _$YourTendersResponseModel {
const factory YourTendersResponseModel({
required List<YourTenderModel> approvedTenders,
required List<YourTenderModel> tendersSubmitted,
}) = _YourTendersResponseModel;
factory YourTendersResponseModel.fromJson(Map<String, dynamic> json) =>
_$YourTendersResponseModelFromJson(json);
}
@@ -1,292 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$YourTendersResponseModel {
List<YourTenderModel> get approvedTenders; List<YourTenderModel> get tendersSubmitted;
/// Create a copy of YourTendersResponseModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$YourTendersResponseModelCopyWith<YourTendersResponseModel> get copyWith => _$YourTendersResponseModelCopyWithImpl<YourTendersResponseModel>(this as YourTendersResponseModel, _$identity);
/// Serializes this YourTendersResponseModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is YourTendersResponseModel&&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));
@override
String toString() {
return 'YourTendersResponseModel(approvedTenders: $approvedTenders, tendersSubmitted: $tendersSubmitted)';
}
}
/// @nodoc
abstract mixin class $YourTendersResponseModelCopyWith<$Res> {
factory $YourTendersResponseModelCopyWith(YourTendersResponseModel value, $Res Function(YourTendersResponseModel) _then) = _$YourTendersResponseModelCopyWithImpl;
@useResult
$Res call({
List<YourTenderModel> approvedTenders, List<YourTenderModel> tendersSubmitted
});
}
/// @nodoc
class _$YourTendersResponseModelCopyWithImpl<$Res>
implements $YourTendersResponseModelCopyWith<$Res> {
_$YourTendersResponseModelCopyWithImpl(this._self, this._then);
final YourTendersResponseModel _self;
final $Res Function(YourTendersResponseModel) _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(_self.copyWith(
approvedTenders: null == approvedTenders ? _self.approvedTenders : approvedTenders // ignore: cast_nullable_to_non_nullable
as List<YourTenderModel>,tendersSubmitted: null == tendersSubmitted ? _self.tendersSubmitted : tendersSubmitted // ignore: cast_nullable_to_non_nullable
as List<YourTenderModel>,
));
}
}
/// Adds pattern-matching-related methods to [YourTendersResponseModel].
extension YourTendersResponseModelPatterns on YourTendersResponseModel {
/// 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 extends Object?>(TResult Function( _YourTendersResponseModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _YourTendersResponseModel() 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 extends Object?>(TResult Function( _YourTendersResponseModel value) $default,){
final _that = this;
switch (_that) {
case _YourTendersResponseModel():
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 extends Object?>(TResult? Function( _YourTendersResponseModel value)? $default,){
final _that = this;
switch (_that) {
case _YourTendersResponseModel() 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 extends Object?>(TResult Function( List<YourTenderModel> approvedTenders, List<YourTenderModel> tendersSubmitted)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _YourTendersResponseModel() when $default != null:
return $default(_that.approvedTenders,_that.tendersSubmitted);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 extends Object?>(TResult Function( List<YourTenderModel> approvedTenders, List<YourTenderModel> tendersSubmitted) $default,) {final _that = this;
switch (_that) {
case _YourTendersResponseModel():
return $default(_that.approvedTenders,_that.tendersSubmitted);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 extends Object?>(TResult? Function( List<YourTenderModel> approvedTenders, List<YourTenderModel> tendersSubmitted)? $default,) {final _that = this;
switch (_that) {
case _YourTendersResponseModel() when $default != null:
return $default(_that.approvedTenders,_that.tendersSubmitted);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _YourTendersResponseModel implements YourTendersResponseModel {
const _YourTendersResponseModel({required final List<YourTenderModel> approvedTenders, required final List<YourTenderModel> tendersSubmitted}): _approvedTenders = approvedTenders,_tendersSubmitted = tendersSubmitted;
factory _YourTendersResponseModel.fromJson(Map<String, dynamic> json) => _$YourTendersResponseModelFromJson(json);
final List<YourTenderModel> _approvedTenders;
@override List<YourTenderModel> get approvedTenders {
if (_approvedTenders is EqualUnmodifiableListView) return _approvedTenders;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_approvedTenders);
}
final List<YourTenderModel> _tendersSubmitted;
@override List<YourTenderModel> get tendersSubmitted {
if (_tendersSubmitted is EqualUnmodifiableListView) return _tendersSubmitted;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_tendersSubmitted);
}
/// Create a copy of YourTendersResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$YourTendersResponseModelCopyWith<_YourTendersResponseModel> get copyWith => __$YourTendersResponseModelCopyWithImpl<_YourTendersResponseModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$YourTendersResponseModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _YourTendersResponseModel&&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));
@override
String toString() {
return 'YourTendersResponseModel(approvedTenders: $approvedTenders, tendersSubmitted: $tendersSubmitted)';
}
}
/// @nodoc
abstract mixin class _$YourTendersResponseModelCopyWith<$Res> implements $YourTendersResponseModelCopyWith<$Res> {
factory _$YourTendersResponseModelCopyWith(_YourTendersResponseModel value, $Res Function(_YourTendersResponseModel) _then) = __$YourTendersResponseModelCopyWithImpl;
@override @useResult
$Res call({
List<YourTenderModel> approvedTenders, List<YourTenderModel> tendersSubmitted
});
}
/// @nodoc
class __$YourTendersResponseModelCopyWithImpl<$Res>
implements _$YourTendersResponseModelCopyWith<$Res> {
__$YourTendersResponseModelCopyWithImpl(this._self, this._then);
final _YourTendersResponseModel _self;
final $Res Function(_YourTendersResponseModel) _then;
/// Create a copy of YourTendersResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? approvedTenders = null,Object? tendersSubmitted = null,}) {
return _then(_YourTendersResponseModel(
approvedTenders: null == approvedTenders ? _self._approvedTenders : approvedTenders // ignore: cast_nullable_to_non_nullable
as List<YourTenderModel>,tendersSubmitted: null == tendersSubmitted ? _self._tendersSubmitted : tendersSubmitted // ignore: cast_nullable_to_non_nullable
as List<YourTenderModel>,
));
}
}
// dart format on
@@ -1,27 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'your_tender_model_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_YourTendersResponseModel _$YourTendersResponseModelFromJson(
Map<String, dynamic> json,
) => _YourTendersResponseModel(
approvedTenders:
(json['approvedTenders'] as List<dynamic>)
.map((e) => YourTenderModel.fromJson(e as Map<String, dynamic>))
.toList(),
tendersSubmitted:
(json['tendersSubmitted'] as List<dynamic>)
.map((e) => YourTenderModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$YourTendersResponseModelToJson(
_YourTendersResponseModel instance,
) => <String, dynamic>{
'approvedTenders': instance.approvedTenders,
'tendersSubmitted': instance.tendersSubmitted,
};