home logic added
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:tm_app/data/services/model/home/tender/tender_model.dart';
|
||||
|
||||
part 'home_response_model.freezed.dart';
|
||||
part 'home_response_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class HomeResponseModel with _$HomeResponseModel {
|
||||
const factory HomeResponseModel({
|
||||
required String? partnership,
|
||||
@JsonKey(name: 'self_apply') required String? selfApply,
|
||||
required String? contracting,
|
||||
@JsonKey(name: 'tender_submitted') required String? tenderSubmitted,
|
||||
@JsonKey(name: 'approved_tenders') required String? approvedTenders,
|
||||
@JsonKey(name: 'tender_value') required String? tenderValue,
|
||||
@JsonKey(name: 'thunder_status') required String? thunderStatus,
|
||||
@JsonKey(name: 'your_tenders') required List<TenderModel>? yourTenders,
|
||||
}) = _HomeResponseModel;
|
||||
|
||||
factory HomeResponseModel.fromJson(Map<String, Object?> json) =>
|
||||
_$HomeResponseModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
// 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 'home_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @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<TenderModel>? 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<HomeResponseModel> get copyWith => _$HomeResponseModelCopyWithImpl<HomeResponseModel>(this as HomeResponseModel, _$identity);
|
||||
|
||||
/// Serializes this HomeResponseModel to a JSON map.
|
||||
Map<String, dynamic> 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)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @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<TenderModel>? 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.
|
||||
@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<TenderModel>?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// 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 extends Object?>(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 extends Object?>(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 extends Object?>(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 extends Object?>(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<TenderModel>? 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 extends Object?>(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<TenderModel>? 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 extends Object?>(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<TenderModel>? 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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
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<TenderModel>? yourTenders}): _yourTenders = yourTenders;
|
||||
factory _HomeResponseModel.fromJson(Map<String, dynamic> json) => _$HomeResponseModelFromJson(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<TenderModel>? _yourTenders;
|
||||
@override@JsonKey(name: 'your_tenders') List<TenderModel>? get yourTenders {
|
||||
final value = _yourTenders;
|
||||
if (value == null) return null;
|
||||
if (_yourTenders is EqualUnmodifiableListView) return _yourTenders;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
|
||||
/// 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);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$HomeResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@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<TenderModel>? 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<TenderModel>?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,34 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'home_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_HomeResponseModel _$HomeResponseModelFromJson(Map<String, dynamic> 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<dynamic>?)
|
||||
?.map((e) => TenderModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HomeResponseModelToJson(_HomeResponseModel instance) =>
|
||||
<String, dynamic>{
|
||||
'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,
|
||||
};
|
||||
Reference in New Issue
Block a user