Merge pull request 'tender_model' (#40) from tender_model into main

Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/40
This commit is contained in:
a.ghabeli
2025-08-17 13:49:23 +03:30
19 changed files with 1133 additions and 381 deletions
@@ -1,7 +1,7 @@
// ignore_for_file: invalid_annotation_target // ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
part 'home_response_model.freezed.dart'; part 'home_response_model.freezed.dart';
part 'home_response_model.g.dart'; part 'home_response_model.g.dart';
@@ -1,313 +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 'tender_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @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; String? get deadline; bool? get liked; bool? get disliked; bool? get rejected; bool? get submitted;@JsonKey(name: 'profile_match') double? get profileMatch;
/// 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<TenderModel> get copyWith => _$TenderModelCopyWithImpl<TenderModel>(this as TenderModel, _$identity);
/// Serializes this TenderModel to a JSON map.
Map<String, dynamic> 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)&&(identical(other.deadline, deadline) || other.deadline == deadline)&&(identical(other.liked, liked) || other.liked == liked)&&(identical(other.disliked, disliked) || other.disliked == disliked)&&(identical(other.rejected, rejected) || other.rejected == rejected)&&(identical(other.submitted, submitted) || other.submitted == submitted)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,createdTime,tenderId,status,title,description,location,type,deadline,liked,disliked,rejected,submitted,profileMatch);
@override
String toString() {
return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type, deadline: $deadline, liked: $liked, disliked: $disliked, rejected: $rejected, submitted: $submitted, profileMatch: $profileMatch)';
}
}
/// @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, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted,@JsonKey(name: 'profile_match') double? profileMatch
});
}
/// @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.
@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,Object? deadline = freezed,Object? liked = freezed,Object? disliked = freezed,Object? rejected = freezed,Object? submitted = freezed,Object? profileMatch = 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?,deadline: freezed == deadline ? _self.deadline : deadline // ignore: cast_nullable_to_non_nullable
as String?,liked: freezed == liked ? _self.liked : liked // ignore: cast_nullable_to_non_nullable
as bool?,disliked: freezed == disliked ? _self.disliked : disliked // ignore: cast_nullable_to_non_nullable
as bool?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable
as bool?,submitted: freezed == submitted ? _self.submitted : submitted // ignore: cast_nullable_to_non_nullable
as bool?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
/// 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 extends Object?>(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 extends Object?>(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 extends Object?>(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 extends Object?>(TResult Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted, @JsonKey(name: 'profile_match') double? profileMatch)? $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,_that.deadline,_that.liked,_that.disliked,_that.rejected,_that.submitted,_that.profileMatch);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(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted, @JsonKey(name: 'profile_match') double? profileMatch) $default,) {final _that = this;
switch (_that) {
case _TenderModel():
return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type,_that.deadline,_that.liked,_that.disliked,_that.rejected,_that.submitted,_that.profileMatch);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(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted, @JsonKey(name: 'profile_match') double? profileMatch)? $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,_that.deadline,_that.liked,_that.disliked,_that.rejected,_that.submitted,_that.profileMatch);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
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, required this.deadline, required this.liked, required this.disliked, required this.rejected, required this.submitted, @JsonKey(name: 'profile_match') required this.profileMatch});
factory _TenderModel.fromJson(Map<String, dynamic> json) => _$TenderModelFromJson(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 final String? deadline;
@override final bool? liked;
@override final bool? disliked;
@override final bool? rejected;
@override final bool? submitted;
@override@JsonKey(name: 'profile_match') final double? profileMatch;
/// 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
Map<String, dynamic> toJson() {
return _$TenderModelToJson(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)&&(identical(other.deadline, deadline) || other.deadline == deadline)&&(identical(other.liked, liked) || other.liked == liked)&&(identical(other.disliked, disliked) || other.disliked == disliked)&&(identical(other.rejected, rejected) || other.rejected == rejected)&&(identical(other.submitted, submitted) || other.submitted == submitted)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,createdTime,tenderId,status,title,description,location,type,deadline,liked,disliked,rejected,submitted,profileMatch);
@override
String toString() {
return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type, deadline: $deadline, liked: $liked, disliked: $disliked, rejected: $rejected, submitted: $submitted, profileMatch: $profileMatch)';
}
}
/// @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, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted,@JsonKey(name: 'profile_match') double? profileMatch
});
}
/// @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,Object? deadline = freezed,Object? liked = freezed,Object? disliked = freezed,Object? rejected = freezed,Object? submitted = freezed,Object? profileMatch = 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?,deadline: freezed == deadline ? _self.deadline : deadline // ignore: cast_nullable_to_non_nullable
as String?,liked: freezed == liked ? _self.liked : liked // ignore: cast_nullable_to_non_nullable
as bool?,disliked: freezed == disliked ? _self.disliked : disliked // ignore: cast_nullable_to_non_nullable
as bool?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable
as bool?,submitted: freezed == submitted ? _self.submitted : submitted // ignore: cast_nullable_to_non_nullable
as bool?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
// dart format on
@@ -1,40 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tender_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_TenderModel _$TenderModelFromJson(Map<String, dynamic> 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?,
deadline: json['deadline'] as String?,
liked: json['liked'] as bool?,
disliked: json['disliked'] as bool?,
rejected: json['rejected'] as bool?,
submitted: json['submitted'] as bool?,
profileMatch: (json['profile_match'] as num?)?.toDouble(),
);
Map<String, dynamic> _$TenderModelToJson(_TenderModel instance) =>
<String, dynamic>{
'created_time': instance.createdTime,
'tender_id': instance.tenderId,
'status': instance.status,
'title': instance.title,
'description': instance.description,
'location': instance.location,
'type': instance.type,
'deadline': instance.deadline,
'liked': instance.liked,
'disliked': instance.disliked,
'rejected': instance.rejected,
'submitted': instance.submitted,
'profile_match': instance.profileMatch,
};
@@ -0,0 +1,17 @@
// ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart';
part 'organization.freezed.dart';
part 'organization.g.dart';
@freezed
abstract class Organization with _$Organization {
const factory Organization({
required String? name,
}) = _Organization;
factory Organization.fromJson(Map<String, Object?> json) =>
_$OrganizationFromJson(json);
}
@@ -0,0 +1,277 @@
// 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 'organization.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$Organization {
String? get name;
/// Create a copy of Organization
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$OrganizationCopyWith<Organization> get copyWith => _$OrganizationCopyWithImpl<Organization>(this as Organization, _$identity);
/// Serializes this Organization to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Organization&&(identical(other.name, name) || other.name == name));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name);
@override
String toString() {
return 'Organization(name: $name)';
}
}
/// @nodoc
abstract mixin class $OrganizationCopyWith<$Res> {
factory $OrganizationCopyWith(Organization value, $Res Function(Organization) _then) = _$OrganizationCopyWithImpl;
@useResult
$Res call({
String? name
});
}
/// @nodoc
class _$OrganizationCopyWithImpl<$Res>
implements $OrganizationCopyWith<$Res> {
_$OrganizationCopyWithImpl(this._self, this._then);
final Organization _self;
final $Res Function(Organization) _then;
/// Create a copy of Organization
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,}) {
return _then(_self.copyWith(
name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [Organization].
extension OrganizationPatterns on Organization {
/// 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( _Organization value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _Organization() 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( _Organization value) $default,){
final _that = this;
switch (_that) {
case _Organization():
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( _Organization value)? $default,){
final _that = this;
switch (_that) {
case _Organization() 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? name)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Organization() when $default != null:
return $default(_that.name);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? name) $default,) {final _that = this;
switch (_that) {
case _Organization():
return $default(_that.name);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? name)? $default,) {final _that = this;
switch (_that) {
case _Organization() when $default != null:
return $default(_that.name);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _Organization implements Organization {
const _Organization({required this.name});
factory _Organization.fromJson(Map<String, dynamic> json) => _$OrganizationFromJson(json);
@override final String? name;
/// Create a copy of Organization
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$OrganizationCopyWith<_Organization> get copyWith => __$OrganizationCopyWithImpl<_Organization>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$OrganizationToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Organization&&(identical(other.name, name) || other.name == name));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name);
@override
String toString() {
return 'Organization(name: $name)';
}
}
/// @nodoc
abstract mixin class _$OrganizationCopyWith<$Res> implements $OrganizationCopyWith<$Res> {
factory _$OrganizationCopyWith(_Organization value, $Res Function(_Organization) _then) = __$OrganizationCopyWithImpl;
@override @useResult
$Res call({
String? name
});
}
/// @nodoc
class __$OrganizationCopyWithImpl<$Res>
implements _$OrganizationCopyWith<$Res> {
__$OrganizationCopyWithImpl(this._self, this._then);
final _Organization _self;
final $Res Function(_Organization) _then;
/// Create a copy of Organization
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,}) {
return _then(_Organization(
name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on
@@ -0,0 +1,13 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'organization.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_Organization _$OrganizationFromJson(Map<String, dynamic> json) =>
_Organization(name: json['name'] as String?);
Map<String, dynamic> _$OrganizationToJson(_Organization instance) =>
<String, dynamic>{'name': instance.name};
@@ -1,6 +1,8 @@
// ignore_for_file: invalid_annotation_target // ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:tm_app/data/services/model/error/error_model.dart';
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
part 'tender_model.freezed.dart'; part 'tender_model.freezed.dart';
part 'tender_model.g.dart'; part 'tender_model.g.dart';
@@ -8,21 +10,14 @@ part 'tender_model.g.dart';
@freezed @freezed
abstract class TenderModel with _$TenderModel { abstract class TenderModel with _$TenderModel {
const factory TenderModel({ const factory TenderModel({
@JsonKey(name: 'created_time') required String? createdTime,
@JsonKey(name: 'tender_id') required String? tenderId, required bool? success,
required String? status, required String? message,
required String? title, required TenderData? data,
required String? description, required ErrorModel? error,
required String? location,
required String? type,
required String? deadline,
required bool? liked,
required bool? disliked,
required bool? rejected,
required bool? submitted,
@JsonKey(name: 'profile_match') required double? profileMatch, @JsonKey(name: 'profile_match') required double? profileMatch,
}) = _TenderModel; }) = _TenderModel;
factory TenderModel.fromJson(Map<String, Object?> json) => factory TenderModel.fromJson(Map<String, Object?> json) =>
_$TenderModelFromJson(json); _$TenderModelFromJson(json);
} }
@@ -0,0 +1,337 @@
// 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 'tender_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$TenderModel {
bool? get success; String? get message; TenderData? get data; ErrorModel? get error;@JsonKey(name: 'profile_match') double? get profileMatch;
/// 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<TenderModel> get copyWith => _$TenderModelCopyWithImpl<TenderModel>(this as TenderModel, _$identity);
/// Serializes this TenderModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderModel&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,success,message,data,error,profileMatch);
@override
String toString() {
return 'TenderModel(success: $success, message: $message, data: $data, error: $error, profileMatch: $profileMatch)';
}
}
/// @nodoc
abstract mixin class $TenderModelCopyWith<$Res> {
factory $TenderModelCopyWith(TenderModel value, $Res Function(TenderModel) _then) = _$TenderModelCopyWithImpl;
@useResult
$Res call({
bool? success, String? message, TenderData? data, ErrorModel? error,@JsonKey(name: 'profile_match') double? profileMatch
});
$TenderDataCopyWith<$Res>? get data;$ErrorModelCopyWith<$Res>? get error;
}
/// @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.
@pragma('vm:prefer-inline') @override $Res call({Object? success = freezed,Object? message = freezed,Object? data = freezed,Object? error = freezed,Object? profileMatch = freezed,}) {
return _then(_self.copyWith(
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
as TenderData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as ErrorModel?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable
as double?,
));
}
/// Create a copy of TenderModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$TenderDataCopyWith<$Res>? get data {
if (_self.data == null) {
return null;
}
return $TenderDataCopyWith<$Res>(_self.data!, (value) {
return _then(_self.copyWith(data: value));
});
}/// Create a copy of TenderModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ErrorModelCopyWith<$Res>? get error {
if (_self.error == null) {
return null;
}
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
return _then(_self.copyWith(error: value));
});
}
}
/// 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 extends Object?>(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 extends Object?>(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 extends Object?>(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 extends Object?>(TResult Function( bool? success, String? message, TenderData? data, ErrorModel? error, @JsonKey(name: 'profile_match') double? profileMatch)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _TenderModel() when $default != null:
return $default(_that.success,_that.message,_that.data,_that.error,_that.profileMatch);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( bool? success, String? message, TenderData? data, ErrorModel? error, @JsonKey(name: 'profile_match') double? profileMatch) $default,) {final _that = this;
switch (_that) {
case _TenderModel():
return $default(_that.success,_that.message,_that.data,_that.error,_that.profileMatch);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( bool? success, String? message, TenderData? data, ErrorModel? error, @JsonKey(name: 'profile_match') double? profileMatch)? $default,) {final _that = this;
switch (_that) {
case _TenderModel() when $default != null:
return $default(_that.success,_that.message,_that.data,_that.error,_that.profileMatch);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _TenderModel implements TenderModel {
const _TenderModel({required this.success, required this.message, required this.data, required this.error, @JsonKey(name: 'profile_match') required this.profileMatch});
factory _TenderModel.fromJson(Map<String, dynamic> json) => _$TenderModelFromJson(json);
@override final bool? success;
@override final String? message;
@override final TenderData? data;
@override final ErrorModel? error;
@override@JsonKey(name: 'profile_match') final double? profileMatch;
/// 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
Map<String, dynamic> toJson() {
return _$TenderModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderModel&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,success,message,data,error,profileMatch);
@override
String toString() {
return 'TenderModel(success: $success, message: $message, data: $data, error: $error, profileMatch: $profileMatch)';
}
}
/// @nodoc
abstract mixin class _$TenderModelCopyWith<$Res> implements $TenderModelCopyWith<$Res> {
factory _$TenderModelCopyWith(_TenderModel value, $Res Function(_TenderModel) _then) = __$TenderModelCopyWithImpl;
@override @useResult
$Res call({
bool? success, String? message, TenderData? data, ErrorModel? error,@JsonKey(name: 'profile_match') double? profileMatch
});
@override $TenderDataCopyWith<$Res>? get data;@override $ErrorModelCopyWith<$Res>? get error;
}
/// @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? success = freezed,Object? message = freezed,Object? data = freezed,Object? error = freezed,Object? profileMatch = freezed,}) {
return _then(_TenderModel(
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
as TenderData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as ErrorModel?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable
as double?,
));
}
/// Create a copy of TenderModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$TenderDataCopyWith<$Res>? get data {
if (_self.data == null) {
return null;
}
return $TenderDataCopyWith<$Res>(_self.data!, (value) {
return _then(_self.copyWith(data: value));
});
}/// Create a copy of TenderModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ErrorModelCopyWith<$Res>? get error {
if (_self.error == null) {
return null;
}
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
return _then(_self.copyWith(error: value));
});
}
}
// dart format on
@@ -0,0 +1,30 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tender_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_TenderModel _$TenderModelFromJson(Map<String, dynamic> json) => _TenderModel(
success: json['success'] as bool?,
message: json['message'] as String?,
data:
json['data'] == null
? null
: TenderData.fromJson(json['data'] as Map<String, dynamic>),
error:
json['error'] == null
? null
: ErrorModel.fromJson(json['error'] as Map<String, dynamic>),
profileMatch: (json['profile_match'] as num?)?.toDouble(),
);
Map<String, dynamic> _$TenderModelToJson(_TenderModel instance) =>
<String, dynamic>{
'success': instance.success,
'message': instance.message,
'data': instance.data,
'error': instance.error,
'profile_match': instance.profileMatch,
};
@@ -0,0 +1,34 @@
// ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:tm_app/data/services/model/organization/organization.dart';
part 'tender_data.freezed.dart';
part 'tender_data.g.dart';
@freezed
abstract class TenderData with _$TenderData {
const factory TenderData({
required bool? success,
required String? message,
required String? id,
@JsonKey(name: 'notice_publication_id') required String? noticePublicationId,
@JsonKey(name: 'publication_date') required int? publicationDate,
required String? title,
required String? description,
@JsonKey(name: 'procurement_type_code') required String? procurementTypeCode,
@JsonKey(name: 'procedure_code') required String? procedureCode,
@JsonKey(name: 'estimated_value') required int? estimatedValue,
required String? currency,
required String? duration,
required String? durationUnit,
@JsonKey(name: 'tender_deadline') required int? tenderDeadline,
@JsonKey(name: 'country_code') required String? countryCode,
@JsonKey(name: 'buyer_organization') required Organization? buyerOrganization,
required String? status,
}) = _TenderData;
factory TenderData.fromJson(Map<String, Object?> json) =>
_$TenderDataFromJson(json);
}
@@ -0,0 +1,349 @@
// 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 'tender_data.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$TenderData {
bool? get success; String? get message; String? get id;@JsonKey(name: 'notice_publication_id') String? get noticePublicationId;@JsonKey(name: 'publication_date') int? get publicationDate; String? get title; String? get description;@JsonKey(name: 'procurement_type_code') String? get procurementTypeCode;@JsonKey(name: 'procedure_code') String? get procedureCode;@JsonKey(name: 'estimated_value') int? get estimatedValue; String? get currency; String? get duration; String? get durationUnit;@JsonKey(name: 'tender_deadline') int? get tenderDeadline;@JsonKey(name: 'country_code') String? get countryCode;@JsonKey(name: 'buyer_organization') Organization? get buyerOrganization; String? get status;
/// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$TenderDataCopyWith<TenderData> get copyWith => _$TenderDataCopyWithImpl<TenderData>(this as TenderData, _$identity);
/// Serializes this TenderData to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,success,message,id,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,countryCode,buyerOrganization,status);
@override
String toString() {
return 'TenderData(success: $success, message: $message, id: $id, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)';
}
}
/// @nodoc
abstract mixin class $TenderDataCopyWith<$Res> {
factory $TenderDataCopyWith(TenderData value, $Res Function(TenderData) _then) = _$TenderDataCopyWithImpl;
@useResult
$Res call({
bool? success, String? message, String? id,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status
});
$OrganizationCopyWith<$Res>? get buyerOrganization;
}
/// @nodoc
class _$TenderDataCopyWithImpl<$Res>
implements $TenderDataCopyWith<$Res> {
_$TenderDataCopyWithImpl(this._self, this._then);
final TenderData _self;
final $Res Function(TenderData) _then;
/// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) {
return _then(_self.copyWith(
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,noticePublicationId: freezed == noticePublicationId ? _self.noticePublicationId : noticePublicationId // ignore: cast_nullable_to_non_nullable
as String?,publicationDate: freezed == publicationDate ? _self.publicationDate : publicationDate // ignore: cast_nullable_to_non_nullable
as int?,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?,procurementTypeCode: freezed == procurementTypeCode ? _self.procurementTypeCode : procurementTypeCode // ignore: cast_nullable_to_non_nullable
as String?,procedureCode: freezed == procedureCode ? _self.procedureCode : procedureCode // ignore: cast_nullable_to_non_nullable
as String?,estimatedValue: freezed == estimatedValue ? _self.estimatedValue : estimatedValue // ignore: cast_nullable_to_non_nullable
as int?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable
as String?,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable
as String?,durationUnit: freezed == durationUnit ? _self.durationUnit : durationUnit // ignore: cast_nullable_to_non_nullable
as String?,tenderDeadline: freezed == tenderDeadline ? _self.tenderDeadline : tenderDeadline // ignore: cast_nullable_to_non_nullable
as int?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
as String?,buyerOrganization: freezed == buyerOrganization ? _self.buyerOrganization : buyerOrganization // ignore: cast_nullable_to_non_nullable
as Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OrganizationCopyWith<$Res>? get buyerOrganization {
if (_self.buyerOrganization == null) {
return null;
}
return $OrganizationCopyWith<$Res>(_self.buyerOrganization!, (value) {
return _then(_self.copyWith(buyerOrganization: value));
});
}
}
/// Adds pattern-matching-related methods to [TenderData].
extension TenderDataPatterns on TenderData {
/// 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( _TenderData value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _TenderData() 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( _TenderData value) $default,){
final _that = this;
switch (_that) {
case _TenderData():
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( _TenderData value)? $default,){
final _that = this;
switch (_that) {
case _TenderData() 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( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _TenderData() when $default != null:
return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);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( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status) $default,) {final _that = this;
switch (_that) {
case _TenderData():
return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);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( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,) {final _that = this;
switch (_that) {
case _TenderData() when $default != null:
return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _TenderData implements TenderData {
const _TenderData({required this.success, required this.message, required this.id, @JsonKey(name: 'notice_publication_id') required this.noticePublicationId, @JsonKey(name: 'publication_date') required this.publicationDate, required this.title, required this.description, @JsonKey(name: 'procurement_type_code') required this.procurementTypeCode, @JsonKey(name: 'procedure_code') required this.procedureCode, @JsonKey(name: 'estimated_value') required this.estimatedValue, required this.currency, required this.duration, required this.durationUnit, @JsonKey(name: 'tender_deadline') required this.tenderDeadline, @JsonKey(name: 'country_code') required this.countryCode, @JsonKey(name: 'buyer_organization') required this.buyerOrganization, required this.status});
factory _TenderData.fromJson(Map<String, dynamic> json) => _$TenderDataFromJson(json);
@override final bool? success;
@override final String? message;
@override final String? id;
@override@JsonKey(name: 'notice_publication_id') final String? noticePublicationId;
@override@JsonKey(name: 'publication_date') final int? publicationDate;
@override final String? title;
@override final String? description;
@override@JsonKey(name: 'procurement_type_code') final String? procurementTypeCode;
@override@JsonKey(name: 'procedure_code') final String? procedureCode;
@override@JsonKey(name: 'estimated_value') final int? estimatedValue;
@override final String? currency;
@override final String? duration;
@override final String? durationUnit;
@override@JsonKey(name: 'tender_deadline') final int? tenderDeadline;
@override@JsonKey(name: 'country_code') final String? countryCode;
@override@JsonKey(name: 'buyer_organization') final Organization? buyerOrganization;
@override final String? status;
/// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$TenderDataCopyWith<_TenderData> get copyWith => __$TenderDataCopyWithImpl<_TenderData>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$TenderDataToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,success,message,id,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,countryCode,buyerOrganization,status);
@override
String toString() {
return 'TenderData(success: $success, message: $message, id: $id, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)';
}
}
/// @nodoc
abstract mixin class _$TenderDataCopyWith<$Res> implements $TenderDataCopyWith<$Res> {
factory _$TenderDataCopyWith(_TenderData value, $Res Function(_TenderData) _then) = __$TenderDataCopyWithImpl;
@override @useResult
$Res call({
bool? success, String? message, String? id,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status
});
@override $OrganizationCopyWith<$Res>? get buyerOrganization;
}
/// @nodoc
class __$TenderDataCopyWithImpl<$Res>
implements _$TenderDataCopyWith<$Res> {
__$TenderDataCopyWithImpl(this._self, this._then);
final _TenderData _self;
final $Res Function(_TenderData) _then;
/// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) {
return _then(_TenderData(
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,noticePublicationId: freezed == noticePublicationId ? _self.noticePublicationId : noticePublicationId // ignore: cast_nullable_to_non_nullable
as String?,publicationDate: freezed == publicationDate ? _self.publicationDate : publicationDate // ignore: cast_nullable_to_non_nullable
as int?,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?,procurementTypeCode: freezed == procurementTypeCode ? _self.procurementTypeCode : procurementTypeCode // ignore: cast_nullable_to_non_nullable
as String?,procedureCode: freezed == procedureCode ? _self.procedureCode : procedureCode // ignore: cast_nullable_to_non_nullable
as String?,estimatedValue: freezed == estimatedValue ? _self.estimatedValue : estimatedValue // ignore: cast_nullable_to_non_nullable
as int?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable
as String?,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable
as String?,durationUnit: freezed == durationUnit ? _self.durationUnit : durationUnit // ignore: cast_nullable_to_non_nullable
as String?,tenderDeadline: freezed == tenderDeadline ? _self.tenderDeadline : tenderDeadline // ignore: cast_nullable_to_non_nullable
as int?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
as String?,buyerOrganization: freezed == buyerOrganization ? _self.buyerOrganization : buyerOrganization // ignore: cast_nullable_to_non_nullable
as Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OrganizationCopyWith<$Res>? get buyerOrganization {
if (_self.buyerOrganization == null) {
return null;
}
return $OrganizationCopyWith<$Res>(_self.buyerOrganization!, (value) {
return _then(_self.copyWith(buyerOrganization: value));
});
}
}
// dart format on
@@ -0,0 +1,53 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tender_data.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_TenderData _$TenderDataFromJson(Map<String, dynamic> json) => _TenderData(
success: json['success'] as bool?,
message: json['message'] as String?,
id: json['id'] as String?,
noticePublicationId: json['notice_publication_id'] as String?,
publicationDate: (json['publication_date'] as num?)?.toInt(),
title: json['title'] as String?,
description: json['description'] as String?,
procurementTypeCode: json['procurement_type_code'] as String?,
procedureCode: json['procedure_code'] as String?,
estimatedValue: (json['estimated_value'] as num?)?.toInt(),
currency: json['currency'] as String?,
duration: json['duration'] as String?,
durationUnit: json['durationUnit'] as String?,
tenderDeadline: (json['tender_deadline'] as num?)?.toInt(),
countryCode: json['country_code'] as String?,
buyerOrganization:
json['buyer_organization'] == null
? null
: Organization.fromJson(
json['buyer_organization'] as Map<String, dynamic>,
),
status: json['status'] as String?,
);
Map<String, dynamic> _$TenderDataToJson(_TenderData instance) =>
<String, dynamic>{
'success': instance.success,
'message': instance.message,
'id': instance.id,
'notice_publication_id': instance.noticePublicationId,
'publication_date': instance.publicationDate,
'title': instance.title,
'description': instance.description,
'procurement_type_code': instance.procurementTypeCode,
'procedure_code': instance.procedureCode,
'estimated_value': instance.estimatedValue,
'currency': instance.currency,
'duration': instance.duration,
'durationUnit': instance.durationUnit,
'tender_deadline': instance.tenderDeadline,
'country_code': instance.countryCode,
'buyer_organization': instance.buyerOrganization,
'status': instance.status,
};
@@ -1,7 +1,7 @@
// ignore_for_file: invalid_annotation_target // ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
part 'tenders_response.freezed.dart'; part 'tenders_response.freezed.dart';
part 'tenders_response.g.dart'; part 'tenders_response.g.dart';
+1 -1
View File
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:tm_app/data/repositories/tenders_repository.dart'; import 'package:tm_app/data/repositories/tenders_repository.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
import 'package:tm_app/data/services/model/tenders/tender_dislike_response/tender_dislike_response.dart'; import 'package:tm_app/data/services/model/tenders/tender_dislike_response/tender_dislike_response.dart';
import 'package:tm_app/data/services/model/tenders/tender_like_response/tender_like_response.dart'; import 'package:tm_app/data/services/model/tenders/tender_like_response/tender_like_response.dart';
import 'package:tm_app/data/services/model/tenders/tender_reject_response/tender_reject_response.dart'; import 'package:tm_app/data/services/model/tenders/tender_reject_response/tender_reject_response.dart';
+1 -1
View File
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
import '../../core/constants/assets.dart'; import '../../core/constants/assets.dart';
import '../../core/theme/colors.dart'; import '../../core/theme/colors.dart';
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
import '../../../core/constants/assets.dart'; import '../../../core/constants/assets.dart';
import '../../../core/utils/size_config.dart'; import '../../../core/utils/size_config.dart';
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/constants/strings.dart'; import 'package:tm_app/core/constants/strings.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
import 'package:tm_app/view_models/tenders_view_model.dart'; import 'package:tm_app/view_models/tenders_view_model.dart';
import '../../../core/constants/assets.dart'; import '../../../core/constants/assets.dart';
+1 -1
View File
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/constants/strings.dart'; import 'package:tm_app/core/constants/strings.dart';
import 'package:tm_app/core/routes/app_routes.dart'; import 'package:tm_app/core/routes/app_routes.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart'; import 'package:tm_app/data/services/model/tender/tender_model.dart';
import '../../../core/constants/assets.dart'; import '../../../core/constants/assets.dart';
import '../../../core/theme/colors.dart'; import '../../../core/theme/colors.dart';
+8 -8
View File
@@ -37,10 +37,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.13.0" version: "2.12.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@@ -221,10 +221,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.3" version: "1.3.2"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
@@ -436,10 +436,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.9" version: "10.0.8"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
@@ -841,10 +841,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "15.0.0" version: "14.3.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description: