fix: 페이지네이션 로직 개선 및 상세 로그 추가
- 모든 관리 화면(회사, 장비, 입고지, 유지보수)의 페이지네이션 로직 통일 - Controller에서 전체 데이터 로드, View에서만 페이지네이션 처리 - 각 화면에 상세한 터미널 로그 추가로 데이터 로드 상태 추적 가능 - 회사 DTO에 지점 정보 포함 기능 추가 - 전체 79개 회사 중 14개만 표시되던 문제 해결
This commit is contained in:
@@ -11,6 +11,9 @@ class CompanyBranchFlatDto with _$CompanyBranchFlatDto {
|
||||
@JsonKey(name: 'company_name') required String companyName,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
|
||||
}) = _CompanyBranchFlatDto;
|
||||
|
||||
factory CompanyBranchFlatDto.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -28,6 +28,12 @@ mixin _$CompanyBranchFlatDto {
|
||||
int? get branchId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'branch_name')
|
||||
String? get branchName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool get isPartner => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool get isCustomer => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CompanyBranchFlatDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -49,7 +55,10 @@ abstract class $CompanyBranchFlatDtoCopyWith<$Res> {
|
||||
{@JsonKey(name: 'company_id') int companyId,
|
||||
@JsonKey(name: 'company_name') String companyName,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@JsonKey(name: 'branch_name') String? branchName});
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -72,6 +81,9 @@ class _$CompanyBranchFlatDtoCopyWithImpl<$Res,
|
||||
Object? companyName = null,
|
||||
Object? branchId = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? companyTypes = freezed,
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
companyId: null == companyId
|
||||
@@ -90,6 +102,18 @@ class _$CompanyBranchFlatDtoCopyWithImpl<$Res,
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyTypes: freezed == companyTypes
|
||||
? _value.companyTypes
|
||||
: companyTypes // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
isPartner: null == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCustomer: null == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -106,7 +130,10 @@ abstract class _$$CompanyBranchFlatDtoImplCopyWith<$Res>
|
||||
{@JsonKey(name: 'company_id') int companyId,
|
||||
@JsonKey(name: 'company_name') String companyName,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@JsonKey(name: 'branch_name') String? branchName});
|
||||
@JsonKey(name: 'branch_name') String? branchName,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -126,6 +153,9 @@ class __$$CompanyBranchFlatDtoImplCopyWithImpl<$Res>
|
||||
Object? companyName = null,
|
||||
Object? branchId = freezed,
|
||||
Object? branchName = freezed,
|
||||
Object? companyTypes = freezed,
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
}) {
|
||||
return _then(_$CompanyBranchFlatDtoImpl(
|
||||
companyId: null == companyId
|
||||
@@ -144,6 +174,18 @@ class __$$CompanyBranchFlatDtoImplCopyWithImpl<$Res>
|
||||
? _value.branchName
|
||||
: branchName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyTypes: freezed == companyTypes
|
||||
? _value._companyTypes
|
||||
: companyTypes // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
isPartner: null == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCustomer: null == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -155,7 +197,11 @@ class _$CompanyBranchFlatDtoImpl implements _CompanyBranchFlatDto {
|
||||
{@JsonKey(name: 'company_id') required this.companyId,
|
||||
@JsonKey(name: 'company_name') required this.companyName,
|
||||
@JsonKey(name: 'branch_id') this.branchId,
|
||||
@JsonKey(name: 'branch_name') this.branchName});
|
||||
@JsonKey(name: 'branch_name') this.branchName,
|
||||
@JsonKey(name: 'company_types') final List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') this.isPartner = false,
|
||||
@JsonKey(name: 'is_customer') this.isCustomer = false})
|
||||
: _companyTypes = companyTypes;
|
||||
|
||||
factory _$CompanyBranchFlatDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CompanyBranchFlatDtoImplFromJson(json);
|
||||
@@ -172,10 +218,27 @@ class _$CompanyBranchFlatDtoImpl implements _CompanyBranchFlatDto {
|
||||
@override
|
||||
@JsonKey(name: 'branch_name')
|
||||
final String? branchName;
|
||||
final List<String>? _companyTypes;
|
||||
@override
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes {
|
||||
final value = _companyTypes;
|
||||
if (value == null) return null;
|
||||
if (_companyTypes is EqualUnmodifiableListView) return _companyTypes;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
final bool isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
final bool isCustomer;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CompanyBranchFlatDto(companyId: $companyId, companyName: $companyName, branchId: $branchId, branchName: $branchName)';
|
||||
return 'CompanyBranchFlatDto(companyId: $companyId, companyName: $companyName, branchId: $branchId, branchName: $branchName, companyTypes: $companyTypes, isPartner: $isPartner, isCustomer: $isCustomer)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -190,13 +253,26 @@ class _$CompanyBranchFlatDtoImpl implements _CompanyBranchFlatDto {
|
||||
(identical(other.branchId, branchId) ||
|
||||
other.branchId == branchId) &&
|
||||
(identical(other.branchName, branchName) ||
|
||||
other.branchName == branchName));
|
||||
other.branchName == branchName) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._companyTypes, _companyTypes) &&
|
||||
(identical(other.isPartner, isPartner) ||
|
||||
other.isPartner == isPartner) &&
|
||||
(identical(other.isCustomer, isCustomer) ||
|
||||
other.isCustomer == isCustomer));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, companyId, companyName, branchId, branchName);
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
companyId,
|
||||
companyName,
|
||||
branchId,
|
||||
branchName,
|
||||
const DeepCollectionEquality().hash(_companyTypes),
|
||||
isPartner,
|
||||
isCustomer);
|
||||
|
||||
/// Create a copy of CompanyBranchFlatDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -221,7 +297,10 @@ abstract class _CompanyBranchFlatDto implements CompanyBranchFlatDto {
|
||||
{@JsonKey(name: 'company_id') required final int companyId,
|
||||
@JsonKey(name: 'company_name') required final String companyName,
|
||||
@JsonKey(name: 'branch_id') final int? branchId,
|
||||
@JsonKey(name: 'branch_name') final String? branchName}) =
|
||||
@JsonKey(name: 'branch_name') final String? branchName,
|
||||
@JsonKey(name: 'company_types') final List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') final bool isPartner,
|
||||
@JsonKey(name: 'is_customer') final bool isCustomer}) =
|
||||
_$CompanyBranchFlatDtoImpl;
|
||||
|
||||
factory _CompanyBranchFlatDto.fromJson(Map<String, dynamic> json) =
|
||||
@@ -239,6 +318,15 @@ abstract class _CompanyBranchFlatDto implements CompanyBranchFlatDto {
|
||||
@override
|
||||
@JsonKey(name: 'branch_name')
|
||||
String? get branchName;
|
||||
@override
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes;
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool get isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool get isCustomer;
|
||||
|
||||
/// Create a copy of CompanyBranchFlatDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -13,6 +13,11 @@ _$CompanyBranchFlatDtoImpl _$$CompanyBranchFlatDtoImplFromJson(
|
||||
companyName: json['company_name'] as String,
|
||||
branchId: (json['branch_id'] as num?)?.toInt(),
|
||||
branchName: json['branch_name'] as String?,
|
||||
companyTypes: (json['company_types'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CompanyBranchFlatDtoImplToJson(
|
||||
@@ -22,4 +27,7 @@ Map<String, dynamic> _$$CompanyBranchFlatDtoImplToJson(
|
||||
'company_name': instance.companyName,
|
||||
'branch_id': instance.branchId,
|
||||
'branch_name': instance.branchName,
|
||||
'company_types': instance.companyTypes,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
};
|
||||
|
||||
@@ -51,6 +51,8 @@ class CompanyResponse with _$CompanyResponse {
|
||||
@JsonKey(name: 'company_types') @Default([]) List<String> companyTypes,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
|
||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt, // nullable로 변경
|
||||
@JsonKey(name: 'address_id') int? addressId,
|
||||
|
||||
@@ -730,6 +730,10 @@ mixin _$CompanyResponse {
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active')
|
||||
bool get isActive => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool get isPartner => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool get isCustomer => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'updated_at')
|
||||
@@ -764,6 +768,8 @@ abstract class $CompanyResponseCopyWith<$Res> {
|
||||
@JsonKey(name: 'company_types') List<String> companyTypes,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@JsonKey(name: 'address_id') int? addressId});
|
||||
@@ -794,6 +800,8 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
Object? companyTypes = null,
|
||||
Object? remark = freezed,
|
||||
Object? isActive = null,
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = freezed,
|
||||
Object? addressId = freezed,
|
||||
@@ -839,6 +847,14 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isPartner: null == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCustomer: null == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -874,6 +890,8 @@ abstract class _$$CompanyResponseImplCopyWith<$Res>
|
||||
@JsonKey(name: 'company_types') List<String> companyTypes,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@JsonKey(name: 'address_id') int? addressId});
|
||||
@@ -902,6 +920,8 @@ class __$$CompanyResponseImplCopyWithImpl<$Res>
|
||||
Object? companyTypes = null,
|
||||
Object? remark = freezed,
|
||||
Object? isActive = null,
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = freezed,
|
||||
Object? addressId = freezed,
|
||||
@@ -947,6 +967,14 @@ class __$$CompanyResponseImplCopyWithImpl<$Res>
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isPartner: null == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCustomer: null == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -978,6 +1006,8 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
final List<String> companyTypes = const [],
|
||||
this.remark,
|
||||
@JsonKey(name: 'is_active') required this.isActive,
|
||||
@JsonKey(name: 'is_partner') this.isPartner = false,
|
||||
@JsonKey(name: 'is_customer') this.isCustomer = false,
|
||||
@JsonKey(name: 'created_at') required this.createdAt,
|
||||
@JsonKey(name: 'updated_at') this.updatedAt,
|
||||
@JsonKey(name: 'address_id') this.addressId})
|
||||
@@ -1020,6 +1050,12 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
@JsonKey(name: 'is_active')
|
||||
final bool isActive;
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
final bool isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
final bool isCustomer;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@@ -1032,7 +1068,7 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CompanyResponse(id: $id, name: $name, address: $address, contactName: $contactName, contactPosition: $contactPosition, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, remark: $remark, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt, addressId: $addressId)';
|
||||
return 'CompanyResponse(id: $id, name: $name, address: $address, contactName: $contactName, contactPosition: $contactPosition, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, remark: $remark, isActive: $isActive, isPartner: $isPartner, isCustomer: $isCustomer, createdAt: $createdAt, updatedAt: $updatedAt, addressId: $addressId)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1056,6 +1092,10 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
(identical(other.remark, remark) || other.remark == remark) &&
|
||||
(identical(other.isActive, isActive) ||
|
||||
other.isActive == isActive) &&
|
||||
(identical(other.isPartner, isPartner) ||
|
||||
other.isPartner == isPartner) &&
|
||||
(identical(other.isCustomer, isCustomer) ||
|
||||
other.isCustomer == isCustomer) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
@@ -1078,6 +1118,8 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
const DeepCollectionEquality().hash(_companyTypes),
|
||||
remark,
|
||||
isActive,
|
||||
isPartner,
|
||||
isCustomer,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
addressId);
|
||||
@@ -1111,6 +1153,8 @@ abstract class _CompanyResponse implements CompanyResponse {
|
||||
@JsonKey(name: 'company_types') final List<String> companyTypes,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_active') required final bool isActive,
|
||||
@JsonKey(name: 'is_partner') final bool isPartner,
|
||||
@JsonKey(name: 'is_customer') final bool isCustomer,
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') final DateTime? updatedAt,
|
||||
@JsonKey(name: 'address_id') final int? addressId}) =
|
||||
@@ -1146,6 +1190,12 @@ abstract class _CompanyResponse implements CompanyResponse {
|
||||
@JsonKey(name: 'is_active')
|
||||
bool get isActive;
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool get isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool get isCustomer;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
|
||||
@@ -81,6 +81,8 @@ _$CompanyResponseImpl _$$CompanyResponseImplFromJson(
|
||||
const [],
|
||||
remark: json['remark'] as String?,
|
||||
isActive: json['is_active'] as bool,
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? false,
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
@@ -101,6 +103,8 @@ Map<String, dynamic> _$$CompanyResponseImplToJson(
|
||||
'company_types': instance.companyTypes,
|
||||
'remark': instance.remark,
|
||||
'is_active': instance.isActive,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'address_id': instance.addressId,
|
||||
|
||||
@@ -10,11 +10,14 @@ class CompanyListDto with _$CompanyListDto {
|
||||
const factory CompanyListDto({
|
||||
required int id,
|
||||
required String name,
|
||||
required String address,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'is_partner') @Default(false) bool isPartner,
|
||||
@JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'branch_count') @Default(0) int branchCount,
|
||||
}) = _CompanyListDto;
|
||||
|
||||
@@ -22,15 +22,21 @@ CompanyListDto _$CompanyListDtoFromJson(Map<String, dynamic> json) {
|
||||
mixin _$CompanyListDto {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get address => throw _privateConstructorUsedError;
|
||||
String? get address => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_name')
|
||||
String? get contactName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_phone')
|
||||
String? get contactPhone => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_email')
|
||||
String? get contactEmail => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active')
|
||||
bool get isActive => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool get isPartner => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool get isCustomer => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime? get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'branch_count')
|
||||
@@ -55,11 +61,14 @@ abstract class $CompanyListDtoCopyWith<$Res> {
|
||||
$Res call(
|
||||
{int id,
|
||||
String name,
|
||||
String address,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'branch_count') int branchCount});
|
||||
}
|
||||
@@ -81,11 +90,14 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? address = freezed,
|
||||
Object? contactName = freezed,
|
||||
Object? contactPhone = freezed,
|
||||
Object? contactEmail = freezed,
|
||||
Object? companyTypes = freezed,
|
||||
Object? isActive = null,
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
Object? createdAt = freezed,
|
||||
Object? branchCount = null,
|
||||
}) {
|
||||
@@ -98,10 +110,10 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
address: null == address
|
||||
address: freezed == address
|
||||
? _value.address
|
||||
: address // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
contactName: freezed == contactName
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -114,10 +126,22 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
? _value.contactEmail
|
||||
: contactEmail // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyTypes: freezed == companyTypes
|
||||
? _value.companyTypes
|
||||
: companyTypes // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
isActive: null == isActive
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isPartner: null == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCustomer: null == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
createdAt: freezed == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -141,11 +165,14 @@ abstract class _$$CompanyListDtoImplCopyWith<$Res>
|
||||
$Res call(
|
||||
{int id,
|
||||
String name,
|
||||
String address,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'is_partner') bool isPartner,
|
||||
@JsonKey(name: 'is_customer') bool isCustomer,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@JsonKey(name: 'branch_count') int branchCount});
|
||||
}
|
||||
@@ -165,11 +192,14 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? address = freezed,
|
||||
Object? contactName = freezed,
|
||||
Object? contactPhone = freezed,
|
||||
Object? contactEmail = freezed,
|
||||
Object? companyTypes = freezed,
|
||||
Object? isActive = null,
|
||||
Object? isPartner = null,
|
||||
Object? isCustomer = null,
|
||||
Object? createdAt = freezed,
|
||||
Object? branchCount = null,
|
||||
}) {
|
||||
@@ -182,10 +212,10 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
address: null == address
|
||||
address: freezed == address
|
||||
? _value.address
|
||||
: address // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
contactName: freezed == contactName
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -198,10 +228,22 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
? _value.contactEmail
|
||||
: contactEmail // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyTypes: freezed == companyTypes
|
||||
? _value._companyTypes
|
||||
: companyTypes // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
isActive: null == isActive
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isPartner: null == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCustomer: null == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
createdAt: freezed == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
@@ -220,13 +262,17 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
const _$CompanyListDtoImpl(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.address,
|
||||
this.address,
|
||||
@JsonKey(name: 'contact_name') this.contactName,
|
||||
@JsonKey(name: 'contact_phone') this.contactPhone,
|
||||
@JsonKey(name: 'contact_email') this.contactEmail,
|
||||
@JsonKey(name: 'company_types') final List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_active') required this.isActive,
|
||||
@JsonKey(name: 'is_partner') this.isPartner = false,
|
||||
@JsonKey(name: 'is_customer') this.isCustomer = false,
|
||||
@JsonKey(name: 'created_at') this.createdAt,
|
||||
@JsonKey(name: 'branch_count') this.branchCount = 0});
|
||||
@JsonKey(name: 'branch_count') this.branchCount = 0})
|
||||
: _companyTypes = companyTypes;
|
||||
|
||||
factory _$CompanyListDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CompanyListDtoImplFromJson(json);
|
||||
@@ -236,7 +282,7 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String address;
|
||||
final String? address;
|
||||
@override
|
||||
@JsonKey(name: 'contact_name')
|
||||
final String? contactName;
|
||||
@@ -246,10 +292,27 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
@override
|
||||
@JsonKey(name: 'contact_email')
|
||||
final String? contactEmail;
|
||||
final List<String>? _companyTypes;
|
||||
@override
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes {
|
||||
final value = _companyTypes;
|
||||
if (value == null) return null;
|
||||
if (_companyTypes is EqualUnmodifiableListView) return _companyTypes;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
final bool isActive;
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
final bool isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
final bool isCustomer;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
final DateTime? createdAt;
|
||||
@override
|
||||
@@ -258,7 +321,7 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CompanyListDto(id: $id, name: $name, address: $address, contactName: $contactName, contactPhone: $contactPhone, contactEmail: $contactEmail, isActive: $isActive, createdAt: $createdAt, branchCount: $branchCount)';
|
||||
return 'CompanyListDto(id: $id, name: $name, address: $address, contactName: $contactName, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, isActive: $isActive, isPartner: $isPartner, isCustomer: $isCustomer, createdAt: $createdAt, branchCount: $branchCount)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -275,8 +338,14 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
other.contactPhone == contactPhone) &&
|
||||
(identical(other.contactEmail, contactEmail) ||
|
||||
other.contactEmail == contactEmail) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._companyTypes, _companyTypes) &&
|
||||
(identical(other.isActive, isActive) ||
|
||||
other.isActive == isActive) &&
|
||||
(identical(other.isPartner, isPartner) ||
|
||||
other.isPartner == isPartner) &&
|
||||
(identical(other.isCustomer, isCustomer) ||
|
||||
other.isCustomer == isCustomer) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.branchCount, branchCount) ||
|
||||
@@ -285,8 +354,20 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, name, address, contactName,
|
||||
contactPhone, contactEmail, isActive, createdAt, branchCount);
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
name,
|
||||
address,
|
||||
contactName,
|
||||
contactPhone,
|
||||
contactEmail,
|
||||
const DeepCollectionEquality().hash(_companyTypes),
|
||||
isActive,
|
||||
isPartner,
|
||||
isCustomer,
|
||||
createdAt,
|
||||
branchCount);
|
||||
|
||||
/// Create a copy of CompanyListDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -309,11 +390,14 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
const factory _CompanyListDto(
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String address,
|
||||
final String? address,
|
||||
@JsonKey(name: 'contact_name') final String? contactName,
|
||||
@JsonKey(name: 'contact_phone') final String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') final String? contactEmail,
|
||||
@JsonKey(name: 'company_types') final List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_active') required final bool isActive,
|
||||
@JsonKey(name: 'is_partner') final bool isPartner,
|
||||
@JsonKey(name: 'is_customer') final bool isCustomer,
|
||||
@JsonKey(name: 'created_at') final DateTime? createdAt,
|
||||
@JsonKey(name: 'branch_count') final int branchCount}) =
|
||||
_$CompanyListDtoImpl;
|
||||
@@ -326,7 +410,7 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get address;
|
||||
String? get address;
|
||||
@override
|
||||
@JsonKey(name: 'contact_name')
|
||||
String? get contactName;
|
||||
@@ -337,9 +421,18 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
@JsonKey(name: 'contact_email')
|
||||
String? get contactEmail;
|
||||
@override
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes;
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
bool get isActive;
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool get isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool get isCustomer;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime? get createdAt;
|
||||
@override
|
||||
|
||||
@@ -10,11 +10,16 @@ _$CompanyListDtoImpl _$$CompanyListDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CompanyListDtoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
address: json['address'] as String,
|
||||
address: json['address'] as String?,
|
||||
contactName: json['contact_name'] as String?,
|
||||
contactPhone: json['contact_phone'] as String?,
|
||||
contactEmail: json['contact_email'] as String?,
|
||||
companyTypes: (json['company_types'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
isActive: json['is_active'] as bool,
|
||||
isPartner: json['is_partner'] as bool? ?? false,
|
||||
isCustomer: json['is_customer'] as bool? ?? false,
|
||||
createdAt: json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String),
|
||||
@@ -30,7 +35,10 @@ Map<String, dynamic> _$$CompanyListDtoImplToJson(
|
||||
'contact_name': instance.contactName,
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'company_types': instance.companyTypes,
|
||||
'is_active': instance.isActive,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
'branch_count': instance.branchCount,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user