merge branches
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
import 'package:tm_app/core/utils/result.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_request/tender_detail_request.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_response/tender_detail_response_model.dart';
|
||||
import 'package:tm_app/data/services/tender_detail_service.dart';
|
||||
|
||||
import '../services/model/tender_detail_response/tender_detail_response_model.dart';
|
||||
|
||||
class TenderDetailRepository {
|
||||
TenderDetailRepository({required TenderDetailService tenderDetailService})
|
||||
: _tenderDetailService = tenderDetailService;
|
||||
: _tenderDetailService = tenderDetailService;
|
||||
|
||||
final TenderDetailService _tenderDetailService;
|
||||
|
||||
Future<Result<TenderDetailResponseModel>> getTenderDetail({
|
||||
required TenderDetailRequest request,
|
||||
}) async {
|
||||
return await _tenderDetailService.getTenderDetail(request: request);
|
||||
}
|
||||
|
||||
Future<Result<TenderDetailResponseModel>> getTenderDetail({
|
||||
required String tenderId,
|
||||
}) async {
|
||||
return _tenderDetailService.getTenderDetails(tenderId: tenderId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:tm_app/data/services/model/tenders/tender_dislike_response/tende
|
||||
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_submit_response/tender_submit_response.dart';
|
||||
import 'package:tm_app/data/services/model/tenders/tenders_request/tenders_request.dart';
|
||||
import 'package:tm_app/data/services/model/tenders/tenders_response/tenders_response.dart';
|
||||
import 'package:tm_app/data/services/tenders_service.dart';
|
||||
|
||||
@@ -12,10 +11,8 @@ class TendersRepository {
|
||||
: _tendersService = tendersService;
|
||||
final TendersService _tendersService;
|
||||
|
||||
Future<Result<TendersResponse>> getTenders({
|
||||
TendersRequest? tendersRequestModel,
|
||||
}) async {
|
||||
return _tendersService.getTenders(tendersRequestModel: tendersRequestModel);
|
||||
Future<Result<TendersResponse>> getTenders() async {
|
||||
return _tendersService.getTenders();
|
||||
}
|
||||
|
||||
Future<Result<TenderLikeResponse>> likeTender() async {
|
||||
|
||||
@@ -22,7 +22,7 @@ class AuthService {
|
||||
var data = jsonEncode({"password": password, "username": username});
|
||||
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/admin/v1/profile/login',
|
||||
'/api/v1/profile/login',
|
||||
method: 'POST',
|
||||
(json) => LoginResponseModel.fromJson(json),
|
||||
data: data,
|
||||
@@ -31,14 +31,14 @@ class AuthService {
|
||||
if (result is Ok<LoginResponseModel>) {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final token = result.value.data.accessToken;
|
||||
await prefs.setString('bearer', token);
|
||||
await prefs.setString('bearer', token!);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<Result<LogoutResponse>> logout() async {
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/admin/v1/profile/logout',
|
||||
'/api/v1/profile/logout',
|
||||
method: 'DELETE',
|
||||
(json) => LogoutResponse.fromJson(json),
|
||||
);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'address.freezed.dart';
|
||||
part 'address.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
const factory Address({
|
||||
required String? street,
|
||||
required String? city,
|
||||
required String? state,
|
||||
@JsonKey(name: 'postal_code') required String? postalCode,
|
||||
required String? country,
|
||||
@JsonKey(name: 'address_type') required String? addressType,
|
||||
@JsonKey(name: 'is_default') required bool? isDefault,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, Object?> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
// 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 'address.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Address {
|
||||
|
||||
String? get street; String? get city; String? get state;@JsonKey(name: 'postal_code') String? get postalCode; String? get country;@JsonKey(name: 'address_type') String? get addressType;@JsonKey(name: 'is_default') bool? get isDefault;
|
||||
/// Create a copy of Address
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$AddressCopyWith<Address> get copyWith => _$AddressCopyWithImpl<Address>(this as Address, _$identity);
|
||||
|
||||
/// Serializes this Address to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.street, street) || other.street == street)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.country, country) || other.country == country)&&(identical(other.addressType, addressType) || other.addressType == addressType)&&(identical(other.isDefault, isDefault) || other.isDefault == isDefault));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,street,city,state,postalCode,country,addressType,isDefault);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Address(street: $street, city: $city, state: $state, postalCode: $postalCode, country: $country, addressType: $addressType, isDefault: $isDefault)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $AddressCopyWith<$Res> {
|
||||
factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? street, String? city, String? state,@JsonKey(name: 'postal_code') String? postalCode, String? country,@JsonKey(name: 'address_type') String? addressType,@JsonKey(name: 'is_default') bool? isDefault
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$AddressCopyWithImpl<$Res>
|
||||
implements $AddressCopyWith<$Res> {
|
||||
_$AddressCopyWithImpl(this._self, this._then);
|
||||
|
||||
final Address _self;
|
||||
final $Res Function(Address) _then;
|
||||
|
||||
/// Create a copy of Address
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? street = freezed,Object? city = freezed,Object? state = freezed,Object? postalCode = freezed,Object? country = freezed,Object? addressType = freezed,Object? isDefault = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
street: freezed == street ? _self.street : street // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
|
||||
as String?,addressType: freezed == addressType ? _self.addressType : addressType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,isDefault: freezed == isDefault ? _self.isDefault : isDefault // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [Address].
|
||||
extension AddressPatterns on Address {
|
||||
/// 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( _Address value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Address() 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( _Address value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Address():
|
||||
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( _Address value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Address() 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? street, String? city, String? state, @JsonKey(name: 'postal_code') String? postalCode, String? country, @JsonKey(name: 'address_type') String? addressType, @JsonKey(name: 'is_default') bool? isDefault)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Address() when $default != null:
|
||||
return $default(_that.street,_that.city,_that.state,_that.postalCode,_that.country,_that.addressType,_that.isDefault);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? street, String? city, String? state, @JsonKey(name: 'postal_code') String? postalCode, String? country, @JsonKey(name: 'address_type') String? addressType, @JsonKey(name: 'is_default') bool? isDefault) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Address():
|
||||
return $default(_that.street,_that.city,_that.state,_that.postalCode,_that.country,_that.addressType,_that.isDefault);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? street, String? city, String? state, @JsonKey(name: 'postal_code') String? postalCode, String? country, @JsonKey(name: 'address_type') String? addressType, @JsonKey(name: 'is_default') bool? isDefault)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Address() when $default != null:
|
||||
return $default(_that.street,_that.city,_that.state,_that.postalCode,_that.country,_that.addressType,_that.isDefault);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _Address implements Address {
|
||||
const _Address({required this.street, required this.city, required this.state, @JsonKey(name: 'postal_code') required this.postalCode, required this.country, @JsonKey(name: 'address_type') required this.addressType, @JsonKey(name: 'is_default') required this.isDefault});
|
||||
factory _Address.fromJson(Map<String, dynamic> json) => _$AddressFromJson(json);
|
||||
|
||||
@override final String? street;
|
||||
@override final String? city;
|
||||
@override final String? state;
|
||||
@override@JsonKey(name: 'postal_code') final String? postalCode;
|
||||
@override final String? country;
|
||||
@override@JsonKey(name: 'address_type') final String? addressType;
|
||||
@override@JsonKey(name: 'is_default') final bool? isDefault;
|
||||
|
||||
/// Create a copy of Address
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$AddressToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.street, street) || other.street == street)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.country, country) || other.country == country)&&(identical(other.addressType, addressType) || other.addressType == addressType)&&(identical(other.isDefault, isDefault) || other.isDefault == isDefault));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,street,city,state,postalCode,country,addressType,isDefault);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Address(street: $street, city: $city, state: $state, postalCode: $postalCode, country: $country, addressType: $addressType, isDefault: $isDefault)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> {
|
||||
factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? street, String? city, String? state,@JsonKey(name: 'postal_code') String? postalCode, String? country,@JsonKey(name: 'address_type') String? addressType,@JsonKey(name: 'is_default') bool? isDefault
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$AddressCopyWithImpl<$Res>
|
||||
implements _$AddressCopyWith<$Res> {
|
||||
__$AddressCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _Address _self;
|
||||
final $Res Function(_Address) _then;
|
||||
|
||||
/// Create a copy of Address
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? street = freezed,Object? city = freezed,Object? state = freezed,Object? postalCode = freezed,Object? country = freezed,Object? addressType = freezed,Object? isDefault = freezed,}) {
|
||||
return _then(_Address(
|
||||
street: freezed == street ? _self.street : street // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
|
||||
as String?,addressType: freezed == addressType ? _self.addressType : addressType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,isDefault: freezed == isDefault ? _self.isDefault : isDefault // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,27 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'address.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
street: json['street'] as String?,
|
||||
city: json['city'] as String?,
|
||||
state: json['state'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
country: json['country'] as String?,
|
||||
addressType: json['address_type'] as String?,
|
||||
isDefault: json['is_default'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||
'street': instance.street,
|
||||
'city': instance.city,
|
||||
'state': instance.state,
|
||||
'postal_code': instance.postalCode,
|
||||
'country': instance.country,
|
||||
'address_type': instance.addressType,
|
||||
'is_default': instance.isDefault,
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'contact_person.freezed.dart';
|
||||
part 'contact_person.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ContactPerson with _$ContactPerson {
|
||||
const factory ContactPerson({
|
||||
@JsonKey(name: 'first_name') required String? firstName,
|
||||
@JsonKey(name: 'last_name') required String? lastName,
|
||||
@JsonKey(name: 'full_name') required String? fullName,
|
||||
required String? position,
|
||||
required String? email,
|
||||
required String? phone,
|
||||
required String? mobile,
|
||||
@JsonKey(name: 'is_primary') required bool? isPrimary,
|
||||
}) = _ContactPerson;
|
||||
|
||||
factory ContactPerson.fromJson(Map<String, Object?> json) =>
|
||||
_$ContactPersonFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
// 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 'contact_person.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ContactPerson {
|
||||
|
||||
@JsonKey(name: 'first_name') String? get firstName;@JsonKey(name: 'last_name') String? get lastName;@JsonKey(name: 'full_name') String? get fullName; String? get position; String? get email; String? get phone; String? get mobile;@JsonKey(name: 'is_primary') bool? get isPrimary;
|
||||
/// Create a copy of ContactPerson
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ContactPersonCopyWith<ContactPerson> get copyWith => _$ContactPersonCopyWithImpl<ContactPerson>(this as ContactPerson, _$identity);
|
||||
|
||||
/// Serializes this ContactPerson to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ContactPerson&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.position, position) || other.position == position)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.isPrimary, isPrimary) || other.isPrimary == isPrimary));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,firstName,lastName,fullName,position,email,phone,mobile,isPrimary);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ContactPerson(firstName: $firstName, lastName: $lastName, fullName: $fullName, position: $position, email: $email, phone: $phone, mobile: $mobile, isPrimary: $isPrimary)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ContactPersonCopyWith<$Res> {
|
||||
factory $ContactPersonCopyWith(ContactPerson value, $Res Function(ContactPerson) _then) = _$ContactPersonCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'first_name') String? firstName,@JsonKey(name: 'last_name') String? lastName,@JsonKey(name: 'full_name') String? fullName, String? position, String? email, String? phone, String? mobile,@JsonKey(name: 'is_primary') bool? isPrimary
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ContactPersonCopyWithImpl<$Res>
|
||||
implements $ContactPersonCopyWith<$Res> {
|
||||
_$ContactPersonCopyWithImpl(this._self, this._then);
|
||||
|
||||
final ContactPerson _self;
|
||||
final $Res Function(ContactPerson) _then;
|
||||
|
||||
/// Create a copy of ContactPerson
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? firstName = freezed,Object? lastName = freezed,Object? fullName = freezed,Object? position = freezed,Object? email = freezed,Object? phone = freezed,Object? mobile = freezed,Object? isPrimary = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,position: freezed == position ? _self.position : position // ignore: cast_nullable_to_non_nullable
|
||||
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,isPrimary: freezed == isPrimary ? _self.isPrimary : isPrimary // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [ContactPerson].
|
||||
extension ContactPersonPatterns on ContactPerson {
|
||||
/// 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( _ContactPerson value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ContactPerson() 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( _ContactPerson value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ContactPerson():
|
||||
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( _ContactPerson value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ContactPerson() 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: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? position, String? email, String? phone, String? mobile, @JsonKey(name: 'is_primary') bool? isPrimary)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ContactPerson() when $default != null:
|
||||
return $default(_that.firstName,_that.lastName,_that.fullName,_that.position,_that.email,_that.phone,_that.mobile,_that.isPrimary);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: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? position, String? email, String? phone, String? mobile, @JsonKey(name: 'is_primary') bool? isPrimary) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ContactPerson():
|
||||
return $default(_that.firstName,_that.lastName,_that.fullName,_that.position,_that.email,_that.phone,_that.mobile,_that.isPrimary);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: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? position, String? email, String? phone, String? mobile, @JsonKey(name: 'is_primary') bool? isPrimary)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ContactPerson() when $default != null:
|
||||
return $default(_that.firstName,_that.lastName,_that.fullName,_that.position,_that.email,_that.phone,_that.mobile,_that.isPrimary);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _ContactPerson implements ContactPerson {
|
||||
const _ContactPerson({@JsonKey(name: 'first_name') required this.firstName, @JsonKey(name: 'last_name') required this.lastName, @JsonKey(name: 'full_name') required this.fullName, required this.position, required this.email, required this.phone, required this.mobile, @JsonKey(name: 'is_primary') required this.isPrimary});
|
||||
factory _ContactPerson.fromJson(Map<String, dynamic> json) => _$ContactPersonFromJson(json);
|
||||
|
||||
@override@JsonKey(name: 'first_name') final String? firstName;
|
||||
@override@JsonKey(name: 'last_name') final String? lastName;
|
||||
@override@JsonKey(name: 'full_name') final String? fullName;
|
||||
@override final String? position;
|
||||
@override final String? email;
|
||||
@override final String? phone;
|
||||
@override final String? mobile;
|
||||
@override@JsonKey(name: 'is_primary') final bool? isPrimary;
|
||||
|
||||
/// Create a copy of ContactPerson
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ContactPersonCopyWith<_ContactPerson> get copyWith => __$ContactPersonCopyWithImpl<_ContactPerson>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$ContactPersonToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ContactPerson&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.position, position) || other.position == position)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.isPrimary, isPrimary) || other.isPrimary == isPrimary));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,firstName,lastName,fullName,position,email,phone,mobile,isPrimary);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ContactPerson(firstName: $firstName, lastName: $lastName, fullName: $fullName, position: $position, email: $email, phone: $phone, mobile: $mobile, isPrimary: $isPrimary)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ContactPersonCopyWith<$Res> implements $ContactPersonCopyWith<$Res> {
|
||||
factory _$ContactPersonCopyWith(_ContactPerson value, $Res Function(_ContactPerson) _then) = __$ContactPersonCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'first_name') String? firstName,@JsonKey(name: 'last_name') String? lastName,@JsonKey(name: 'full_name') String? fullName, String? position, String? email, String? phone, String? mobile,@JsonKey(name: 'is_primary') bool? isPrimary
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ContactPersonCopyWithImpl<$Res>
|
||||
implements _$ContactPersonCopyWith<$Res> {
|
||||
__$ContactPersonCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _ContactPerson _self;
|
||||
final $Res Function(_ContactPerson) _then;
|
||||
|
||||
/// Create a copy of ContactPerson
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? firstName = freezed,Object? lastName = freezed,Object? fullName = freezed,Object? position = freezed,Object? email = freezed,Object? phone = freezed,Object? mobile = freezed,Object? isPrimary = freezed,}) {
|
||||
return _then(_ContactPerson(
|
||||
firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,position: freezed == position ? _self.position : position // ignore: cast_nullable_to_non_nullable
|
||||
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,isPrimary: freezed == isPrimary ? _self.isPrimary : isPrimary // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,31 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'contact_person.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ContactPerson _$ContactPersonFromJson(Map<String, dynamic> json) =>
|
||||
_ContactPerson(
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
fullName: json['full_name'] as String?,
|
||||
position: json['position'] as String?,
|
||||
email: json['email'] as String?,
|
||||
phone: json['phone'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
isPrimary: json['is_primary'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ContactPersonToJson(_ContactPerson instance) =>
|
||||
<String, dynamic>{
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'full_name': instance.fullName,
|
||||
'position': instance.position,
|
||||
'email': instance.email,
|
||||
'phone': instance.phone,
|
||||
'mobile': instance.mobile,
|
||||
'is_primary': instance.isPrimary,
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../address/address.dart';
|
||||
import '../contact_person/contact_person.dart';
|
||||
|
||||
part 'customer.freezed.dart';
|
||||
part 'customer.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class Customer with _$Customer {
|
||||
const factory Customer({
|
||||
required String? id,
|
||||
required String? type,
|
||||
required String? status,
|
||||
@JsonKey(name: 'first_name') required String? firstName,
|
||||
@JsonKey(name: 'last_name') required String? lastName,
|
||||
@JsonKey(name: 'full_name') required String? fullName,
|
||||
required String? email,
|
||||
required String? phone,
|
||||
required String? mobile,
|
||||
@JsonKey(name: 'registration_number') required String? registrationNumber,
|
||||
@JsonKey(name: 'tax_id') required String? taxId,
|
||||
required String? industry,
|
||||
@JsonKey(name: 'business_type') required String? businessType,
|
||||
@JsonKey(name: 'employee_count') required int? employeeCount,
|
||||
@JsonKey(name: 'annual_revenue') required int? annualRevenue,
|
||||
@JsonKey(name: 'founded_year') required int? foundedYear,
|
||||
@JsonKey(name: 'is_verified') required bool? isVerified,
|
||||
@JsonKey(name: 'is_compliant') required bool? isCompliant,
|
||||
@JsonKey(name: 'compliance_notes') required String? complianceNotes,
|
||||
required String? language,
|
||||
required String? username,
|
||||
required String? currency,
|
||||
required String? timezone,
|
||||
@JsonKey(name: 'created_at') required int? createdAt,
|
||||
@JsonKey(name: 'updated_at') required int? updatedAt,
|
||||
@JsonKey(name: 'created_by') required String? createdBy,
|
||||
@JsonKey(name: 'updated_by') required String? updatedBy,
|
||||
required Address? address,
|
||||
required ContactPerson? contactPersons,
|
||||
}) = _Customer;
|
||||
|
||||
factory Customer.fromJson(Map<String, Object?> json) =>
|
||||
_$CustomerFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,409 @@
|
||||
// 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 'customer.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Customer {
|
||||
|
||||
String? get id; String? get type; String? get status;@JsonKey(name: 'first_name') String? get firstName;@JsonKey(name: 'last_name') String? get lastName;@JsonKey(name: 'full_name') String? get fullName; String? get email; String? get phone; String? get mobile;@JsonKey(name: 'registration_number') String? get registrationNumber;@JsonKey(name: 'tax_id') String? get taxId; String? get industry;@JsonKey(name: 'business_type') String? get businessType;@JsonKey(name: 'employee_count') int? get employeeCount;@JsonKey(name: 'annual_revenue') int? get annualRevenue;@JsonKey(name: 'founded_year') int? get foundedYear;@JsonKey(name: 'is_verified') bool? get isVerified;@JsonKey(name: 'is_compliant') bool? get isCompliant;@JsonKey(name: 'compliance_notes') String? get complianceNotes; String? get language; String? get username; String? get currency; String? get timezone;@JsonKey(name: 'created_at') int? get createdAt;@JsonKey(name: 'updated_at') int? get updatedAt;@JsonKey(name: 'created_by') String? get createdBy;@JsonKey(name: 'updated_by') String? get updatedBy; Address? get address; ContactPerson? get contactPersons;
|
||||
/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$CustomerCopyWith<Customer> get copyWith => _$CustomerCopyWithImpl<Customer>(this as Customer, _$identity);
|
||||
|
||||
/// Serializes this Customer to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is Customer&&(identical(other.id, id) || other.id == id)&&(identical(other.type, type) || other.type == type)&&(identical(other.status, status) || other.status == status)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.registrationNumber, registrationNumber) || other.registrationNumber == registrationNumber)&&(identical(other.taxId, taxId) || other.taxId == taxId)&&(identical(other.industry, industry) || other.industry == industry)&&(identical(other.businessType, businessType) || other.businessType == businessType)&&(identical(other.employeeCount, employeeCount) || other.employeeCount == employeeCount)&&(identical(other.annualRevenue, annualRevenue) || other.annualRevenue == annualRevenue)&&(identical(other.foundedYear, foundedYear) || other.foundedYear == foundedYear)&&(identical(other.isVerified, isVerified) || other.isVerified == isVerified)&&(identical(other.isCompliant, isCompliant) || other.isCompliant == isCompliant)&&(identical(other.complianceNotes, complianceNotes) || other.complianceNotes == complianceNotes)&&(identical(other.language, language) || other.language == language)&&(identical(other.username, username) || other.username == username)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.updatedBy, updatedBy) || other.updatedBy == updatedBy)&&(identical(other.address, address) || other.address == address)&&(identical(other.contactPersons, contactPersons) || other.contactPersons == contactPersons));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,type,status,firstName,lastName,fullName,email,phone,mobile,registrationNumber,taxId,industry,businessType,employeeCount,annualRevenue,foundedYear,isVerified,isCompliant,complianceNotes,language,username,currency,timezone,createdAt,updatedAt,createdBy,updatedBy,address,contactPersons]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Customer(id: $id, type: $type, status: $status, firstName: $firstName, lastName: $lastName, fullName: $fullName, email: $email, phone: $phone, mobile: $mobile, registrationNumber: $registrationNumber, taxId: $taxId, industry: $industry, businessType: $businessType, employeeCount: $employeeCount, annualRevenue: $annualRevenue, foundedYear: $foundedYear, isVerified: $isVerified, isCompliant: $isCompliant, complianceNotes: $complianceNotes, language: $language, username: $username, currency: $currency, timezone: $timezone, createdAt: $createdAt, updatedAt: $updatedAt, createdBy: $createdBy, updatedBy: $updatedBy, address: $address, contactPersons: $contactPersons)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $CustomerCopyWith<$Res> {
|
||||
factory $CustomerCopyWith(Customer value, $Res Function(Customer) _then) = _$CustomerCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? id, String? type, String? status,@JsonKey(name: 'first_name') String? firstName,@JsonKey(name: 'last_name') String? lastName,@JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile,@JsonKey(name: 'registration_number') String? registrationNumber,@JsonKey(name: 'tax_id') String? taxId, String? industry,@JsonKey(name: 'business_type') String? businessType,@JsonKey(name: 'employee_count') int? employeeCount,@JsonKey(name: 'annual_revenue') int? annualRevenue,@JsonKey(name: 'founded_year') int? foundedYear,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'is_compliant') bool? isCompliant,@JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? timezone,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt,@JsonKey(name: 'created_by') String? createdBy,@JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons
|
||||
});
|
||||
|
||||
|
||||
$AddressCopyWith<$Res>? get address;$ContactPersonCopyWith<$Res>? get contactPersons;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$CustomerCopyWithImpl<$Res>
|
||||
implements $CustomerCopyWith<$Res> {
|
||||
_$CustomerCopyWithImpl(this._self, this._then);
|
||||
|
||||
final Customer _self;
|
||||
final $Res Function(Customer) _then;
|
||||
|
||||
/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? type = freezed,Object? status = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? fullName = freezed,Object? email = freezed,Object? phone = freezed,Object? mobile = freezed,Object? registrationNumber = freezed,Object? taxId = freezed,Object? industry = freezed,Object? businessType = freezed,Object? employeeCount = freezed,Object? annualRevenue = freezed,Object? foundedYear = freezed,Object? isVerified = freezed,Object? isCompliant = freezed,Object? complianceNotes = freezed,Object? language = freezed,Object? username = freezed,Object? currency = freezed,Object? timezone = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,Object? createdBy = freezed,Object? updatedBy = freezed,Object? address = freezed,Object? contactPersons = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,registrationNumber: freezed == registrationNumber ? _self.registrationNumber : registrationNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,taxId: freezed == taxId ? _self.taxId : taxId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,industry: freezed == industry ? _self.industry : industry // ignore: cast_nullable_to_non_nullable
|
||||
as String?,businessType: freezed == businessType ? _self.businessType : businessType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,employeeCount: freezed == employeeCount ? _self.employeeCount : employeeCount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,annualRevenue: freezed == annualRevenue ? _self.annualRevenue : annualRevenue // ignore: cast_nullable_to_non_nullable
|
||||
as int?,foundedYear: freezed == foundedYear ? _self.foundedYear : foundedYear // ignore: cast_nullable_to_non_nullable
|
||||
as int?,isVerified: freezed == isVerified ? _self.isVerified : isVerified // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,isCompliant: freezed == isCompliant ? _self.isCompliant : isCompliant // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,complianceNotes: freezed == complianceNotes ? _self.complianceNotes : complianceNotes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,language: freezed == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
|
||||
as String?,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable
|
||||
as String?,timezone: freezed == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as int?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as int?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as String?,updatedBy: freezed == updatedBy ? _self.updatedBy : updatedBy // ignore: cast_nullable_to_non_nullable
|
||||
as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as Address?,contactPersons: freezed == contactPersons ? _self.contactPersons : contactPersons // ignore: cast_nullable_to_non_nullable
|
||||
as ContactPerson?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$AddressCopyWith<$Res>? get address {
|
||||
if (_self.address == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $AddressCopyWith<$Res>(_self.address!, (value) {
|
||||
return _then(_self.copyWith(address: value));
|
||||
});
|
||||
}/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ContactPersonCopyWith<$Res>? get contactPersons {
|
||||
if (_self.contactPersons == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ContactPersonCopyWith<$Res>(_self.contactPersons!, (value) {
|
||||
return _then(_self.copyWith(contactPersons: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [Customer].
|
||||
extension CustomerPatterns on Customer {
|
||||
/// 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( _Customer value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Customer() 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( _Customer value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Customer():
|
||||
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( _Customer value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Customer() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? id, String? type, String? status, @JsonKey(name: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile, @JsonKey(name: 'registration_number') String? registrationNumber, @JsonKey(name: 'tax_id') String? taxId, String? industry, @JsonKey(name: 'business_type') String? businessType, @JsonKey(name: 'employee_count') int? employeeCount, @JsonKey(name: 'annual_revenue') int? annualRevenue, @JsonKey(name: 'founded_year') int? foundedYear, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'is_compliant') bool? isCompliant, @JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? timezone, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt, @JsonKey(name: 'created_by') String? createdBy, @JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Customer() when $default != null:
|
||||
return $default(_that.id,_that.type,_that.status,_that.firstName,_that.lastName,_that.fullName,_that.email,_that.phone,_that.mobile,_that.registrationNumber,_that.taxId,_that.industry,_that.businessType,_that.employeeCount,_that.annualRevenue,_that.foundedYear,_that.isVerified,_that.isCompliant,_that.complianceNotes,_that.language,_that.username,_that.currency,_that.timezone,_that.createdAt,_that.updatedAt,_that.createdBy,_that.updatedBy,_that.address,_that.contactPersons);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? id, String? type, String? status, @JsonKey(name: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile, @JsonKey(name: 'registration_number') String? registrationNumber, @JsonKey(name: 'tax_id') String? taxId, String? industry, @JsonKey(name: 'business_type') String? businessType, @JsonKey(name: 'employee_count') int? employeeCount, @JsonKey(name: 'annual_revenue') int? annualRevenue, @JsonKey(name: 'founded_year') int? foundedYear, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'is_compliant') bool? isCompliant, @JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? timezone, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt, @JsonKey(name: 'created_by') String? createdBy, @JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Customer():
|
||||
return $default(_that.id,_that.type,_that.status,_that.firstName,_that.lastName,_that.fullName,_that.email,_that.phone,_that.mobile,_that.registrationNumber,_that.taxId,_that.industry,_that.businessType,_that.employeeCount,_that.annualRevenue,_that.foundedYear,_that.isVerified,_that.isCompliant,_that.complianceNotes,_that.language,_that.username,_that.currency,_that.timezone,_that.createdAt,_that.updatedAt,_that.createdBy,_that.updatedBy,_that.address,_that.contactPersons);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? id, String? type, String? status, @JsonKey(name: 'first_name') String? firstName, @JsonKey(name: 'last_name') String? lastName, @JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile, @JsonKey(name: 'registration_number') String? registrationNumber, @JsonKey(name: 'tax_id') String? taxId, String? industry, @JsonKey(name: 'business_type') String? businessType, @JsonKey(name: 'employee_count') int? employeeCount, @JsonKey(name: 'annual_revenue') int? annualRevenue, @JsonKey(name: 'founded_year') int? foundedYear, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'is_compliant') bool? isCompliant, @JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? timezone, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt, @JsonKey(name: 'created_by') String? createdBy, @JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Customer() when $default != null:
|
||||
return $default(_that.id,_that.type,_that.status,_that.firstName,_that.lastName,_that.fullName,_that.email,_that.phone,_that.mobile,_that.registrationNumber,_that.taxId,_that.industry,_that.businessType,_that.employeeCount,_that.annualRevenue,_that.foundedYear,_that.isVerified,_that.isCompliant,_that.complianceNotes,_that.language,_that.username,_that.currency,_that.timezone,_that.createdAt,_that.updatedAt,_that.createdBy,_that.updatedBy,_that.address,_that.contactPersons);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _Customer implements Customer {
|
||||
const _Customer({required this.id, required this.type, required this.status, @JsonKey(name: 'first_name') required this.firstName, @JsonKey(name: 'last_name') required this.lastName, @JsonKey(name: 'full_name') required this.fullName, required this.email, required this.phone, required this.mobile, @JsonKey(name: 'registration_number') required this.registrationNumber, @JsonKey(name: 'tax_id') required this.taxId, required this.industry, @JsonKey(name: 'business_type') required this.businessType, @JsonKey(name: 'employee_count') required this.employeeCount, @JsonKey(name: 'annual_revenue') required this.annualRevenue, @JsonKey(name: 'founded_year') required this.foundedYear, @JsonKey(name: 'is_verified') required this.isVerified, @JsonKey(name: 'is_compliant') required this.isCompliant, @JsonKey(name: 'compliance_notes') required this.complianceNotes, required this.language, required this.username, required this.currency, required this.timezone, @JsonKey(name: 'created_at') required this.createdAt, @JsonKey(name: 'updated_at') required this.updatedAt, @JsonKey(name: 'created_by') required this.createdBy, @JsonKey(name: 'updated_by') required this.updatedBy, required this.address, required this.contactPersons});
|
||||
factory _Customer.fromJson(Map<String, dynamic> json) => _$CustomerFromJson(json);
|
||||
|
||||
@override final String? id;
|
||||
@override final String? type;
|
||||
@override final String? status;
|
||||
@override@JsonKey(name: 'first_name') final String? firstName;
|
||||
@override@JsonKey(name: 'last_name') final String? lastName;
|
||||
@override@JsonKey(name: 'full_name') final String? fullName;
|
||||
@override final String? email;
|
||||
@override final String? phone;
|
||||
@override final String? mobile;
|
||||
@override@JsonKey(name: 'registration_number') final String? registrationNumber;
|
||||
@override@JsonKey(name: 'tax_id') final String? taxId;
|
||||
@override final String? industry;
|
||||
@override@JsonKey(name: 'business_type') final String? businessType;
|
||||
@override@JsonKey(name: 'employee_count') final int? employeeCount;
|
||||
@override@JsonKey(name: 'annual_revenue') final int? annualRevenue;
|
||||
@override@JsonKey(name: 'founded_year') final int? foundedYear;
|
||||
@override@JsonKey(name: 'is_verified') final bool? isVerified;
|
||||
@override@JsonKey(name: 'is_compliant') final bool? isCompliant;
|
||||
@override@JsonKey(name: 'compliance_notes') final String? complianceNotes;
|
||||
@override final String? language;
|
||||
@override final String? username;
|
||||
@override final String? currency;
|
||||
@override final String? timezone;
|
||||
@override@JsonKey(name: 'created_at') final int? createdAt;
|
||||
@override@JsonKey(name: 'updated_at') final int? updatedAt;
|
||||
@override@JsonKey(name: 'created_by') final String? createdBy;
|
||||
@override@JsonKey(name: 'updated_by') final String? updatedBy;
|
||||
@override final Address? address;
|
||||
@override final ContactPerson? contactPersons;
|
||||
|
||||
/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$CustomerCopyWith<_Customer> get copyWith => __$CustomerCopyWithImpl<_Customer>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$CustomerToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Customer&&(identical(other.id, id) || other.id == id)&&(identical(other.type, type) || other.type == type)&&(identical(other.status, status) || other.status == status)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.registrationNumber, registrationNumber) || other.registrationNumber == registrationNumber)&&(identical(other.taxId, taxId) || other.taxId == taxId)&&(identical(other.industry, industry) || other.industry == industry)&&(identical(other.businessType, businessType) || other.businessType == businessType)&&(identical(other.employeeCount, employeeCount) || other.employeeCount == employeeCount)&&(identical(other.annualRevenue, annualRevenue) || other.annualRevenue == annualRevenue)&&(identical(other.foundedYear, foundedYear) || other.foundedYear == foundedYear)&&(identical(other.isVerified, isVerified) || other.isVerified == isVerified)&&(identical(other.isCompliant, isCompliant) || other.isCompliant == isCompliant)&&(identical(other.complianceNotes, complianceNotes) || other.complianceNotes == complianceNotes)&&(identical(other.language, language) || other.language == language)&&(identical(other.username, username) || other.username == username)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.updatedBy, updatedBy) || other.updatedBy == updatedBy)&&(identical(other.address, address) || other.address == address)&&(identical(other.contactPersons, contactPersons) || other.contactPersons == contactPersons));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,type,status,firstName,lastName,fullName,email,phone,mobile,registrationNumber,taxId,industry,businessType,employeeCount,annualRevenue,foundedYear,isVerified,isCompliant,complianceNotes,language,username,currency,timezone,createdAt,updatedAt,createdBy,updatedBy,address,contactPersons]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Customer(id: $id, type: $type, status: $status, firstName: $firstName, lastName: $lastName, fullName: $fullName, email: $email, phone: $phone, mobile: $mobile, registrationNumber: $registrationNumber, taxId: $taxId, industry: $industry, businessType: $businessType, employeeCount: $employeeCount, annualRevenue: $annualRevenue, foundedYear: $foundedYear, isVerified: $isVerified, isCompliant: $isCompliant, complianceNotes: $complianceNotes, language: $language, username: $username, currency: $currency, timezone: $timezone, createdAt: $createdAt, updatedAt: $updatedAt, createdBy: $createdBy, updatedBy: $updatedBy, address: $address, contactPersons: $contactPersons)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$CustomerCopyWith<$Res> implements $CustomerCopyWith<$Res> {
|
||||
factory _$CustomerCopyWith(_Customer value, $Res Function(_Customer) _then) = __$CustomerCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? id, String? type, String? status,@JsonKey(name: 'first_name') String? firstName,@JsonKey(name: 'last_name') String? lastName,@JsonKey(name: 'full_name') String? fullName, String? email, String? phone, String? mobile,@JsonKey(name: 'registration_number') String? registrationNumber,@JsonKey(name: 'tax_id') String? taxId, String? industry,@JsonKey(name: 'business_type') String? businessType,@JsonKey(name: 'employee_count') int? employeeCount,@JsonKey(name: 'annual_revenue') int? annualRevenue,@JsonKey(name: 'founded_year') int? foundedYear,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'is_compliant') bool? isCompliant,@JsonKey(name: 'compliance_notes') String? complianceNotes, String? language, String? username, String? currency, String? timezone,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt,@JsonKey(name: 'created_by') String? createdBy,@JsonKey(name: 'updated_by') String? updatedBy, Address? address, ContactPerson? contactPersons
|
||||
});
|
||||
|
||||
|
||||
@override $AddressCopyWith<$Res>? get address;@override $ContactPersonCopyWith<$Res>? get contactPersons;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$CustomerCopyWithImpl<$Res>
|
||||
implements _$CustomerCopyWith<$Res> {
|
||||
__$CustomerCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _Customer _self;
|
||||
final $Res Function(_Customer) _then;
|
||||
|
||||
/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? type = freezed,Object? status = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? fullName = freezed,Object? email = freezed,Object? phone = freezed,Object? mobile = freezed,Object? registrationNumber = freezed,Object? taxId = freezed,Object? industry = freezed,Object? businessType = freezed,Object? employeeCount = freezed,Object? annualRevenue = freezed,Object? foundedYear = freezed,Object? isVerified = freezed,Object? isCompliant = freezed,Object? complianceNotes = freezed,Object? language = freezed,Object? username = freezed,Object? currency = freezed,Object? timezone = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,Object? createdBy = freezed,Object? updatedBy = freezed,Object? address = freezed,Object? contactPersons = freezed,}) {
|
||||
return _then(_Customer(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,registrationNumber: freezed == registrationNumber ? _self.registrationNumber : registrationNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,taxId: freezed == taxId ? _self.taxId : taxId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,industry: freezed == industry ? _self.industry : industry // ignore: cast_nullable_to_non_nullable
|
||||
as String?,businessType: freezed == businessType ? _self.businessType : businessType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,employeeCount: freezed == employeeCount ? _self.employeeCount : employeeCount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,annualRevenue: freezed == annualRevenue ? _self.annualRevenue : annualRevenue // ignore: cast_nullable_to_non_nullable
|
||||
as int?,foundedYear: freezed == foundedYear ? _self.foundedYear : foundedYear // ignore: cast_nullable_to_non_nullable
|
||||
as int?,isVerified: freezed == isVerified ? _self.isVerified : isVerified // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,isCompliant: freezed == isCompliant ? _self.isCompliant : isCompliant // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,complianceNotes: freezed == complianceNotes ? _self.complianceNotes : complianceNotes // ignore: cast_nullable_to_non_nullable
|
||||
as String?,language: freezed == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
|
||||
as String?,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable
|
||||
as String?,timezone: freezed == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as int?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as int?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as String?,updatedBy: freezed == updatedBy ? _self.updatedBy : updatedBy // ignore: cast_nullable_to_non_nullable
|
||||
as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as Address?,contactPersons: freezed == contactPersons ? _self.contactPersons : contactPersons // ignore: cast_nullable_to_non_nullable
|
||||
as ContactPerson?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$AddressCopyWith<$Res>? get address {
|
||||
if (_self.address == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $AddressCopyWith<$Res>(_self.address!, (value) {
|
||||
return _then(_self.copyWith(address: value));
|
||||
});
|
||||
}/// Create a copy of Customer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ContactPersonCopyWith<$Res>? get contactPersons {
|
||||
if (_self.contactPersons == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ContactPersonCopyWith<$Res>(_self.contactPersons!, (value) {
|
||||
return _then(_self.copyWith(contactPersons: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,79 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'customer.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_Customer _$CustomerFromJson(Map<String, dynamic> json) => _Customer(
|
||||
id: json['id'] as String?,
|
||||
type: json['type'] as String?,
|
||||
status: json['status'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
fullName: json['full_name'] as String?,
|
||||
email: json['email'] as String?,
|
||||
phone: json['phone'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
registrationNumber: json['registration_number'] as String?,
|
||||
taxId: json['tax_id'] as String?,
|
||||
industry: json['industry'] as String?,
|
||||
businessType: json['business_type'] as String?,
|
||||
employeeCount: (json['employee_count'] as num?)?.toInt(),
|
||||
annualRevenue: (json['annual_revenue'] as num?)?.toInt(),
|
||||
foundedYear: (json['founded_year'] as num?)?.toInt(),
|
||||
isVerified: json['is_verified'] as bool?,
|
||||
isCompliant: json['is_compliant'] as bool?,
|
||||
complianceNotes: json['compliance_notes'] as String?,
|
||||
language: json['language'] as String?,
|
||||
username: json['username'] as String?,
|
||||
currency: json['currency'] as String?,
|
||||
timezone: json['timezone'] as String?,
|
||||
createdAt: (json['created_at'] as num?)?.toInt(),
|
||||
updatedAt: (json['updated_at'] as num?)?.toInt(),
|
||||
createdBy: json['created_by'] as String?,
|
||||
updatedBy: json['updated_by'] as String?,
|
||||
address:
|
||||
json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
contactPersons:
|
||||
json['contactPersons'] == null
|
||||
? null
|
||||
: ContactPerson.fromJson(
|
||||
json['contactPersons'] as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CustomerToJson(_Customer instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'type': instance.type,
|
||||
'status': instance.status,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'full_name': instance.fullName,
|
||||
'email': instance.email,
|
||||
'phone': instance.phone,
|
||||
'mobile': instance.mobile,
|
||||
'registration_number': instance.registrationNumber,
|
||||
'tax_id': instance.taxId,
|
||||
'industry': instance.industry,
|
||||
'business_type': instance.businessType,
|
||||
'employee_count': instance.employeeCount,
|
||||
'annual_revenue': instance.annualRevenue,
|
||||
'founded_year': instance.foundedYear,
|
||||
'is_verified': instance.isVerified,
|
||||
'is_compliant': instance.isCompliant,
|
||||
'compliance_notes': instance.complianceNotes,
|
||||
'language': instance.language,
|
||||
'username': instance.username,
|
||||
'currency': instance.currency,
|
||||
'timezone': instance.timezone,
|
||||
'created_at': instance.createdAt,
|
||||
'updated_at': instance.updatedAt,
|
||||
'created_by': instance.createdBy,
|
||||
'updated_by': instance.updatedBy,
|
||||
'address': instance.address,
|
||||
'contactPersons': instance.contactPersons,
|
||||
};
|
||||
@@ -1,7 +1,9 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:tm_app/data/services/model/user/user.dart';
|
||||
import 'package:tm_app/data/services/model/customer/customer.dart';
|
||||
|
||||
import '../error/error_model.dart';
|
||||
|
||||
part 'login_data.freezed.dart';
|
||||
part 'login_data.g.dart';
|
||||
@@ -9,10 +11,11 @@ part 'login_data.g.dart';
|
||||
@freezed
|
||||
abstract class LoginData with _$LoginData {
|
||||
const factory LoginData({
|
||||
required User user,
|
||||
@JsonKey(name: 'access_token') required String accessToken,
|
||||
@JsonKey(name: 'refresh_token') required String refreshToken,
|
||||
@JsonKey(name: 'expires_at') required int expiresAt,
|
||||
required Customer? customer,
|
||||
required ErrorModel? error,
|
||||
@JsonKey(name: 'access_token') required String? accessToken,
|
||||
@JsonKey(name: 'refresh_token') required String? refreshToken,
|
||||
@JsonKey(name: 'expires_at') required int? expiresAt,
|
||||
}) = _LoginData;
|
||||
|
||||
factory LoginData.fromJson(Map<String, Object?> json) =>
|
||||
|
||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$LoginData {
|
||||
|
||||
User get user;@JsonKey(name: 'access_token') String get accessToken;@JsonKey(name: 'refresh_token') String get refreshToken;@JsonKey(name: 'expires_at') int get expiresAt;
|
||||
Customer? get customer; ErrorModel? get error;@JsonKey(name: 'access_token') String? get accessToken;@JsonKey(name: 'refresh_token') String? get refreshToken;@JsonKey(name: 'expires_at') int? get expiresAt;
|
||||
/// Create a copy of LoginData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,16 +28,16 @@ $LoginDataCopyWith<LoginData> get copyWith => _$LoginDataCopyWithImpl<LoginData>
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoginData&&(identical(other.user, user) || other.user == user)&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.expiresAt, expiresAt) || other.expiresAt == expiresAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoginData&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.error, error) || other.error == error)&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.expiresAt, expiresAt) || other.expiresAt == expiresAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,user,accessToken,refreshToken,expiresAt);
|
||||
int get hashCode => Object.hash(runtimeType,customer,error,accessToken,refreshToken,expiresAt);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoginData(user: $user, accessToken: $accessToken, refreshToken: $refreshToken, expiresAt: $expiresAt)';
|
||||
return 'LoginData(customer: $customer, error: $error, accessToken: $accessToken, refreshToken: $refreshToken, expiresAt: $expiresAt)';
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ abstract mixin class $LoginDataCopyWith<$Res> {
|
||||
factory $LoginDataCopyWith(LoginData value, $Res Function(LoginData) _then) = _$LoginDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
User user,@JsonKey(name: 'access_token') String accessToken,@JsonKey(name: 'refresh_token') String refreshToken,@JsonKey(name: 'expires_at') int expiresAt
|
||||
Customer? customer, ErrorModel? error,@JsonKey(name: 'access_token') String? accessToken,@JsonKey(name: 'refresh_token') String? refreshToken,@JsonKey(name: 'expires_at') int? expiresAt
|
||||
});
|
||||
|
||||
|
||||
$UserCopyWith<$Res> get user;
|
||||
$CustomerCopyWith<$Res>? get customer;$ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -65,23 +65,39 @@ class _$LoginDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of LoginData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? user = null,Object? accessToken = null,Object? refreshToken = null,Object? expiresAt = null,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? customer = freezed,Object? error = freezed,Object? accessToken = freezed,Object? refreshToken = freezed,Object? expiresAt = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
user: null == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as User,accessToken: null == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String,refreshToken: null == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
||||
as String,expiresAt: null == expiresAt ? _self.expiresAt : expiresAt // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable
|
||||
as Customer?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as ErrorModel?,accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresAt: freezed == expiresAt ? _self.expiresAt : expiresAt // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of LoginData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res> get user {
|
||||
|
||||
return $UserCopyWith<$Res>(_self.user, (value) {
|
||||
return _then(_self.copyWith(user: value));
|
||||
$CustomerCopyWith<$Res>? get customer {
|
||||
if (_self.customer == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $CustomerCopyWith<$Res>(_self.customer!, (value) {
|
||||
return _then(_self.copyWith(customer: value));
|
||||
});
|
||||
}/// Create a copy of LoginData
|
||||
/// 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));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -165,10 +181,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( User user, @JsonKey(name: 'access_token') String accessToken, @JsonKey(name: 'refresh_token') String refreshToken, @JsonKey(name: 'expires_at') int expiresAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( Customer? customer, ErrorModel? error, @JsonKey(name: 'access_token') String? accessToken, @JsonKey(name: 'refresh_token') String? refreshToken, @JsonKey(name: 'expires_at') int? expiresAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginData() when $default != null:
|
||||
return $default(_that.user,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
||||
return $default(_that.customer,_that.error,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -186,10 +202,10 @@ return $default(_that.user,_that.accessToken,_that.refreshToken,_that.expiresAt)
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( User user, @JsonKey(name: 'access_token') String accessToken, @JsonKey(name: 'refresh_token') String refreshToken, @JsonKey(name: 'expires_at') int expiresAt) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( Customer? customer, ErrorModel? error, @JsonKey(name: 'access_token') String? accessToken, @JsonKey(name: 'refresh_token') String? refreshToken, @JsonKey(name: 'expires_at') int? expiresAt) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginData():
|
||||
return $default(_that.user,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
||||
return $default(_that.customer,_that.error,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -206,10 +222,10 @@ return $default(_that.user,_that.accessToken,_that.refreshToken,_that.expiresAt)
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( User user, @JsonKey(name: 'access_token') String accessToken, @JsonKey(name: 'refresh_token') String refreshToken, @JsonKey(name: 'expires_at') int expiresAt)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( Customer? customer, ErrorModel? error, @JsonKey(name: 'access_token') String? accessToken, @JsonKey(name: 'refresh_token') String? refreshToken, @JsonKey(name: 'expires_at') int? expiresAt)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginData() when $default != null:
|
||||
return $default(_that.user,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
||||
return $default(_that.customer,_that.error,_that.accessToken,_that.refreshToken,_that.expiresAt);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -221,13 +237,14 @@ return $default(_that.user,_that.accessToken,_that.refreshToken,_that.expiresAt)
|
||||
@JsonSerializable()
|
||||
|
||||
class _LoginData implements LoginData {
|
||||
const _LoginData({required this.user, @JsonKey(name: 'access_token') required this.accessToken, @JsonKey(name: 'refresh_token') required this.refreshToken, @JsonKey(name: 'expires_at') required this.expiresAt});
|
||||
const _LoginData({required this.customer, required this.error, @JsonKey(name: 'access_token') required this.accessToken, @JsonKey(name: 'refresh_token') required this.refreshToken, @JsonKey(name: 'expires_at') required this.expiresAt});
|
||||
factory _LoginData.fromJson(Map<String, dynamic> json) => _$LoginDataFromJson(json);
|
||||
|
||||
@override final User user;
|
||||
@override@JsonKey(name: 'access_token') final String accessToken;
|
||||
@override@JsonKey(name: 'refresh_token') final String refreshToken;
|
||||
@override@JsonKey(name: 'expires_at') final int expiresAt;
|
||||
@override final Customer? customer;
|
||||
@override final ErrorModel? error;
|
||||
@override@JsonKey(name: 'access_token') final String? accessToken;
|
||||
@override@JsonKey(name: 'refresh_token') final String? refreshToken;
|
||||
@override@JsonKey(name: 'expires_at') final int? expiresAt;
|
||||
|
||||
/// Create a copy of LoginData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -242,16 +259,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoginData&&(identical(other.user, user) || other.user == user)&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.expiresAt, expiresAt) || other.expiresAt == expiresAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoginData&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.error, error) || other.error == error)&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.expiresAt, expiresAt) || other.expiresAt == expiresAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,user,accessToken,refreshToken,expiresAt);
|
||||
int get hashCode => Object.hash(runtimeType,customer,error,accessToken,refreshToken,expiresAt);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoginData(user: $user, accessToken: $accessToken, refreshToken: $refreshToken, expiresAt: $expiresAt)';
|
||||
return 'LoginData(customer: $customer, error: $error, accessToken: $accessToken, refreshToken: $refreshToken, expiresAt: $expiresAt)';
|
||||
}
|
||||
|
||||
|
||||
@@ -262,11 +279,11 @@ abstract mixin class _$LoginDataCopyWith<$Res> implements $LoginDataCopyWith<$Re
|
||||
factory _$LoginDataCopyWith(_LoginData value, $Res Function(_LoginData) _then) = __$LoginDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
User user,@JsonKey(name: 'access_token') String accessToken,@JsonKey(name: 'refresh_token') String refreshToken,@JsonKey(name: 'expires_at') int expiresAt
|
||||
Customer? customer, ErrorModel? error,@JsonKey(name: 'access_token') String? accessToken,@JsonKey(name: 'refresh_token') String? refreshToken,@JsonKey(name: 'expires_at') int? expiresAt
|
||||
});
|
||||
|
||||
|
||||
@override $UserCopyWith<$Res> get user;
|
||||
@override $CustomerCopyWith<$Res>? get customer;@override $ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -279,13 +296,14 @@ class __$LoginDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of LoginData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? user = null,Object? accessToken = null,Object? refreshToken = null,Object? expiresAt = null,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? customer = freezed,Object? error = freezed,Object? accessToken = freezed,Object? refreshToken = freezed,Object? expiresAt = freezed,}) {
|
||||
return _then(_LoginData(
|
||||
user: null == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as User,accessToken: null == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String,refreshToken: null == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
||||
as String,expiresAt: null == expiresAt ? _self.expiresAt : expiresAt // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable
|
||||
as Customer?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as ErrorModel?,accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresAt: freezed == expiresAt ? _self.expiresAt : expiresAt // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -293,10 +311,25 @@ as int,
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res> get user {
|
||||
|
||||
return $UserCopyWith<$Res>(_self.user, (value) {
|
||||
return _then(_self.copyWith(user: value));
|
||||
$CustomerCopyWith<$Res>? get customer {
|
||||
if (_self.customer == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $CustomerCopyWith<$Res>(_self.customer!, (value) {
|
||||
return _then(_self.copyWith(customer: value));
|
||||
});
|
||||
}/// Create a copy of LoginData
|
||||
/// 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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,23 @@ part of 'login_data.dart';
|
||||
// **************************************************************************
|
||||
|
||||
_LoginData _$LoginDataFromJson(Map<String, dynamic> json) => _LoginData(
|
||||
user: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
accessToken: json['access_token'] as String,
|
||||
refreshToken: json['refresh_token'] as String,
|
||||
expiresAt: (json['expires_at'] as num).toInt(),
|
||||
customer:
|
||||
json['customer'] == null
|
||||
? null
|
||||
: Customer.fromJson(json['customer'] as Map<String, dynamic>),
|
||||
error:
|
||||
json['error'] == null
|
||||
? null
|
||||
: ErrorModel.fromJson(json['error'] as Map<String, dynamic>),
|
||||
accessToken: json['access_token'] as String?,
|
||||
refreshToken: json['refresh_token'] as String?,
|
||||
expiresAt: (json['expires_at'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LoginDataToJson(_LoginData instance) =>
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
'customer': instance.customer,
|
||||
'error': instance.error,
|
||||
'access_token': instance.accessToken,
|
||||
'refresh_token': instance.refreshToken,
|
||||
'expires_at': instance.expiresAt,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
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_detail_response_model.freezed.dart';
|
||||
part 'tender_detail_response_model.g.dart';
|
||||
@@ -9,24 +11,10 @@ part 'tender_detail_response_model.g.dart';
|
||||
abstract class TenderDetailResponseModel with _$TenderDetailResponseModel {
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
const factory TenderDetailResponseModel({
|
||||
required String? date,
|
||||
required String? status,
|
||||
required String? title,
|
||||
required String? id,
|
||||
required String? approvalDate,
|
||||
required String? submissionDate,
|
||||
required String? client,
|
||||
required String? deliveryLocation,
|
||||
required String? referenceNumber,
|
||||
required String? country,
|
||||
required String? flagAsset,
|
||||
required String? locationTitle,
|
||||
required String? locationDescription,
|
||||
required String? documentName,
|
||||
required String? documentUrl,
|
||||
required double? profileMatch,
|
||||
required bool? incompleteResume,
|
||||
required String? incompleteResumeReason,
|
||||
required TenderData? data,
|
||||
required ErrorModel? error,
|
||||
required bool? success,
|
||||
required String? message,
|
||||
}) = _TenderDetailResponseModel;
|
||||
|
||||
factory TenderDetailResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
+80
-74
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$TenderDetailResponseModel {
|
||||
|
||||
String? get date; String? get status; String? get title; String? get id; String? get approvalDate; String? get submissionDate; String? get client; String? get deliveryLocation; String? get referenceNumber; String? get country; String? get flagAsset; String? get locationTitle; String? get locationDescription; String? get documentName; String? get documentUrl; double? get profileMatch; bool? get incompleteResume; String? get incompleteResumeReason;
|
||||
TenderData? get data; ErrorModel? get error; bool? get success; String? get message;
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,16 +28,16 @@ $TenderDetailResponseModelCopyWith<TenderDetailResponseModel> get copyWith => _$
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderDetailResponseModel&&(identical(other.date, date) || other.date == date)&&(identical(other.status, status) || other.status == status)&&(identical(other.title, title) || other.title == title)&&(identical(other.id, id) || other.id == id)&&(identical(other.approvalDate, approvalDate) || other.approvalDate == approvalDate)&&(identical(other.submissionDate, submissionDate) || other.submissionDate == submissionDate)&&(identical(other.client, client) || other.client == client)&&(identical(other.deliveryLocation, deliveryLocation) || other.deliveryLocation == deliveryLocation)&&(identical(other.referenceNumber, referenceNumber) || other.referenceNumber == referenceNumber)&&(identical(other.country, country) || other.country == country)&&(identical(other.flagAsset, flagAsset) || other.flagAsset == flagAsset)&&(identical(other.locationTitle, locationTitle) || other.locationTitle == locationTitle)&&(identical(other.locationDescription, locationDescription) || other.locationDescription == locationDescription)&&(identical(other.documentName, documentName) || other.documentName == documentName)&&(identical(other.documentUrl, documentUrl) || other.documentUrl == documentUrl)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch)&&(identical(other.incompleteResume, incompleteResume) || other.incompleteResume == incompleteResume)&&(identical(other.incompleteResumeReason, incompleteResumeReason) || other.incompleteResumeReason == incompleteResumeReason));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderDetailResponseModel&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,date,status,title,id,approvalDate,submissionDate,client,deliveryLocation,referenceNumber,country,flagAsset,locationTitle,locationDescription,documentName,documentUrl,profileMatch,incompleteResume,incompleteResumeReason);
|
||||
int get hashCode => Object.hash(runtimeType,data,error,success,message);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderDetailResponseModel(date: $date, status: $status, title: $title, id: $id, approvalDate: $approvalDate, submissionDate: $submissionDate, client: $client, deliveryLocation: $deliveryLocation, referenceNumber: $referenceNumber, country: $country, flagAsset: $flagAsset, locationTitle: $locationTitle, locationDescription: $locationDescription, documentName: $documentName, documentUrl: $documentUrl, profileMatch: $profileMatch, incompleteResume: $incompleteResume, incompleteResumeReason: $incompleteResumeReason)';
|
||||
return 'TenderDetailResponseModel(data: $data, error: $error, success: $success, message: $message)';
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ abstract mixin class $TenderDetailResponseModelCopyWith<$Res> {
|
||||
factory $TenderDetailResponseModelCopyWith(TenderDetailResponseModel value, $Res Function(TenderDetailResponseModel) _then) = _$TenderDetailResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? date, String? status, String? title, String? id, String? approvalDate, String? submissionDate, String? client, String? deliveryLocation, String? referenceNumber, String? country, String? flagAsset, String? locationTitle, String? locationDescription, String? documentName, String? documentUrl, double? profileMatch, bool? incompleteResume, String? incompleteResumeReason
|
||||
TenderData? data, ErrorModel? error, bool? success, String? message
|
||||
});
|
||||
|
||||
|
||||
|
||||
$TenderDataCopyWith<$Res>? get data;$ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -65,30 +65,40 @@ class _$TenderDetailResponseModelCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? date = freezed,Object? status = freezed,Object? title = freezed,Object? id = freezed,Object? approvalDate = freezed,Object? submissionDate = freezed,Object? client = freezed,Object? deliveryLocation = freezed,Object? referenceNumber = freezed,Object? country = freezed,Object? flagAsset = freezed,Object? locationTitle = freezed,Object? locationDescription = freezed,Object? documentName = freezed,Object? documentUrl = freezed,Object? profileMatch = freezed,Object? incompleteResume = freezed,Object? incompleteResumeReason = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? data = freezed,Object? error = freezed,Object? success = freezed,Object? message = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
date: freezed == date ? _self.date : date // 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?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,approvalDate: freezed == approvalDate ? _self.approvalDate : approvalDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,submissionDate: freezed == submissionDate ? _self.submissionDate : submissionDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,client: freezed == client ? _self.client : client // ignore: cast_nullable_to_non_nullable
|
||||
as String?,deliveryLocation: freezed == deliveryLocation ? _self.deliveryLocation : deliveryLocation // ignore: cast_nullable_to_non_nullable
|
||||
as String?,referenceNumber: freezed == referenceNumber ? _self.referenceNumber : referenceNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
|
||||
as String?,flagAsset: freezed == flagAsset ? _self.flagAsset : flagAsset // ignore: cast_nullable_to_non_nullable
|
||||
as String?,locationTitle: freezed == locationTitle ? _self.locationTitle : locationTitle // ignore: cast_nullable_to_non_nullable
|
||||
as String?,locationDescription: freezed == locationDescription ? _self.locationDescription : locationDescription // ignore: cast_nullable_to_non_nullable
|
||||
as String?,documentName: freezed == documentName ? _self.documentName : documentName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,documentUrl: freezed == documentUrl ? _self.documentUrl : documentUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable
|
||||
as double?,incompleteResume: freezed == incompleteResume ? _self.incompleteResume : incompleteResume // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,incompleteResumeReason: freezed == incompleteResumeReason ? _self.incompleteResumeReason : incompleteResumeReason // ignore: cast_nullable_to_non_nullable
|
||||
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?,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?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// 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 TenderDetailResponseModel
|
||||
/// 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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,10 +180,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? date, String? status, String? title, String? id, String? approvalDate, String? submissionDate, String? client, String? deliveryLocation, String? referenceNumber, String? country, String? flagAsset, String? locationTitle, String? locationDescription, String? documentName, String? documentUrl, double? profileMatch, bool? incompleteResume, String? incompleteResumeReason)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( TenderData? data, ErrorModel? error, bool? success, String? message)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderDetailResponseModel() when $default != null:
|
||||
return $default(_that.date,_that.status,_that.title,_that.id,_that.approvalDate,_that.submissionDate,_that.client,_that.deliveryLocation,_that.referenceNumber,_that.country,_that.flagAsset,_that.locationTitle,_that.locationDescription,_that.documentName,_that.documentUrl,_that.profileMatch,_that.incompleteResume,_that.incompleteResumeReason);case _:
|
||||
return $default(_that.data,_that.error,_that.success,_that.message);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -191,10 +201,10 @@ return $default(_that.date,_that.status,_that.title,_that.id,_that.approvalDate,
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? date, String? status, String? title, String? id, String? approvalDate, String? submissionDate, String? client, String? deliveryLocation, String? referenceNumber, String? country, String? flagAsset, String? locationTitle, String? locationDescription, String? documentName, String? documentUrl, double? profileMatch, bool? incompleteResume, String? incompleteResumeReason) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( TenderData? data, ErrorModel? error, bool? success, String? message) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderDetailResponseModel():
|
||||
return $default(_that.date,_that.status,_that.title,_that.id,_that.approvalDate,_that.submissionDate,_that.client,_that.deliveryLocation,_that.referenceNumber,_that.country,_that.flagAsset,_that.locationTitle,_that.locationDescription,_that.documentName,_that.documentUrl,_that.profileMatch,_that.incompleteResume,_that.incompleteResumeReason);case _:
|
||||
return $default(_that.data,_that.error,_that.success,_that.message);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -211,10 +221,10 @@ return $default(_that.date,_that.status,_that.title,_that.id,_that.approvalDate,
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? date, String? status, String? title, String? id, String? approvalDate, String? submissionDate, String? client, String? deliveryLocation, String? referenceNumber, String? country, String? flagAsset, String? locationTitle, String? locationDescription, String? documentName, String? documentUrl, double? profileMatch, bool? incompleteResume, String? incompleteResumeReason)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( TenderData? data, ErrorModel? error, bool? success, String? message)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderDetailResponseModel() when $default != null:
|
||||
return $default(_that.date,_that.status,_that.title,_that.id,_that.approvalDate,_that.submissionDate,_that.client,_that.deliveryLocation,_that.referenceNumber,_that.country,_that.flagAsset,_that.locationTitle,_that.locationDescription,_that.documentName,_that.documentUrl,_that.profileMatch,_that.incompleteResume,_that.incompleteResumeReason);case _:
|
||||
return $default(_that.data,_that.error,_that.success,_that.message);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -226,27 +236,13 @@ return $default(_that.date,_that.status,_that.title,_that.id,_that.approvalDate,
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class _TenderDetailResponseModel implements TenderDetailResponseModel {
|
||||
const _TenderDetailResponseModel({required this.date, required this.status, required this.title, required this.id, required this.approvalDate, required this.submissionDate, required this.client, required this.deliveryLocation, required this.referenceNumber, required this.country, required this.flagAsset, required this.locationTitle, required this.locationDescription, required this.documentName, required this.documentUrl, required this.profileMatch, required this.incompleteResume, required this.incompleteResumeReason});
|
||||
const _TenderDetailResponseModel({required this.data, required this.error, required this.success, required this.message});
|
||||
factory _TenderDetailResponseModel.fromJson(Map<String, dynamic> json) => _$TenderDetailResponseModelFromJson(json);
|
||||
|
||||
@override final String? date;
|
||||
@override final String? status;
|
||||
@override final String? title;
|
||||
@override final String? id;
|
||||
@override final String? approvalDate;
|
||||
@override final String? submissionDate;
|
||||
@override final String? client;
|
||||
@override final String? deliveryLocation;
|
||||
@override final String? referenceNumber;
|
||||
@override final String? country;
|
||||
@override final String? flagAsset;
|
||||
@override final String? locationTitle;
|
||||
@override final String? locationDescription;
|
||||
@override final String? documentName;
|
||||
@override final String? documentUrl;
|
||||
@override final double? profileMatch;
|
||||
@override final bool? incompleteResume;
|
||||
@override final String? incompleteResumeReason;
|
||||
@override final TenderData? data;
|
||||
@override final ErrorModel? error;
|
||||
@override final bool? success;
|
||||
@override final String? message;
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -261,16 +257,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderDetailResponseModel&&(identical(other.date, date) || other.date == date)&&(identical(other.status, status) || other.status == status)&&(identical(other.title, title) || other.title == title)&&(identical(other.id, id) || other.id == id)&&(identical(other.approvalDate, approvalDate) || other.approvalDate == approvalDate)&&(identical(other.submissionDate, submissionDate) || other.submissionDate == submissionDate)&&(identical(other.client, client) || other.client == client)&&(identical(other.deliveryLocation, deliveryLocation) || other.deliveryLocation == deliveryLocation)&&(identical(other.referenceNumber, referenceNumber) || other.referenceNumber == referenceNumber)&&(identical(other.country, country) || other.country == country)&&(identical(other.flagAsset, flagAsset) || other.flagAsset == flagAsset)&&(identical(other.locationTitle, locationTitle) || other.locationTitle == locationTitle)&&(identical(other.locationDescription, locationDescription) || other.locationDescription == locationDescription)&&(identical(other.documentName, documentName) || other.documentName == documentName)&&(identical(other.documentUrl, documentUrl) || other.documentUrl == documentUrl)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch)&&(identical(other.incompleteResume, incompleteResume) || other.incompleteResume == incompleteResume)&&(identical(other.incompleteResumeReason, incompleteResumeReason) || other.incompleteResumeReason == incompleteResumeReason));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderDetailResponseModel&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,date,status,title,id,approvalDate,submissionDate,client,deliveryLocation,referenceNumber,country,flagAsset,locationTitle,locationDescription,documentName,documentUrl,profileMatch,incompleteResume,incompleteResumeReason);
|
||||
int get hashCode => Object.hash(runtimeType,data,error,success,message);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderDetailResponseModel(date: $date, status: $status, title: $title, id: $id, approvalDate: $approvalDate, submissionDate: $submissionDate, client: $client, deliveryLocation: $deliveryLocation, referenceNumber: $referenceNumber, country: $country, flagAsset: $flagAsset, locationTitle: $locationTitle, locationDescription: $locationDescription, documentName: $documentName, documentUrl: $documentUrl, profileMatch: $profileMatch, incompleteResume: $incompleteResume, incompleteResumeReason: $incompleteResumeReason)';
|
||||
return 'TenderDetailResponseModel(data: $data, error: $error, success: $success, message: $message)';
|
||||
}
|
||||
|
||||
|
||||
@@ -281,11 +277,11 @@ abstract mixin class _$TenderDetailResponseModelCopyWith<$Res> implements $Tende
|
||||
factory _$TenderDetailResponseModelCopyWith(_TenderDetailResponseModel value, $Res Function(_TenderDetailResponseModel) _then) = __$TenderDetailResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? date, String? status, String? title, String? id, String? approvalDate, String? submissionDate, String? client, String? deliveryLocation, String? referenceNumber, String? country, String? flagAsset, String? locationTitle, String? locationDescription, String? documentName, String? documentUrl, double? profileMatch, bool? incompleteResume, String? incompleteResumeReason
|
||||
TenderData? data, ErrorModel? error, bool? success, String? message
|
||||
});
|
||||
|
||||
|
||||
|
||||
@override $TenderDataCopyWith<$Res>? get data;@override $ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -298,31 +294,41 @@ class __$TenderDetailResponseModelCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? date = freezed,Object? status = freezed,Object? title = freezed,Object? id = freezed,Object? approvalDate = freezed,Object? submissionDate = freezed,Object? client = freezed,Object? deliveryLocation = freezed,Object? referenceNumber = freezed,Object? country = freezed,Object? flagAsset = freezed,Object? locationTitle = freezed,Object? locationDescription = freezed,Object? documentName = freezed,Object? documentUrl = freezed,Object? profileMatch = freezed,Object? incompleteResume = freezed,Object? incompleteResumeReason = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? data = freezed,Object? error = freezed,Object? success = freezed,Object? message = freezed,}) {
|
||||
return _then(_TenderDetailResponseModel(
|
||||
date: freezed == date ? _self.date : date // 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?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,approvalDate: freezed == approvalDate ? _self.approvalDate : approvalDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,submissionDate: freezed == submissionDate ? _self.submissionDate : submissionDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,client: freezed == client ? _self.client : client // ignore: cast_nullable_to_non_nullable
|
||||
as String?,deliveryLocation: freezed == deliveryLocation ? _self.deliveryLocation : deliveryLocation // ignore: cast_nullable_to_non_nullable
|
||||
as String?,referenceNumber: freezed == referenceNumber ? _self.referenceNumber : referenceNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
|
||||
as String?,flagAsset: freezed == flagAsset ? _self.flagAsset : flagAsset // ignore: cast_nullable_to_non_nullable
|
||||
as String?,locationTitle: freezed == locationTitle ? _self.locationTitle : locationTitle // ignore: cast_nullable_to_non_nullable
|
||||
as String?,locationDescription: freezed == locationDescription ? _self.locationDescription : locationDescription // ignore: cast_nullable_to_non_nullable
|
||||
as String?,documentName: freezed == documentName ? _self.documentName : documentName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,documentUrl: freezed == documentUrl ? _self.documentUrl : documentUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable
|
||||
as double?,incompleteResume: freezed == incompleteResume ? _self.incompleteResume : incompleteResume // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,incompleteResumeReason: freezed == incompleteResumeReason ? _self.incompleteResumeReason : incompleteResumeReason // ignore: cast_nullable_to_non_nullable
|
||||
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?,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?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// 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 TenderDetailResponseModel
|
||||
/// 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
|
||||
|
||||
+14
-36
@@ -9,45 +9,23 @@ part of 'tender_detail_response_model.dart';
|
||||
_TenderDetailResponseModel _$TenderDetailResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _TenderDetailResponseModel(
|
||||
date: json['date'] as String?,
|
||||
status: json['status'] as String?,
|
||||
title: json['title'] as String?,
|
||||
id: json['id'] as String?,
|
||||
approvalDate: json['approvalDate'] as String?,
|
||||
submissionDate: json['submissionDate'] as String?,
|
||||
client: json['client'] as String?,
|
||||
deliveryLocation: json['deliveryLocation'] as String?,
|
||||
referenceNumber: json['referenceNumber'] as String?,
|
||||
country: json['country'] as String?,
|
||||
flagAsset: json['flagAsset'] as String?,
|
||||
locationTitle: json['locationTitle'] as String?,
|
||||
locationDescription: json['locationDescription'] as String?,
|
||||
documentName: json['documentName'] as String?,
|
||||
documentUrl: json['documentUrl'] as String?,
|
||||
profileMatch: (json['profileMatch'] as num?)?.toDouble(),
|
||||
incompleteResume: json['incompleteResume'] as bool?,
|
||||
incompleteResumeReason: json['incompleteResumeReason'] 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>),
|
||||
success: json['success'] as bool?,
|
||||
message: json['message'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TenderDetailResponseModelToJson(
|
||||
_TenderDetailResponseModel instance,
|
||||
) => <String, dynamic>{
|
||||
'date': instance.date,
|
||||
'status': instance.status,
|
||||
'title': instance.title,
|
||||
'id': instance.id,
|
||||
'approvalDate': instance.approvalDate,
|
||||
'submissionDate': instance.submissionDate,
|
||||
'client': instance.client,
|
||||
'deliveryLocation': instance.deliveryLocation,
|
||||
'referenceNumber': instance.referenceNumber,
|
||||
'country': instance.country,
|
||||
'flagAsset': instance.flagAsset,
|
||||
'locationTitle': instance.locationTitle,
|
||||
'locationDescription': instance.locationDescription,
|
||||
'documentName': instance.documentName,
|
||||
'documentUrl': instance.documentUrl,
|
||||
'profileMatch': instance.profileMatch,
|
||||
'incompleteResume': instance.incompleteResume,
|
||||
'incompleteResumeReason': instance.incompleteResumeReason,
|
||||
'data': instance.data?.toJson(),
|
||||
'error': instance.error?.toJson(),
|
||||
'success': instance.success,
|
||||
'message': instance.message,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../../meta/meta.dart';
|
||||
import '../../tender_data/tender_data.dart';
|
||||
|
||||
part 'tenders_data.freezed.dart';
|
||||
part 'tenders_data.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class TendersData with _$TendersData {
|
||||
const factory TendersData({
|
||||
required List<TenderData>? tenders,
|
||||
required Meta? metadata,
|
||||
}) = _TendersData;
|
||||
|
||||
factory TendersData.fromJson(Map<String, Object?> json) =>
|
||||
_$TendersDataFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
// 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 'tenders_data.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TendersData {
|
||||
|
||||
List<TenderData>? get tenders; Meta? get metadata;
|
||||
/// Create a copy of TendersData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$TendersDataCopyWith<TendersData> get copyWith => _$TendersDataCopyWithImpl<TendersData>(this as TendersData, _$identity);
|
||||
|
||||
/// Serializes this TendersData to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TendersData&&const DeepCollectionEquality().equals(other.tenders, tenders)&&(identical(other.metadata, metadata) || other.metadata == metadata));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(tenders),metadata);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TendersData(tenders: $tenders, metadata: $metadata)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $TendersDataCopyWith<$Res> {
|
||||
factory $TendersDataCopyWith(TendersData value, $Res Function(TendersData) _then) = _$TendersDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<TenderData>? tenders, Meta? metadata
|
||||
});
|
||||
|
||||
|
||||
$MetaCopyWith<$Res>? get metadata;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$TendersDataCopyWithImpl<$Res>
|
||||
implements $TendersDataCopyWith<$Res> {
|
||||
_$TendersDataCopyWithImpl(this._self, this._then);
|
||||
|
||||
final TendersData _self;
|
||||
final $Res Function(TendersData) _then;
|
||||
|
||||
/// Create a copy of TendersData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? tenders = freezed,Object? metadata = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
tenders: freezed == tenders ? _self.tenders : tenders // ignore: cast_nullable_to_non_nullable
|
||||
as List<TenderData>?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable
|
||||
as Meta?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of TendersData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res>? get metadata {
|
||||
if (_self.metadata == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $MetaCopyWith<$Res>(_self.metadata!, (value) {
|
||||
return _then(_self.copyWith(metadata: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [TendersData].
|
||||
extension TendersDataPatterns on TendersData {
|
||||
/// 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( _TendersData value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersData() 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( _TendersData value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersData():
|
||||
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( _TendersData value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersData() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<TenderData>? tenders, Meta? metadata)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersData() when $default != null:
|
||||
return $default(_that.tenders,_that.metadata);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<TenderData>? tenders, Meta? metadata) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersData():
|
||||
return $default(_that.tenders,_that.metadata);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<TenderData>? tenders, Meta? metadata)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersData() when $default != null:
|
||||
return $default(_that.tenders,_that.metadata);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _TendersData implements TendersData {
|
||||
const _TendersData({required final List<TenderData>? tenders, required this.metadata}): _tenders = tenders;
|
||||
factory _TendersData.fromJson(Map<String, dynamic> json) => _$TendersDataFromJson(json);
|
||||
|
||||
final List<TenderData>? _tenders;
|
||||
@override List<TenderData>? get tenders {
|
||||
final value = _tenders;
|
||||
if (value == null) return null;
|
||||
if (_tenders is EqualUnmodifiableListView) return _tenders;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override final Meta? metadata;
|
||||
|
||||
/// Create a copy of TendersData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$TendersDataCopyWith<_TendersData> get copyWith => __$TendersDataCopyWithImpl<_TendersData>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$TendersDataToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TendersData&&const DeepCollectionEquality().equals(other._tenders, _tenders)&&(identical(other.metadata, metadata) || other.metadata == metadata));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_tenders),metadata);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TendersData(tenders: $tenders, metadata: $metadata)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$TendersDataCopyWith<$Res> implements $TendersDataCopyWith<$Res> {
|
||||
factory _$TendersDataCopyWith(_TendersData value, $Res Function(_TendersData) _then) = __$TendersDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<TenderData>? tenders, Meta? metadata
|
||||
});
|
||||
|
||||
|
||||
@override $MetaCopyWith<$Res>? get metadata;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$TendersDataCopyWithImpl<$Res>
|
||||
implements _$TendersDataCopyWith<$Res> {
|
||||
__$TendersDataCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _TendersData _self;
|
||||
final $Res Function(_TendersData) _then;
|
||||
|
||||
/// Create a copy of TendersData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? tenders = freezed,Object? metadata = freezed,}) {
|
||||
return _then(_TendersData(
|
||||
tenders: freezed == tenders ? _self._tenders : tenders // ignore: cast_nullable_to_non_nullable
|
||||
as List<TenderData>?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable
|
||||
as Meta?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of TendersData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res>? get metadata {
|
||||
if (_self.metadata == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $MetaCopyWith<$Res>(_self.metadata!, (value) {
|
||||
return _then(_self.copyWith(metadata: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,24 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'tenders_data.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_TendersData _$TendersDataFromJson(Map<String, dynamic> json) => _TendersData(
|
||||
tenders:
|
||||
(json['tenders'] as List<dynamic>?)
|
||||
?.map((e) => TenderData.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
metadata:
|
||||
json['metadata'] == null
|
||||
? null
|
||||
: Meta.fromJson(json['metadata'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TendersDataToJson(_TendersData instance) =>
|
||||
<String, dynamic>{
|
||||
'tenders': instance.tenders,
|
||||
'metadata': instance.metadata,
|
||||
};
|
||||
@@ -1,15 +1,21 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:tm_app/data/services/model/tender/tender_model.dart';
|
||||
|
||||
import '../../error/error_model.dart';
|
||||
import '../tenders_data/tenders_data.dart';
|
||||
|
||||
part 'tenders_response.freezed.dart';
|
||||
part 'tenders_response.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class TendersResponse with _$TendersResponse {
|
||||
const factory TendersResponse({required List<TenderModel>? tenders}) =
|
||||
_TendersResponse;
|
||||
const factory TendersResponse({
|
||||
required TendersData? data,
|
||||
required ErrorModel? error,
|
||||
required String? message,
|
||||
required bool? success,
|
||||
}) = _TendersResponse;
|
||||
|
||||
factory TendersResponse.fromJson(Map<String, Object?> json) =>
|
||||
_$TendersResponseFromJson(json);
|
||||
|
||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$TendersResponse {
|
||||
|
||||
List<TenderModel>? get tenders;
|
||||
TendersData? get data; ErrorModel? get error; String? get message; bool? get success;
|
||||
/// Create a copy of TendersResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,16 +28,16 @@ $TendersResponseCopyWith<TendersResponse> get copyWith => _$TendersResponseCopyW
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TendersResponse&&const DeepCollectionEquality().equals(other.tenders, tenders));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TendersResponse&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.message, message) || other.message == message)&&(identical(other.success, success) || other.success == success));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(tenders));
|
||||
int get hashCode => Object.hash(runtimeType,data,error,message,success);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TendersResponse(tenders: $tenders)';
|
||||
return 'TendersResponse(data: $data, error: $error, message: $message, success: $success)';
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ abstract mixin class $TendersResponseCopyWith<$Res> {
|
||||
factory $TendersResponseCopyWith(TendersResponse value, $Res Function(TendersResponse) _then) = _$TendersResponseCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<TenderModel>? tenders
|
||||
TendersData? data, ErrorModel? error, String? message, bool? success
|
||||
});
|
||||
|
||||
|
||||
|
||||
$TendersDataCopyWith<$Res>? get data;$ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -65,13 +65,40 @@ class _$TendersResponseCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TendersResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? tenders = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? data = freezed,Object? error = freezed,Object? message = freezed,Object? success = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
tenders: freezed == tenders ? _self.tenders : tenders // ignore: cast_nullable_to_non_nullable
|
||||
as List<TenderModel>?,
|
||||
data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TendersData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as ErrorModel?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of TendersResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$TendersDataCopyWith<$Res>? get data {
|
||||
if (_self.data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $TendersDataCopyWith<$Res>(_self.data!, (value) {
|
||||
return _then(_self.copyWith(data: value));
|
||||
});
|
||||
}/// Create a copy of TendersResponse
|
||||
/// 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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,10 +180,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<TenderModel>? tenders)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( TendersData? data, ErrorModel? error, String? message, bool? success)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersResponse() when $default != null:
|
||||
return $default(_that.tenders);case _:
|
||||
return $default(_that.data,_that.error,_that.message,_that.success);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -174,10 +201,10 @@ return $default(_that.tenders);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<TenderModel>? tenders) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( TendersData? data, ErrorModel? error, String? message, bool? success) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersResponse():
|
||||
return $default(_that.tenders);case _:
|
||||
return $default(_that.data,_that.error,_that.message,_that.success);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -194,10 +221,10 @@ return $default(_that.tenders);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<TenderModel>? tenders)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( TendersData? data, ErrorModel? error, String? message, bool? success)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TendersResponse() when $default != null:
|
||||
return $default(_that.tenders);case _:
|
||||
return $default(_that.data,_that.error,_that.message,_that.success);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -209,18 +236,13 @@ return $default(_that.tenders);case _:
|
||||
@JsonSerializable()
|
||||
|
||||
class _TendersResponse implements TendersResponse {
|
||||
const _TendersResponse({required final List<TenderModel>? tenders}): _tenders = tenders;
|
||||
const _TendersResponse({required this.data, required this.error, required this.message, required this.success});
|
||||
factory _TendersResponse.fromJson(Map<String, dynamic> json) => _$TendersResponseFromJson(json);
|
||||
|
||||
final List<TenderModel>? _tenders;
|
||||
@override List<TenderModel>? get tenders {
|
||||
final value = _tenders;
|
||||
if (value == null) return null;
|
||||
if (_tenders is EqualUnmodifiableListView) return _tenders;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override final TendersData? data;
|
||||
@override final ErrorModel? error;
|
||||
@override final String? message;
|
||||
@override final bool? success;
|
||||
|
||||
/// Create a copy of TendersResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -235,16 +257,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TendersResponse&&const DeepCollectionEquality().equals(other._tenders, _tenders));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TendersResponse&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.message, message) || other.message == message)&&(identical(other.success, success) || other.success == success));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_tenders));
|
||||
int get hashCode => Object.hash(runtimeType,data,error,message,success);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TendersResponse(tenders: $tenders)';
|
||||
return 'TendersResponse(data: $data, error: $error, message: $message, success: $success)';
|
||||
}
|
||||
|
||||
|
||||
@@ -255,11 +277,11 @@ abstract mixin class _$TendersResponseCopyWith<$Res> implements $TendersResponse
|
||||
factory _$TendersResponseCopyWith(_TendersResponse value, $Res Function(_TendersResponse) _then) = __$TendersResponseCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<TenderModel>? tenders
|
||||
TendersData? data, ErrorModel? error, String? message, bool? success
|
||||
});
|
||||
|
||||
|
||||
|
||||
@override $TendersDataCopyWith<$Res>? get data;@override $ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -272,14 +294,41 @@ class __$TendersResponseCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TendersResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? tenders = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? data = freezed,Object? error = freezed,Object? message = freezed,Object? success = freezed,}) {
|
||||
return _then(_TendersResponse(
|
||||
tenders: freezed == tenders ? _self._tenders : tenders // ignore: cast_nullable_to_non_nullable
|
||||
as List<TenderModel>?,
|
||||
data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TendersData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as ErrorModel?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of TendersResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$TendersDataCopyWith<$Res>? get data {
|
||||
if (_self.data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $TendersDataCopyWith<$Res>(_self.data!, (value) {
|
||||
return _then(_self.copyWith(data: value));
|
||||
});
|
||||
}/// Create a copy of TendersResponse
|
||||
/// 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
|
||||
|
||||
@@ -8,11 +8,22 @@ part of 'tenders_response.dart';
|
||||
|
||||
_TendersResponse _$TendersResponseFromJson(Map<String, dynamic> json) =>
|
||||
_TendersResponse(
|
||||
tenders:
|
||||
(json['tenders'] as List<dynamic>?)
|
||||
?.map((e) => TenderModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
data:
|
||||
json['data'] == null
|
||||
? null
|
||||
: TendersData.fromJson(json['data'] as Map<String, dynamic>),
|
||||
error:
|
||||
json['error'] == null
|
||||
? null
|
||||
: ErrorModel.fromJson(json['error'] as Map<String, dynamic>),
|
||||
message: json['message'] as String?,
|
||||
success: json['success'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TendersResponseToJson(_TendersResponse instance) =>
|
||||
<String, dynamic>{'tenders': instance.tenders};
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'error': instance.error,
|
||||
'message': instance.message,
|
||||
'success': instance.success,
|
||||
};
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:tm_app/core/utils/logger.dart';
|
||||
import 'package:tm_app/core/utils/result.dart';
|
||||
import 'package:tm_app/data/services/mock_data/tender_detail_mock.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_request/tender_detail_request.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_response/tender_detail_response_model.dart';
|
||||
|
||||
import '../../core/network/network_manager.dart';
|
||||
@@ -14,21 +9,14 @@ class TenderDetailService {
|
||||
|
||||
final NetworkManager _networkManager;
|
||||
|
||||
Future<Result<TenderDetailResponseModel>> getTenderDetail({
|
||||
required TenderDetailRequest request,
|
||||
Future<Result<TenderDetailResponseModel>> getTenderDetails({
|
||||
required String tenderId,
|
||||
}) async {
|
||||
try {
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
appLogger.info('get tender detail success');
|
||||
|
||||
return Result.ok(
|
||||
TenderDetailResponseModel.fromJson(
|
||||
jsonDecode(tenderDetailMockData)['data'],
|
||||
),
|
||||
);
|
||||
} catch (e, stackTrace) {
|
||||
appLogger.error('get tender detail failed: $e', stackTrace: stackTrace);
|
||||
return Result.error(Exception(e));
|
||||
}
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/api/v1/tenders/details/$tenderId',
|
||||
method: 'GET',
|
||||
(json) => TenderDetailResponseModel.fromJson(json),
|
||||
);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:tm_app/core/utils/logger.dart';
|
||||
import 'package:tm_app/core/utils/result.dart';
|
||||
import 'package:tm_app/data/services/mock_data/tenders_mock_data.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_reject_response/tender_reject_response.dart';
|
||||
import 'package:tm_app/data/services/model/tenders/tender_submit_response/tender_submit_response.dart';
|
||||
import 'package:tm_app/data/services/model/tenders/tenders_request/tenders_request.dart';
|
||||
import 'package:tm_app/data/services/model/tenders/tenders_response/tenders_response.dart';
|
||||
|
||||
import '../../core/network/network_manager.dart';
|
||||
@@ -18,26 +14,13 @@ class TendersService {
|
||||
: _networkManager = networkManager;
|
||||
final NetworkManager _networkManager;
|
||||
|
||||
Future<Result<TendersResponse>> getTenders({
|
||||
TendersRequest? tendersRequestModel,
|
||||
}) async {
|
||||
try {
|
||||
// final result = await _networkManager.makeRequest(
|
||||
// '/api/v1/tenders',
|
||||
// (json) => TendersResponse.fromJson(json),
|
||||
// method: 'GET',
|
||||
// );
|
||||
await Future.delayed(Duration(seconds: 2));
|
||||
appLogger.info('get tenders success');
|
||||
// TODO: will change when api is ready
|
||||
return Result.ok(TendersResponse.fromJson(jsonDecode(tendersMockData)));
|
||||
} on DioException catch (e) {
|
||||
appLogger.error('get tenders failed: $e');
|
||||
return Result.error(e);
|
||||
} on Exception catch (e, stackTrace) {
|
||||
appLogger.error('get tenders failed: $e', stackTrace: stackTrace);
|
||||
return Result.error(Exception(e));
|
||||
}
|
||||
Future<Result<TendersResponse>> getTenders() async {
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/api/v1/tenders',
|
||||
method: 'GET',
|
||||
(json) => TendersResponse.fromJson(json),
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<Result<TenderLikeResponse>> likeTender() async {
|
||||
|
||||
Reference in New Issue
Block a user