refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -32,6 +32,8 @@ class UpdateCompanyRequest with _$UpdateCompanyRequest {
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') bool? isPartner,
|
||||
@JsonKey(name: 'is_customer') bool? isCustomer,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
}) = _UpdateCompanyRequest;
|
||||
@@ -45,7 +47,7 @@ class CompanyResponse with _$CompanyResponse {
|
||||
const factory CompanyResponse({
|
||||
required int id,
|
||||
required String name,
|
||||
required String address,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') required String contactName,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition, // nullable로 변경
|
||||
@JsonKey(name: 'contact_phone') required String contactPhone,
|
||||
|
||||
@@ -415,6 +415,10 @@ mixin _$UpdateCompanyRequest {
|
||||
String? get contactEmail => 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;
|
||||
String? get remark => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active')
|
||||
bool? get isActive => throw _privateConstructorUsedError;
|
||||
@@ -443,6 +447,8 @@ abstract class $UpdateCompanyRequestCopyWith<$Res> {
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') bool? isPartner,
|
||||
@JsonKey(name: 'is_customer') bool? isCustomer,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive});
|
||||
}
|
||||
@@ -470,6 +476,8 @@ class _$UpdateCompanyRequestCopyWithImpl<$Res,
|
||||
Object? contactPhone = freezed,
|
||||
Object? contactEmail = freezed,
|
||||
Object? companyTypes = freezed,
|
||||
Object? isPartner = freezed,
|
||||
Object? isCustomer = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? isActive = freezed,
|
||||
}) {
|
||||
@@ -502,6 +510,14 @@ class _$UpdateCompanyRequestCopyWithImpl<$Res,
|
||||
? _value.companyTypes
|
||||
: companyTypes // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
isPartner: freezed == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
isCustomer: freezed == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
@@ -530,6 +546,8 @@ abstract class _$$UpdateCompanyRequestImplCopyWith<$Res>
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') bool? isPartner,
|
||||
@JsonKey(name: 'is_customer') bool? isCustomer,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive});
|
||||
}
|
||||
@@ -554,6 +572,8 @@ class __$$UpdateCompanyRequestImplCopyWithImpl<$Res>
|
||||
Object? contactPhone = freezed,
|
||||
Object? contactEmail = freezed,
|
||||
Object? companyTypes = freezed,
|
||||
Object? isPartner = freezed,
|
||||
Object? isCustomer = freezed,
|
||||
Object? remark = freezed,
|
||||
Object? isActive = freezed,
|
||||
}) {
|
||||
@@ -586,6 +606,14 @@ class __$$UpdateCompanyRequestImplCopyWithImpl<$Res>
|
||||
? _value._companyTypes
|
||||
: companyTypes // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
isPartner: freezed == isPartner
|
||||
? _value.isPartner
|
||||
: isPartner // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
isCustomer: freezed == isCustomer
|
||||
? _value.isCustomer
|
||||
: isCustomer // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
remark: freezed == remark
|
||||
? _value.remark
|
||||
: remark // ignore: cast_nullable_to_non_nullable
|
||||
@@ -609,6 +637,8 @@ class _$UpdateCompanyRequestImpl implements _UpdateCompanyRequest {
|
||||
@JsonKey(name: 'contact_phone') this.contactPhone,
|
||||
@JsonKey(name: 'contact_email') this.contactEmail,
|
||||
@JsonKey(name: 'company_types') final List<String>? companyTypes,
|
||||
@JsonKey(name: 'is_partner') this.isPartner,
|
||||
@JsonKey(name: 'is_customer') this.isCustomer,
|
||||
this.remark,
|
||||
@JsonKey(name: 'is_active') this.isActive})
|
||||
: _companyTypes = companyTypes;
|
||||
@@ -643,6 +673,12 @@ class _$UpdateCompanyRequestImpl implements _UpdateCompanyRequest {
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
final bool? isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
final bool? isCustomer;
|
||||
@override
|
||||
final String? remark;
|
||||
@override
|
||||
@@ -651,7 +687,7 @@ class _$UpdateCompanyRequestImpl implements _UpdateCompanyRequest {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UpdateCompanyRequest(name: $name, address: $address, contactName: $contactName, contactPosition: $contactPosition, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, remark: $remark, isActive: $isActive)';
|
||||
return 'UpdateCompanyRequest(name: $name, address: $address, contactName: $contactName, contactPosition: $contactPosition, contactPhone: $contactPhone, contactEmail: $contactEmail, companyTypes: $companyTypes, isPartner: $isPartner, isCustomer: $isCustomer, remark: $remark, isActive: $isActive)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -671,6 +707,10 @@ class _$UpdateCompanyRequestImpl implements _UpdateCompanyRequest {
|
||||
other.contactEmail == contactEmail) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._companyTypes, _companyTypes) &&
|
||||
(identical(other.isPartner, isPartner) ||
|
||||
other.isPartner == isPartner) &&
|
||||
(identical(other.isCustomer, isCustomer) ||
|
||||
other.isCustomer == isCustomer) &&
|
||||
(identical(other.remark, remark) || other.remark == remark) &&
|
||||
(identical(other.isActive, isActive) ||
|
||||
other.isActive == isActive));
|
||||
@@ -687,6 +727,8 @@ class _$UpdateCompanyRequestImpl implements _UpdateCompanyRequest {
|
||||
contactPhone,
|
||||
contactEmail,
|
||||
const DeepCollectionEquality().hash(_companyTypes),
|
||||
isPartner,
|
||||
isCustomer,
|
||||
remark,
|
||||
isActive);
|
||||
|
||||
@@ -717,6 +759,8 @@ abstract class _UpdateCompanyRequest implements UpdateCompanyRequest {
|
||||
@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_partner') final bool? isPartner,
|
||||
@JsonKey(name: 'is_customer') final bool? isCustomer,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_active') final bool? isActive}) =
|
||||
_$UpdateCompanyRequestImpl;
|
||||
@@ -744,6 +788,12 @@ abstract class _UpdateCompanyRequest implements UpdateCompanyRequest {
|
||||
@JsonKey(name: 'company_types')
|
||||
List<String>? get companyTypes;
|
||||
@override
|
||||
@JsonKey(name: 'is_partner')
|
||||
bool? get isPartner;
|
||||
@override
|
||||
@JsonKey(name: 'is_customer')
|
||||
bool? get isCustomer;
|
||||
@override
|
||||
String? get remark;
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
@@ -765,7 +815,7 @@ CompanyResponse _$CompanyResponseFromJson(Map<String, dynamic> json) {
|
||||
mixin _$CompanyResponse {
|
||||
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_position')
|
||||
@@ -810,7 +860,7 @@ abstract class $CompanyResponseCopyWith<$Res> {
|
||||
$Res call(
|
||||
{int id,
|
||||
String name,
|
||||
String address,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') String contactName,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') String contactPhone,
|
||||
@@ -842,7 +892,7 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? address = freezed,
|
||||
Object? contactName = null,
|
||||
Object? contactPosition = freezed,
|
||||
Object? contactPhone = null,
|
||||
@@ -865,10 +915,10 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
? _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: null == contactName
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -932,7 +982,7 @@ abstract class _$$CompanyResponseImplCopyWith<$Res>
|
||||
$Res call(
|
||||
{int id,
|
||||
String name,
|
||||
String address,
|
||||
String? address,
|
||||
@JsonKey(name: 'contact_name') String contactName,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') String contactPhone,
|
||||
@@ -962,7 +1012,7 @@ class __$$CompanyResponseImplCopyWithImpl<$Res>
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? address = freezed,
|
||||
Object? contactName = null,
|
||||
Object? contactPosition = freezed,
|
||||
Object? contactPhone = null,
|
||||
@@ -985,10 +1035,10 @@ class __$$CompanyResponseImplCopyWithImpl<$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: null == contactName
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -1047,7 +1097,7 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
const _$CompanyResponseImpl(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.address,
|
||||
this.address,
|
||||
@JsonKey(name: 'contact_name') required this.contactName,
|
||||
@JsonKey(name: 'contact_position') this.contactPosition,
|
||||
@JsonKey(name: 'contact_phone') required this.contactPhone,
|
||||
@@ -1071,7 +1121,7 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String address;
|
||||
final String? address;
|
||||
@override
|
||||
@JsonKey(name: 'contact_name')
|
||||
final String contactName;
|
||||
@@ -1195,7 +1245,7 @@ abstract class _CompanyResponse implements CompanyResponse {
|
||||
const factory _CompanyResponse(
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String address,
|
||||
final String? address,
|
||||
@JsonKey(name: 'contact_name') required final String contactName,
|
||||
@JsonKey(name: 'contact_position') final String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') required final String contactPhone,
|
||||
@@ -1218,7 +1268,7 @@ abstract class _CompanyResponse implements CompanyResponse {
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get address;
|
||||
String? get address;
|
||||
@override
|
||||
@JsonKey(name: 'contact_name')
|
||||
String get contactName;
|
||||
|
||||
@@ -51,6 +51,8 @@ _$UpdateCompanyRequestImpl _$$UpdateCompanyRequestImplFromJson(
|
||||
companyTypes: (json['company_types'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
isPartner: json['is_partner'] as bool?,
|
||||
isCustomer: json['is_customer'] as bool?,
|
||||
remark: json['remark'] as String?,
|
||||
isActive: json['is_active'] as bool?,
|
||||
);
|
||||
@@ -65,6 +67,8 @@ Map<String, dynamic> _$$UpdateCompanyRequestImplToJson(
|
||||
'contact_phone': instance.contactPhone,
|
||||
'contact_email': instance.contactEmail,
|
||||
'company_types': instance.companyTypes,
|
||||
'is_partner': instance.isPartner,
|
||||
'is_customer': instance.isCustomer,
|
||||
'remark': instance.remark,
|
||||
'is_active': instance.isActive,
|
||||
};
|
||||
@@ -74,7 +78,7 @@ _$CompanyResponseImpl _$$CompanyResponseImplFromJson(
|
||||
_$CompanyResponseImpl(
|
||||
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,
|
||||
contactPosition: json['contact_position'] as String?,
|
||||
contactPhone: json['contact_phone'] as String,
|
||||
|
||||
Reference in New Issue
Block a user