clean: Phase 1 - 26개 미사용 파일 삭제 완료
삭제된 파일: - 구식 Equipment 모델: 18개 파일 (6개 모델 × 3개씩) - 미사용 UseCase 컨테이너: 5개 파일 - 레거시 UI 컴포넌트: 5개 파일 - Import 오류 수정: custom_widgets.dart 정리 총 28개 변경사항 (삭제 26개 + 수정 1개 + 기타) Flutter analyze: ERROR 0개 ✅ Build test: 성공 ✅ 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
|
|
||||||
part 'equipment_in_request.freezed.dart';
|
|
||||||
part 'equipment_in_request.g.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentInRequest with _$EquipmentInRequest {
|
|
||||||
const factory EquipmentInRequest({
|
|
||||||
required int equipmentId,
|
|
||||||
required int quantity,
|
|
||||||
int? warehouseLocationId,
|
|
||||||
String? notes,
|
|
||||||
}) = _EquipmentInRequest;
|
|
||||||
|
|
||||||
factory EquipmentInRequest.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentInRequestFromJson(json);
|
|
||||||
}
|
|
||||||
@@ -1,227 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
// 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 'equipment_in_request.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(T value) => value;
|
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
||||||
|
|
||||||
EquipmentInRequest _$EquipmentInRequestFromJson(Map<String, dynamic> json) {
|
|
||||||
return _EquipmentInRequest.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$EquipmentInRequest {
|
|
||||||
int get equipmentId => throw _privateConstructorUsedError;
|
|
||||||
int get quantity => throw _privateConstructorUsedError;
|
|
||||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
|
||||||
String? get notes => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Serializes this EquipmentInRequest to a JSON map.
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentInRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$EquipmentInRequestCopyWith<EquipmentInRequest> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $EquipmentInRequestCopyWith<$Res> {
|
|
||||||
factory $EquipmentInRequestCopyWith(
|
|
||||||
EquipmentInRequest value, $Res Function(EquipmentInRequest) then) =
|
|
||||||
_$EquipmentInRequestCopyWithImpl<$Res, EquipmentInRequest>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{int equipmentId, int quantity, int? warehouseLocationId, String? notes});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$EquipmentInRequestCopyWithImpl<$Res, $Val extends EquipmentInRequest>
|
|
||||||
implements $EquipmentInRequestCopyWith<$Res> {
|
|
||||||
_$EquipmentInRequestCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentInRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? equipmentId = null,
|
|
||||||
Object? quantity = null,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? notes = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
equipmentId: null == equipmentId
|
|
||||||
? _value.equipmentId
|
|
||||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
quantity: null == quantity
|
|
||||||
? _value.quantity
|
|
||||||
: quantity // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
notes: freezed == notes
|
|
||||||
? _value.notes
|
|
||||||
: notes // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$EquipmentInRequestImplCopyWith<$Res>
|
|
||||||
implements $EquipmentInRequestCopyWith<$Res> {
|
|
||||||
factory _$$EquipmentInRequestImplCopyWith(_$EquipmentInRequestImpl value,
|
|
||||||
$Res Function(_$EquipmentInRequestImpl) then) =
|
|
||||||
__$$EquipmentInRequestImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{int equipmentId, int quantity, int? warehouseLocationId, String? notes});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$EquipmentInRequestImplCopyWithImpl<$Res>
|
|
||||||
extends _$EquipmentInRequestCopyWithImpl<$Res, _$EquipmentInRequestImpl>
|
|
||||||
implements _$$EquipmentInRequestImplCopyWith<$Res> {
|
|
||||||
__$$EquipmentInRequestImplCopyWithImpl(_$EquipmentInRequestImpl _value,
|
|
||||||
$Res Function(_$EquipmentInRequestImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentInRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? equipmentId = null,
|
|
||||||
Object? quantity = null,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? notes = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$EquipmentInRequestImpl(
|
|
||||||
equipmentId: null == equipmentId
|
|
||||||
? _value.equipmentId
|
|
||||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
quantity: null == quantity
|
|
||||||
? _value.quantity
|
|
||||||
: quantity // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
notes: freezed == notes
|
|
||||||
? _value.notes
|
|
||||||
: notes // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$EquipmentInRequestImpl implements _EquipmentInRequest {
|
|
||||||
const _$EquipmentInRequestImpl(
|
|
||||||
{required this.equipmentId,
|
|
||||||
required this.quantity,
|
|
||||||
this.warehouseLocationId,
|
|
||||||
this.notes});
|
|
||||||
|
|
||||||
factory _$EquipmentInRequestImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$EquipmentInRequestImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final int equipmentId;
|
|
||||||
@override
|
|
||||||
final int quantity;
|
|
||||||
@override
|
|
||||||
final int? warehouseLocationId;
|
|
||||||
@override
|
|
||||||
final String? notes;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'EquipmentInRequest(equipmentId: $equipmentId, quantity: $quantity, warehouseLocationId: $warehouseLocationId, notes: $notes)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$EquipmentInRequestImpl &&
|
|
||||||
(identical(other.equipmentId, equipmentId) ||
|
|
||||||
other.equipmentId == equipmentId) &&
|
|
||||||
(identical(other.quantity, quantity) ||
|
|
||||||
other.quantity == quantity) &&
|
|
||||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
|
||||||
other.warehouseLocationId == warehouseLocationId) &&
|
|
||||||
(identical(other.notes, notes) || other.notes == notes));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType, equipmentId, quantity, warehouseLocationId, notes);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentInRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$EquipmentInRequestImplCopyWith<_$EquipmentInRequestImpl> get copyWith =>
|
|
||||||
__$$EquipmentInRequestImplCopyWithImpl<_$EquipmentInRequestImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$EquipmentInRequestImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _EquipmentInRequest implements EquipmentInRequest {
|
|
||||||
const factory _EquipmentInRequest(
|
|
||||||
{required final int equipmentId,
|
|
||||||
required final int quantity,
|
|
||||||
final int? warehouseLocationId,
|
|
||||||
final String? notes}) = _$EquipmentInRequestImpl;
|
|
||||||
|
|
||||||
factory _EquipmentInRequest.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$EquipmentInRequestImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get equipmentId;
|
|
||||||
@override
|
|
||||||
int get quantity;
|
|
||||||
@override
|
|
||||||
int? get warehouseLocationId;
|
|
||||||
@override
|
|
||||||
String? get notes;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentInRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$EquipmentInRequestImplCopyWith<_$EquipmentInRequestImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'equipment_in_request.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$EquipmentInRequestImpl _$$EquipmentInRequestImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentInRequestImpl(
|
|
||||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
|
||||||
quantity: (json['quantity'] as num).toInt(),
|
|
||||||
warehouseLocationId: (json['warehouseLocationId'] as num?)?.toInt(),
|
|
||||||
notes: json['notes'] as String?,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentInRequestImplToJson(
|
|
||||||
_$EquipmentInRequestImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'equipmentId': instance.equipmentId,
|
|
||||||
'quantity': instance.quantity,
|
|
||||||
'warehouseLocationId': instance.warehouseLocationId,
|
|
||||||
'notes': instance.notes,
|
|
||||||
};
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
|
|
||||||
part 'equipment_io_response.freezed.dart';
|
|
||||||
part 'equipment_io_response.g.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentIoResponse with _$EquipmentIoResponse {
|
|
||||||
const factory EquipmentIoResponse({
|
|
||||||
required bool success,
|
|
||||||
required String message,
|
|
||||||
required int transactionId,
|
|
||||||
required int equipmentId,
|
|
||||||
required int quantity,
|
|
||||||
required String transactionType,
|
|
||||||
required DateTime transactionDate,
|
|
||||||
}) = _EquipmentIoResponse;
|
|
||||||
|
|
||||||
factory EquipmentIoResponse.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentIoResponseFromJson(json);
|
|
||||||
}
|
|
||||||
@@ -1,295 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
// 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 'equipment_io_response.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(T value) => value;
|
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
||||||
|
|
||||||
EquipmentIoResponse _$EquipmentIoResponseFromJson(Map<String, dynamic> json) {
|
|
||||||
return _EquipmentIoResponse.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$EquipmentIoResponse {
|
|
||||||
bool get success => throw _privateConstructorUsedError;
|
|
||||||
String get message => throw _privateConstructorUsedError;
|
|
||||||
int get transactionId => throw _privateConstructorUsedError;
|
|
||||||
int get equipmentId => throw _privateConstructorUsedError;
|
|
||||||
int get quantity => throw _privateConstructorUsedError;
|
|
||||||
String get transactionType => throw _privateConstructorUsedError;
|
|
||||||
DateTime get transactionDate => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Serializes this EquipmentIoResponse to a JSON map.
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentIoResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$EquipmentIoResponseCopyWith<EquipmentIoResponse> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $EquipmentIoResponseCopyWith<$Res> {
|
|
||||||
factory $EquipmentIoResponseCopyWith(
|
|
||||||
EquipmentIoResponse value, $Res Function(EquipmentIoResponse) then) =
|
|
||||||
_$EquipmentIoResponseCopyWithImpl<$Res, EquipmentIoResponse>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{bool success,
|
|
||||||
String message,
|
|
||||||
int transactionId,
|
|
||||||
int equipmentId,
|
|
||||||
int quantity,
|
|
||||||
String transactionType,
|
|
||||||
DateTime transactionDate});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$EquipmentIoResponseCopyWithImpl<$Res, $Val extends EquipmentIoResponse>
|
|
||||||
implements $EquipmentIoResponseCopyWith<$Res> {
|
|
||||||
_$EquipmentIoResponseCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentIoResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? success = null,
|
|
||||||
Object? message = null,
|
|
||||||
Object? transactionId = null,
|
|
||||||
Object? equipmentId = null,
|
|
||||||
Object? quantity = null,
|
|
||||||
Object? transactionType = null,
|
|
||||||
Object? transactionDate = null,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
success: null == success
|
|
||||||
? _value.success
|
|
||||||
: success // ignore: cast_nullable_to_non_nullable
|
|
||||||
as bool,
|
|
||||||
message: null == message
|
|
||||||
? _value.message
|
|
||||||
: message // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
transactionId: null == transactionId
|
|
||||||
? _value.transactionId
|
|
||||||
: transactionId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
equipmentId: null == equipmentId
|
|
||||||
? _value.equipmentId
|
|
||||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
quantity: null == quantity
|
|
||||||
? _value.quantity
|
|
||||||
: quantity // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
transactionType: null == transactionType
|
|
||||||
? _value.transactionType
|
|
||||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
transactionDate: null == transactionDate
|
|
||||||
? _value.transactionDate
|
|
||||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$EquipmentIoResponseImplCopyWith<$Res>
|
|
||||||
implements $EquipmentIoResponseCopyWith<$Res> {
|
|
||||||
factory _$$EquipmentIoResponseImplCopyWith(_$EquipmentIoResponseImpl value,
|
|
||||||
$Res Function(_$EquipmentIoResponseImpl) then) =
|
|
||||||
__$$EquipmentIoResponseImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{bool success,
|
|
||||||
String message,
|
|
||||||
int transactionId,
|
|
||||||
int equipmentId,
|
|
||||||
int quantity,
|
|
||||||
String transactionType,
|
|
||||||
DateTime transactionDate});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$EquipmentIoResponseImplCopyWithImpl<$Res>
|
|
||||||
extends _$EquipmentIoResponseCopyWithImpl<$Res, _$EquipmentIoResponseImpl>
|
|
||||||
implements _$$EquipmentIoResponseImplCopyWith<$Res> {
|
|
||||||
__$$EquipmentIoResponseImplCopyWithImpl(_$EquipmentIoResponseImpl _value,
|
|
||||||
$Res Function(_$EquipmentIoResponseImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentIoResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? success = null,
|
|
||||||
Object? message = null,
|
|
||||||
Object? transactionId = null,
|
|
||||||
Object? equipmentId = null,
|
|
||||||
Object? quantity = null,
|
|
||||||
Object? transactionType = null,
|
|
||||||
Object? transactionDate = null,
|
|
||||||
}) {
|
|
||||||
return _then(_$EquipmentIoResponseImpl(
|
|
||||||
success: null == success
|
|
||||||
? _value.success
|
|
||||||
: success // ignore: cast_nullable_to_non_nullable
|
|
||||||
as bool,
|
|
||||||
message: null == message
|
|
||||||
? _value.message
|
|
||||||
: message // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
transactionId: null == transactionId
|
|
||||||
? _value.transactionId
|
|
||||||
: transactionId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
equipmentId: null == equipmentId
|
|
||||||
? _value.equipmentId
|
|
||||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
quantity: null == quantity
|
|
||||||
? _value.quantity
|
|
||||||
: quantity // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
transactionType: null == transactionType
|
|
||||||
? _value.transactionType
|
|
||||||
: transactionType // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
transactionDate: null == transactionDate
|
|
||||||
? _value.transactionDate
|
|
||||||
: transactionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$EquipmentIoResponseImpl implements _EquipmentIoResponse {
|
|
||||||
const _$EquipmentIoResponseImpl(
|
|
||||||
{required this.success,
|
|
||||||
required this.message,
|
|
||||||
required this.transactionId,
|
|
||||||
required this.equipmentId,
|
|
||||||
required this.quantity,
|
|
||||||
required this.transactionType,
|
|
||||||
required this.transactionDate});
|
|
||||||
|
|
||||||
factory _$EquipmentIoResponseImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$EquipmentIoResponseImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final bool success;
|
|
||||||
@override
|
|
||||||
final String message;
|
|
||||||
@override
|
|
||||||
final int transactionId;
|
|
||||||
@override
|
|
||||||
final int equipmentId;
|
|
||||||
@override
|
|
||||||
final int quantity;
|
|
||||||
@override
|
|
||||||
final String transactionType;
|
|
||||||
@override
|
|
||||||
final DateTime transactionDate;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'EquipmentIoResponse(success: $success, message: $message, transactionId: $transactionId, equipmentId: $equipmentId, quantity: $quantity, transactionType: $transactionType, transactionDate: $transactionDate)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$EquipmentIoResponseImpl &&
|
|
||||||
(identical(other.success, success) || other.success == success) &&
|
|
||||||
(identical(other.message, message) || other.message == message) &&
|
|
||||||
(identical(other.transactionId, transactionId) ||
|
|
||||||
other.transactionId == transactionId) &&
|
|
||||||
(identical(other.equipmentId, equipmentId) ||
|
|
||||||
other.equipmentId == equipmentId) &&
|
|
||||||
(identical(other.quantity, quantity) ||
|
|
||||||
other.quantity == quantity) &&
|
|
||||||
(identical(other.transactionType, transactionType) ||
|
|
||||||
other.transactionType == transactionType) &&
|
|
||||||
(identical(other.transactionDate, transactionDate) ||
|
|
||||||
other.transactionDate == transactionDate));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(runtimeType, success, message, transactionId,
|
|
||||||
equipmentId, quantity, transactionType, transactionDate);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentIoResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$EquipmentIoResponseImplCopyWith<_$EquipmentIoResponseImpl> get copyWith =>
|
|
||||||
__$$EquipmentIoResponseImplCopyWithImpl<_$EquipmentIoResponseImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$EquipmentIoResponseImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _EquipmentIoResponse implements EquipmentIoResponse {
|
|
||||||
const factory _EquipmentIoResponse(
|
|
||||||
{required final bool success,
|
|
||||||
required final String message,
|
|
||||||
required final int transactionId,
|
|
||||||
required final int equipmentId,
|
|
||||||
required final int quantity,
|
|
||||||
required final String transactionType,
|
|
||||||
required final DateTime transactionDate}) = _$EquipmentIoResponseImpl;
|
|
||||||
|
|
||||||
factory _EquipmentIoResponse.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$EquipmentIoResponseImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get success;
|
|
||||||
@override
|
|
||||||
String get message;
|
|
||||||
@override
|
|
||||||
int get transactionId;
|
|
||||||
@override
|
|
||||||
int get equipmentId;
|
|
||||||
@override
|
|
||||||
int get quantity;
|
|
||||||
@override
|
|
||||||
String get transactionType;
|
|
||||||
@override
|
|
||||||
DateTime get transactionDate;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentIoResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$EquipmentIoResponseImplCopyWith<_$EquipmentIoResponseImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'equipment_io_response.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$EquipmentIoResponseImpl _$$EquipmentIoResponseImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentIoResponseImpl(
|
|
||||||
success: json['success'] as bool,
|
|
||||||
message: json['message'] as String,
|
|
||||||
transactionId: (json['transactionId'] as num).toInt(),
|
|
||||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
|
||||||
quantity: (json['quantity'] as num).toInt(),
|
|
||||||
transactionType: json['transactionType'] as String,
|
|
||||||
transactionDate: DateTime.parse(json['transactionDate'] as String),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentIoResponseImplToJson(
|
|
||||||
_$EquipmentIoResponseImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'success': instance.success,
|
|
||||||
'message': instance.message,
|
|
||||||
'transactionId': instance.transactionId,
|
|
||||||
'equipmentId': instance.equipmentId,
|
|
||||||
'quantity': instance.quantity,
|
|
||||||
'transactionType': instance.transactionType,
|
|
||||||
'transactionDate': instance.transactionDate.toIso8601String(),
|
|
||||||
};
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
|
|
||||||
part 'equipment_out_request.freezed.dart';
|
|
||||||
part 'equipment_out_request.g.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentOutRequest with _$EquipmentOutRequest {
|
|
||||||
const factory EquipmentOutRequest({
|
|
||||||
required int equipmentId,
|
|
||||||
required int quantity,
|
|
||||||
required int companyId,
|
|
||||||
String? notes,
|
|
||||||
}) = _EquipmentOutRequest;
|
|
||||||
|
|
||||||
factory EquipmentOutRequest.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentOutRequestFromJson(json);
|
|
||||||
}
|
|
||||||
@@ -1,225 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
// 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 'equipment_out_request.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(T value) => value;
|
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
||||||
|
|
||||||
EquipmentOutRequest _$EquipmentOutRequestFromJson(Map<String, dynamic> json) {
|
|
||||||
return _EquipmentOutRequest.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$EquipmentOutRequest {
|
|
||||||
int get equipmentId => throw _privateConstructorUsedError;
|
|
||||||
int get quantity => throw _privateConstructorUsedError;
|
|
||||||
int get companyId => throw _privateConstructorUsedError;
|
|
||||||
String? get notes => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Serializes this EquipmentOutRequest to a JSON map.
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentOutRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$EquipmentOutRequestCopyWith<EquipmentOutRequest> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $EquipmentOutRequestCopyWith<$Res> {
|
|
||||||
factory $EquipmentOutRequestCopyWith(
|
|
||||||
EquipmentOutRequest value, $Res Function(EquipmentOutRequest) then) =
|
|
||||||
_$EquipmentOutRequestCopyWithImpl<$Res, EquipmentOutRequest>;
|
|
||||||
@useResult
|
|
||||||
$Res call({int equipmentId, int quantity, int companyId, String? notes});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$EquipmentOutRequestCopyWithImpl<$Res, $Val extends EquipmentOutRequest>
|
|
||||||
implements $EquipmentOutRequestCopyWith<$Res> {
|
|
||||||
_$EquipmentOutRequestCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentOutRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? equipmentId = null,
|
|
||||||
Object? quantity = null,
|
|
||||||
Object? companyId = null,
|
|
||||||
Object? notes = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
equipmentId: null == equipmentId
|
|
||||||
? _value.equipmentId
|
|
||||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
quantity: null == quantity
|
|
||||||
? _value.quantity
|
|
||||||
: quantity // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
companyId: null == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
notes: freezed == notes
|
|
||||||
? _value.notes
|
|
||||||
: notes // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$EquipmentOutRequestImplCopyWith<$Res>
|
|
||||||
implements $EquipmentOutRequestCopyWith<$Res> {
|
|
||||||
factory _$$EquipmentOutRequestImplCopyWith(_$EquipmentOutRequestImpl value,
|
|
||||||
$Res Function(_$EquipmentOutRequestImpl) then) =
|
|
||||||
__$$EquipmentOutRequestImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call({int equipmentId, int quantity, int companyId, String? notes});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$EquipmentOutRequestImplCopyWithImpl<$Res>
|
|
||||||
extends _$EquipmentOutRequestCopyWithImpl<$Res, _$EquipmentOutRequestImpl>
|
|
||||||
implements _$$EquipmentOutRequestImplCopyWith<$Res> {
|
|
||||||
__$$EquipmentOutRequestImplCopyWithImpl(_$EquipmentOutRequestImpl _value,
|
|
||||||
$Res Function(_$EquipmentOutRequestImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentOutRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? equipmentId = null,
|
|
||||||
Object? quantity = null,
|
|
||||||
Object? companyId = null,
|
|
||||||
Object? notes = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$EquipmentOutRequestImpl(
|
|
||||||
equipmentId: null == equipmentId
|
|
||||||
? _value.equipmentId
|
|
||||||
: equipmentId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
quantity: null == quantity
|
|
||||||
? _value.quantity
|
|
||||||
: quantity // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
companyId: null == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
notes: freezed == notes
|
|
||||||
? _value.notes
|
|
||||||
: notes // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$EquipmentOutRequestImpl implements _EquipmentOutRequest {
|
|
||||||
const _$EquipmentOutRequestImpl(
|
|
||||||
{required this.equipmentId,
|
|
||||||
required this.quantity,
|
|
||||||
required this.companyId,
|
|
||||||
this.notes});
|
|
||||||
|
|
||||||
factory _$EquipmentOutRequestImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$EquipmentOutRequestImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final int equipmentId;
|
|
||||||
@override
|
|
||||||
final int quantity;
|
|
||||||
@override
|
|
||||||
final int companyId;
|
|
||||||
@override
|
|
||||||
final String? notes;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'EquipmentOutRequest(equipmentId: $equipmentId, quantity: $quantity, companyId: $companyId, notes: $notes)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$EquipmentOutRequestImpl &&
|
|
||||||
(identical(other.equipmentId, equipmentId) ||
|
|
||||||
other.equipmentId == equipmentId) &&
|
|
||||||
(identical(other.quantity, quantity) ||
|
|
||||||
other.quantity == quantity) &&
|
|
||||||
(identical(other.companyId, companyId) ||
|
|
||||||
other.companyId == companyId) &&
|
|
||||||
(identical(other.notes, notes) || other.notes == notes));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode =>
|
|
||||||
Object.hash(runtimeType, equipmentId, quantity, companyId, notes);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentOutRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$EquipmentOutRequestImplCopyWith<_$EquipmentOutRequestImpl> get copyWith =>
|
|
||||||
__$$EquipmentOutRequestImplCopyWithImpl<_$EquipmentOutRequestImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$EquipmentOutRequestImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _EquipmentOutRequest implements EquipmentOutRequest {
|
|
||||||
const factory _EquipmentOutRequest(
|
|
||||||
{required final int equipmentId,
|
|
||||||
required final int quantity,
|
|
||||||
required final int companyId,
|
|
||||||
final String? notes}) = _$EquipmentOutRequestImpl;
|
|
||||||
|
|
||||||
factory _EquipmentOutRequest.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$EquipmentOutRequestImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get equipmentId;
|
|
||||||
@override
|
|
||||||
int get quantity;
|
|
||||||
@override
|
|
||||||
int get companyId;
|
|
||||||
@override
|
|
||||||
String? get notes;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentOutRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$EquipmentOutRequestImplCopyWith<_$EquipmentOutRequestImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'equipment_out_request.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$EquipmentOutRequestImpl _$$EquipmentOutRequestImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentOutRequestImpl(
|
|
||||||
equipmentId: (json['equipmentId'] as num).toInt(),
|
|
||||||
quantity: (json['quantity'] as num).toInt(),
|
|
||||||
companyId: (json['companyId'] as num).toInt(),
|
|
||||||
notes: json['notes'] as String?,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentOutRequestImplToJson(
|
|
||||||
_$EquipmentOutRequestImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'equipmentId': instance.equipmentId,
|
|
||||||
'quantity': instance.quantity,
|
|
||||||
'companyId': instance.companyId,
|
|
||||||
'notes': instance.notes,
|
|
||||||
};
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
|
|
||||||
part 'equipment_request.freezed.dart';
|
|
||||||
part 'equipment_request.g.dart';
|
|
||||||
|
|
||||||
/// NaiveDate 형식으로 변환하는 JsonConverter (날짜만, 시간 제외)
|
|
||||||
class NaiveDateConverter implements JsonConverter<DateTime?, String?> {
|
|
||||||
const NaiveDateConverter();
|
|
||||||
|
|
||||||
@override
|
|
||||||
DateTime? fromJson(String? json) {
|
|
||||||
return json != null ? DateTime.parse(json) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? toJson(DateTime? object) {
|
|
||||||
// NaiveDate 형식으로 변환: "YYYY-MM-DD"
|
|
||||||
return object?.toIso8601String().split('T')[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Decimal 호환성을 위한 JsonConverter
|
|
||||||
class DecimalConverter implements JsonConverter<double?, dynamic> {
|
|
||||||
const DecimalConverter();
|
|
||||||
|
|
||||||
@override
|
|
||||||
double? fromJson(dynamic json) {
|
|
||||||
if (json == null) return null;
|
|
||||||
if (json is num) return json.toDouble();
|
|
||||||
if (json is String) return double.tryParse(json);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
dynamic toJson(double? object) {
|
|
||||||
// Rust Decimal과 호환을 위해 문자열로 전송
|
|
||||||
return object?.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class CreateEquipmentRequest with _$CreateEquipmentRequest {
|
|
||||||
const factory CreateEquipmentRequest({
|
|
||||||
@JsonKey(name: 'equipment_number') required String equipmentNumber,
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@JsonKey(name: 'models_id') int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
||||||
String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') @NaiveDateConverter() DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') @DecimalConverter() double? purchasePrice,
|
|
||||||
@JsonKey(name: 'company_id') int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date') @NaiveDateConverter() DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date') @NaiveDateConverter() DateTime? nextInspectionDate,
|
|
||||||
String? remark,
|
|
||||||
}) = _CreateEquipmentRequest;
|
|
||||||
|
|
||||||
factory CreateEquipmentRequest.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$CreateEquipmentRequestFromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class UpdateEquipmentRequest with _$UpdateEquipmentRequest {
|
|
||||||
const factory UpdateEquipmentRequest({
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@JsonKey(name: 'models_id', includeIfNull: false) int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false) String? serialNumber,
|
|
||||||
@JsonKey(includeIfNull: false) String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false) @NaiveDateConverter() DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false) @DecimalConverter() double? purchasePrice,
|
|
||||||
@JsonKey(includeIfNull: false) String? status,
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false) int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false) int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false) @NaiveDateConverter() DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false) @NaiveDateConverter() DateTime? nextInspectionDate,
|
|
||||||
@JsonKey(includeIfNull: false) String? remark,
|
|
||||||
}) = _UpdateEquipmentRequest;
|
|
||||||
|
|
||||||
factory UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$UpdateEquipmentRequestFromJson(json);
|
|
||||||
}
|
|
||||||
@@ -1,932 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
// 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 'equipment_request.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(T value) => value;
|
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
||||||
|
|
||||||
CreateEquipmentRequest _$CreateEquipmentRequestFromJson(
|
|
||||||
Map<String, dynamic> json) {
|
|
||||||
return _CreateEquipmentRequest.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$CreateEquipmentRequest {
|
|
||||||
@JsonKey(name: 'equipment_number')
|
|
||||||
String get equipmentNumber =>
|
|
||||||
throw _privateConstructorUsedError; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@JsonKey(name: 'models_id')
|
|
||||||
int? get modelsId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'serial_number')
|
|
||||||
String? get serialNumber => throw _privateConstructorUsedError;
|
|
||||||
String? get barcode => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
@DecimalConverter()
|
|
||||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'company_id')
|
|
||||||
int? get companyId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'warehouse_location_id')
|
|
||||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
|
||||||
String? get remark => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Serializes this CreateEquipmentRequest to a JSON map.
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of CreateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$CreateEquipmentRequestCopyWith<CreateEquipmentRequest> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $CreateEquipmentRequestCopyWith<$Res> {
|
|
||||||
factory $CreateEquipmentRequestCopyWith(CreateEquipmentRequest value,
|
|
||||||
$Res Function(CreateEquipmentRequest) then) =
|
|
||||||
_$CreateEquipmentRequestCopyWithImpl<$Res, CreateEquipmentRequest>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{@JsonKey(name: 'equipment_number') String equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
||||||
String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
@DecimalConverter()
|
|
||||||
double? purchasePrice,
|
|
||||||
@JsonKey(name: 'company_id') int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? nextInspectionDate,
|
|
||||||
String? remark});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$CreateEquipmentRequestCopyWithImpl<$Res,
|
|
||||||
$Val extends CreateEquipmentRequest>
|
|
||||||
implements $CreateEquipmentRequestCopyWith<$Res> {
|
|
||||||
_$CreateEquipmentRequestCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of CreateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? equipmentNumber = null,
|
|
||||||
Object? modelsId = freezed,
|
|
||||||
Object? serialNumber = freezed,
|
|
||||||
Object? barcode = freezed,
|
|
||||||
Object? purchaseDate = freezed,
|
|
||||||
Object? purchasePrice = freezed,
|
|
||||||
Object? companyId = freezed,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? lastInspectionDate = freezed,
|
|
||||||
Object? nextInspectionDate = freezed,
|
|
||||||
Object? remark = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
equipmentNumber: null == equipmentNumber
|
|
||||||
? _value.equipmentNumber
|
|
||||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
modelsId: freezed == modelsId
|
|
||||||
? _value.modelsId
|
|
||||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
serialNumber: freezed == serialNumber
|
|
||||||
? _value.serialNumber
|
|
||||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
barcode: freezed == barcode
|
|
||||||
? _value.barcode
|
|
||||||
: barcode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
purchaseDate: freezed == purchaseDate
|
|
||||||
? _value.purchaseDate
|
|
||||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
purchasePrice: freezed == purchasePrice
|
|
||||||
? _value.purchasePrice
|
|
||||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
|
||||||
as double?,
|
|
||||||
companyId: freezed == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
lastInspectionDate: freezed == lastInspectionDate
|
|
||||||
? _value.lastInspectionDate
|
|
||||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
nextInspectionDate: freezed == nextInspectionDate
|
|
||||||
? _value.nextInspectionDate
|
|
||||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
remark: freezed == remark
|
|
||||||
? _value.remark
|
|
||||||
: remark // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$CreateEquipmentRequestImplCopyWith<$Res>
|
|
||||||
implements $CreateEquipmentRequestCopyWith<$Res> {
|
|
||||||
factory _$$CreateEquipmentRequestImplCopyWith(
|
|
||||||
_$CreateEquipmentRequestImpl value,
|
|
||||||
$Res Function(_$CreateEquipmentRequestImpl) then) =
|
|
||||||
__$$CreateEquipmentRequestImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{@JsonKey(name: 'equipment_number') String equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
||||||
String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
@DecimalConverter()
|
|
||||||
double? purchasePrice,
|
|
||||||
@JsonKey(name: 'company_id') int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? nextInspectionDate,
|
|
||||||
String? remark});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$CreateEquipmentRequestImplCopyWithImpl<$Res>
|
|
||||||
extends _$CreateEquipmentRequestCopyWithImpl<$Res,
|
|
||||||
_$CreateEquipmentRequestImpl>
|
|
||||||
implements _$$CreateEquipmentRequestImplCopyWith<$Res> {
|
|
||||||
__$$CreateEquipmentRequestImplCopyWithImpl(
|
|
||||||
_$CreateEquipmentRequestImpl _value,
|
|
||||||
$Res Function(_$CreateEquipmentRequestImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of CreateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? equipmentNumber = null,
|
|
||||||
Object? modelsId = freezed,
|
|
||||||
Object? serialNumber = freezed,
|
|
||||||
Object? barcode = freezed,
|
|
||||||
Object? purchaseDate = freezed,
|
|
||||||
Object? purchasePrice = freezed,
|
|
||||||
Object? companyId = freezed,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? lastInspectionDate = freezed,
|
|
||||||
Object? nextInspectionDate = freezed,
|
|
||||||
Object? remark = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$CreateEquipmentRequestImpl(
|
|
||||||
equipmentNumber: null == equipmentNumber
|
|
||||||
? _value.equipmentNumber
|
|
||||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
modelsId: freezed == modelsId
|
|
||||||
? _value.modelsId
|
|
||||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
serialNumber: freezed == serialNumber
|
|
||||||
? _value.serialNumber
|
|
||||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
barcode: freezed == barcode
|
|
||||||
? _value.barcode
|
|
||||||
: barcode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
purchaseDate: freezed == purchaseDate
|
|
||||||
? _value.purchaseDate
|
|
||||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
purchasePrice: freezed == purchasePrice
|
|
||||||
? _value.purchasePrice
|
|
||||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
|
||||||
as double?,
|
|
||||||
companyId: freezed == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
lastInspectionDate: freezed == lastInspectionDate
|
|
||||||
? _value.lastInspectionDate
|
|
||||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
nextInspectionDate: freezed == nextInspectionDate
|
|
||||||
? _value.nextInspectionDate
|
|
||||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
remark: freezed == remark
|
|
||||||
? _value.remark
|
|
||||||
: remark // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$CreateEquipmentRequestImpl implements _CreateEquipmentRequest {
|
|
||||||
const _$CreateEquipmentRequestImpl(
|
|
||||||
{@JsonKey(name: 'equipment_number') required this.equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') this.modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
|
||||||
this.barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') @NaiveDateConverter() this.purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') @DecimalConverter() this.purchasePrice,
|
|
||||||
@JsonKey(name: 'company_id') this.companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
this.lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
this.nextInspectionDate,
|
|
||||||
this.remark});
|
|
||||||
|
|
||||||
factory _$CreateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$CreateEquipmentRequestImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'equipment_number')
|
|
||||||
final String equipmentNumber;
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'models_id')
|
|
||||||
final int? modelsId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'serial_number')
|
|
||||||
final String? serialNumber;
|
|
||||||
@override
|
|
||||||
final String? barcode;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? purchaseDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
@DecimalConverter()
|
|
||||||
final double? purchasePrice;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_id')
|
|
||||||
final int? companyId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_location_id')
|
|
||||||
final int? warehouseLocationId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? lastInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? nextInspectionDate;
|
|
||||||
@override
|
|
||||||
final String? remark;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'CreateEquipmentRequest(equipmentNumber: $equipmentNumber, modelsId: $modelsId, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$CreateEquipmentRequestImpl &&
|
|
||||||
(identical(other.equipmentNumber, equipmentNumber) ||
|
|
||||||
other.equipmentNumber == equipmentNumber) &&
|
|
||||||
(identical(other.modelsId, modelsId) ||
|
|
||||||
other.modelsId == modelsId) &&
|
|
||||||
(identical(other.serialNumber, serialNumber) ||
|
|
||||||
other.serialNumber == serialNumber) &&
|
|
||||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
|
||||||
(identical(other.purchaseDate, purchaseDate) ||
|
|
||||||
other.purchaseDate == purchaseDate) &&
|
|
||||||
(identical(other.purchasePrice, purchasePrice) ||
|
|
||||||
other.purchasePrice == purchasePrice) &&
|
|
||||||
(identical(other.companyId, companyId) ||
|
|
||||||
other.companyId == companyId) &&
|
|
||||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
|
||||||
other.warehouseLocationId == warehouseLocationId) &&
|
|
||||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
|
||||||
other.lastInspectionDate == lastInspectionDate) &&
|
|
||||||
(identical(other.nextInspectionDate, nextInspectionDate) ||
|
|
||||||
other.nextInspectionDate == nextInspectionDate) &&
|
|
||||||
(identical(other.remark, remark) || other.remark == remark));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType,
|
|
||||||
equipmentNumber,
|
|
||||||
modelsId,
|
|
||||||
serialNumber,
|
|
||||||
barcode,
|
|
||||||
purchaseDate,
|
|
||||||
purchasePrice,
|
|
||||||
companyId,
|
|
||||||
warehouseLocationId,
|
|
||||||
lastInspectionDate,
|
|
||||||
nextInspectionDate,
|
|
||||||
remark);
|
|
||||||
|
|
||||||
/// Create a copy of CreateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$CreateEquipmentRequestImplCopyWith<_$CreateEquipmentRequestImpl>
|
|
||||||
get copyWith => __$$CreateEquipmentRequestImplCopyWithImpl<
|
|
||||||
_$CreateEquipmentRequestImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$CreateEquipmentRequestImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _CreateEquipmentRequest implements CreateEquipmentRequest {
|
|
||||||
const factory _CreateEquipmentRequest(
|
|
||||||
{@JsonKey(name: 'equipment_number') required final String equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') final int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') final String? serialNumber,
|
|
||||||
final String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
@DecimalConverter()
|
|
||||||
final double? purchasePrice,
|
|
||||||
@JsonKey(name: 'company_id') final int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? nextInspectionDate,
|
|
||||||
final String? remark}) = _$CreateEquipmentRequestImpl;
|
|
||||||
|
|
||||||
factory _CreateEquipmentRequest.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$CreateEquipmentRequestImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'equipment_number')
|
|
||||||
String
|
|
||||||
get equipmentNumber; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'models_id')
|
|
||||||
int? get modelsId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'serial_number')
|
|
||||||
String? get serialNumber;
|
|
||||||
@override
|
|
||||||
String? get barcode;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get purchaseDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
@DecimalConverter()
|
|
||||||
double? get purchasePrice;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_id')
|
|
||||||
int? get companyId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_location_id')
|
|
||||||
int? get warehouseLocationId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get lastInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get nextInspectionDate;
|
|
||||||
@override
|
|
||||||
String? get remark;
|
|
||||||
|
|
||||||
/// Create a copy of CreateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$CreateEquipmentRequestImplCopyWith<_$CreateEquipmentRequestImpl>
|
|
||||||
get copyWith => throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateEquipmentRequest _$UpdateEquipmentRequestFromJson(
|
|
||||||
Map<String, dynamic> json) {
|
|
||||||
return _UpdateEquipmentRequest.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$UpdateEquipmentRequest {
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@JsonKey(name: 'models_id', includeIfNull: false)
|
|
||||||
int? get modelsId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
|
||||||
String? get serialNumber => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
String? get barcode => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
String? get status => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false)
|
|
||||||
int? get companyId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
String? get remark => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Serializes this UpdateEquipmentRequest to a JSON map.
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of UpdateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$UpdateEquipmentRequestCopyWith<UpdateEquipmentRequest> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $UpdateEquipmentRequestCopyWith<$Res> {
|
|
||||||
factory $UpdateEquipmentRequestCopyWith(UpdateEquipmentRequest value,
|
|
||||||
$Res Function(UpdateEquipmentRequest) then) =
|
|
||||||
_$UpdateEquipmentRequestCopyWithImpl<$Res, UpdateEquipmentRequest>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{@JsonKey(name: 'models_id', includeIfNull: false) int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
|
||||||
String? serialNumber,
|
|
||||||
@JsonKey(includeIfNull: false) String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
double? purchasePrice,
|
|
||||||
@JsonKey(includeIfNull: false) String? status,
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false) int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? nextInspectionDate,
|
|
||||||
@JsonKey(includeIfNull: false) String? remark});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$UpdateEquipmentRequestCopyWithImpl<$Res,
|
|
||||||
$Val extends UpdateEquipmentRequest>
|
|
||||||
implements $UpdateEquipmentRequestCopyWith<$Res> {
|
|
||||||
_$UpdateEquipmentRequestCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of UpdateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? modelsId = freezed,
|
|
||||||
Object? serialNumber = freezed,
|
|
||||||
Object? barcode = freezed,
|
|
||||||
Object? purchaseDate = freezed,
|
|
||||||
Object? purchasePrice = freezed,
|
|
||||||
Object? status = freezed,
|
|
||||||
Object? companyId = freezed,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? lastInspectionDate = freezed,
|
|
||||||
Object? nextInspectionDate = freezed,
|
|
||||||
Object? remark = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
modelsId: freezed == modelsId
|
|
||||||
? _value.modelsId
|
|
||||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
serialNumber: freezed == serialNumber
|
|
||||||
? _value.serialNumber
|
|
||||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
barcode: freezed == barcode
|
|
||||||
? _value.barcode
|
|
||||||
: barcode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
purchaseDate: freezed == purchaseDate
|
|
||||||
? _value.purchaseDate
|
|
||||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
purchasePrice: freezed == purchasePrice
|
|
||||||
? _value.purchasePrice
|
|
||||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
|
||||||
as double?,
|
|
||||||
status: freezed == status
|
|
||||||
? _value.status
|
|
||||||
: status // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
companyId: freezed == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
lastInspectionDate: freezed == lastInspectionDate
|
|
||||||
? _value.lastInspectionDate
|
|
||||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
nextInspectionDate: freezed == nextInspectionDate
|
|
||||||
? _value.nextInspectionDate
|
|
||||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
remark: freezed == remark
|
|
||||||
? _value.remark
|
|
||||||
: remark // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$UpdateEquipmentRequestImplCopyWith<$Res>
|
|
||||||
implements $UpdateEquipmentRequestCopyWith<$Res> {
|
|
||||||
factory _$$UpdateEquipmentRequestImplCopyWith(
|
|
||||||
_$UpdateEquipmentRequestImpl value,
|
|
||||||
$Res Function(_$UpdateEquipmentRequestImpl) then) =
|
|
||||||
__$$UpdateEquipmentRequestImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{@JsonKey(name: 'models_id', includeIfNull: false) int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
|
||||||
String? serialNumber,
|
|
||||||
@JsonKey(includeIfNull: false) String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
double? purchasePrice,
|
|
||||||
@JsonKey(includeIfNull: false) String? status,
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false) int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? nextInspectionDate,
|
|
||||||
@JsonKey(includeIfNull: false) String? remark});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$UpdateEquipmentRequestImplCopyWithImpl<$Res>
|
|
||||||
extends _$UpdateEquipmentRequestCopyWithImpl<$Res,
|
|
||||||
_$UpdateEquipmentRequestImpl>
|
|
||||||
implements _$$UpdateEquipmentRequestImplCopyWith<$Res> {
|
|
||||||
__$$UpdateEquipmentRequestImplCopyWithImpl(
|
|
||||||
_$UpdateEquipmentRequestImpl _value,
|
|
||||||
$Res Function(_$UpdateEquipmentRequestImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of UpdateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? modelsId = freezed,
|
|
||||||
Object? serialNumber = freezed,
|
|
||||||
Object? barcode = freezed,
|
|
||||||
Object? purchaseDate = freezed,
|
|
||||||
Object? purchasePrice = freezed,
|
|
||||||
Object? status = freezed,
|
|
||||||
Object? companyId = freezed,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? lastInspectionDate = freezed,
|
|
||||||
Object? nextInspectionDate = freezed,
|
|
||||||
Object? remark = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$UpdateEquipmentRequestImpl(
|
|
||||||
modelsId: freezed == modelsId
|
|
||||||
? _value.modelsId
|
|
||||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
serialNumber: freezed == serialNumber
|
|
||||||
? _value.serialNumber
|
|
||||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
barcode: freezed == barcode
|
|
||||||
? _value.barcode
|
|
||||||
: barcode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
purchaseDate: freezed == purchaseDate
|
|
||||||
? _value.purchaseDate
|
|
||||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
purchasePrice: freezed == purchasePrice
|
|
||||||
? _value.purchasePrice
|
|
||||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
|
||||||
as double?,
|
|
||||||
status: freezed == status
|
|
||||||
? _value.status
|
|
||||||
: status // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
companyId: freezed == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
lastInspectionDate: freezed == lastInspectionDate
|
|
||||||
? _value.lastInspectionDate
|
|
||||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
nextInspectionDate: freezed == nextInspectionDate
|
|
||||||
? _value.nextInspectionDate
|
|
||||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
remark: freezed == remark
|
|
||||||
? _value.remark
|
|
||||||
: remark // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$UpdateEquipmentRequestImpl implements _UpdateEquipmentRequest {
|
|
||||||
const _$UpdateEquipmentRequestImpl(
|
|
||||||
{@JsonKey(name: 'models_id', includeIfNull: false) this.modelsId,
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false) this.serialNumber,
|
|
||||||
@JsonKey(includeIfNull: false) this.barcode,
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
this.purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
this.purchasePrice,
|
|
||||||
@JsonKey(includeIfNull: false) this.status,
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false) this.companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
this.warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
this.lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
this.nextInspectionDate,
|
|
||||||
@JsonKey(includeIfNull: false) this.remark});
|
|
||||||
|
|
||||||
factory _$UpdateEquipmentRequestImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$UpdateEquipmentRequestImplFromJson(json);
|
|
||||||
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'models_id', includeIfNull: false)
|
|
||||||
final int? modelsId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
|
||||||
final String? serialNumber;
|
|
||||||
@override
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
final String? barcode;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? purchaseDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
final double? purchasePrice;
|
|
||||||
@override
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
final String? status;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false)
|
|
||||||
final int? companyId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
final int? warehouseLocationId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? lastInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? nextInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
final String? remark;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'UpdateEquipmentRequest(modelsId: $modelsId, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$UpdateEquipmentRequestImpl &&
|
|
||||||
(identical(other.modelsId, modelsId) ||
|
|
||||||
other.modelsId == modelsId) &&
|
|
||||||
(identical(other.serialNumber, serialNumber) ||
|
|
||||||
other.serialNumber == serialNumber) &&
|
|
||||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
|
||||||
(identical(other.purchaseDate, purchaseDate) ||
|
|
||||||
other.purchaseDate == purchaseDate) &&
|
|
||||||
(identical(other.purchasePrice, purchasePrice) ||
|
|
||||||
other.purchasePrice == purchasePrice) &&
|
|
||||||
(identical(other.status, status) || other.status == status) &&
|
|
||||||
(identical(other.companyId, companyId) ||
|
|
||||||
other.companyId == companyId) &&
|
|
||||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
|
||||||
other.warehouseLocationId == warehouseLocationId) &&
|
|
||||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
|
||||||
other.lastInspectionDate == lastInspectionDate) &&
|
|
||||||
(identical(other.nextInspectionDate, nextInspectionDate) ||
|
|
||||||
other.nextInspectionDate == nextInspectionDate) &&
|
|
||||||
(identical(other.remark, remark) || other.remark == remark));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType,
|
|
||||||
modelsId,
|
|
||||||
serialNumber,
|
|
||||||
barcode,
|
|
||||||
purchaseDate,
|
|
||||||
purchasePrice,
|
|
||||||
status,
|
|
||||||
companyId,
|
|
||||||
warehouseLocationId,
|
|
||||||
lastInspectionDate,
|
|
||||||
nextInspectionDate,
|
|
||||||
remark);
|
|
||||||
|
|
||||||
/// Create a copy of UpdateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$UpdateEquipmentRequestImplCopyWith<_$UpdateEquipmentRequestImpl>
|
|
||||||
get copyWith => __$$UpdateEquipmentRequestImplCopyWithImpl<
|
|
||||||
_$UpdateEquipmentRequestImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$UpdateEquipmentRequestImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _UpdateEquipmentRequest implements UpdateEquipmentRequest {
|
|
||||||
const factory _UpdateEquipmentRequest(
|
|
||||||
{@JsonKey(name: 'models_id', includeIfNull: false) final int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
|
||||||
final String? serialNumber,
|
|
||||||
@JsonKey(includeIfNull: false) final String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
final double? purchasePrice,
|
|
||||||
@JsonKey(includeIfNull: false) final String? status,
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false) final int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
final int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
final DateTime? nextInspectionDate,
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
final String? remark}) = _$UpdateEquipmentRequestImpl;
|
|
||||||
|
|
||||||
factory _UpdateEquipmentRequest.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$UpdateEquipmentRequestImpl.fromJson;
|
|
||||||
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'models_id', includeIfNull: false)
|
|
||||||
int? get modelsId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'serial_number', includeIfNull: false)
|
|
||||||
String? get serialNumber;
|
|
||||||
@override
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
String? get barcode;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get purchaseDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_price', includeIfNull: false)
|
|
||||||
@DecimalConverter()
|
|
||||||
double? get purchasePrice;
|
|
||||||
@override
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
String? get status;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_id', includeIfNull: false)
|
|
||||||
int? get companyId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_location_id', includeIfNull: false)
|
|
||||||
int? get warehouseLocationId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'last_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get lastInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'next_inspection_date', includeIfNull: false)
|
|
||||||
@NaiveDateConverter()
|
|
||||||
DateTime? get nextInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(includeIfNull: false)
|
|
||||||
String? get remark;
|
|
||||||
|
|
||||||
/// Create a copy of UpdateEquipmentRequest
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$UpdateEquipmentRequestImplCopyWith<_$UpdateEquipmentRequestImpl>
|
|
||||||
get copyWith => throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'equipment_request.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$CreateEquipmentRequestImpl _$$CreateEquipmentRequestImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$CreateEquipmentRequestImpl(
|
|
||||||
equipmentNumber: json['equipment_number'] as String,
|
|
||||||
modelsId: (json['models_id'] as num?)?.toInt(),
|
|
||||||
serialNumber: json['serial_number'] as String?,
|
|
||||||
barcode: json['barcode'] as String?,
|
|
||||||
purchaseDate:
|
|
||||||
const NaiveDateConverter().fromJson(json['purchase_date'] as String?),
|
|
||||||
purchasePrice: const DecimalConverter().fromJson(json['purchase_price']),
|
|
||||||
companyId: (json['company_id'] as num?)?.toInt(),
|
|
||||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
|
||||||
lastInspectionDate: const NaiveDateConverter()
|
|
||||||
.fromJson(json['last_inspection_date'] as String?),
|
|
||||||
nextInspectionDate: const NaiveDateConverter()
|
|
||||||
.fromJson(json['next_inspection_date'] as String?),
|
|
||||||
remark: json['remark'] as String?,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$CreateEquipmentRequestImplToJson(
|
|
||||||
_$CreateEquipmentRequestImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'equipment_number': instance.equipmentNumber,
|
|
||||||
'models_id': instance.modelsId,
|
|
||||||
'serial_number': instance.serialNumber,
|
|
||||||
'barcode': instance.barcode,
|
|
||||||
'purchase_date': const NaiveDateConverter().toJson(instance.purchaseDate),
|
|
||||||
'purchase_price': const DecimalConverter().toJson(instance.purchasePrice),
|
|
||||||
'company_id': instance.companyId,
|
|
||||||
'warehouse_location_id': instance.warehouseLocationId,
|
|
||||||
'last_inspection_date':
|
|
||||||
const NaiveDateConverter().toJson(instance.lastInspectionDate),
|
|
||||||
'next_inspection_date':
|
|
||||||
const NaiveDateConverter().toJson(instance.nextInspectionDate),
|
|
||||||
'remark': instance.remark,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$UpdateEquipmentRequestImpl _$$UpdateEquipmentRequestImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$UpdateEquipmentRequestImpl(
|
|
||||||
modelsId: (json['models_id'] as num?)?.toInt(),
|
|
||||||
serialNumber: json['serial_number'] as String?,
|
|
||||||
barcode: json['barcode'] as String?,
|
|
||||||
purchaseDate:
|
|
||||||
const NaiveDateConverter().fromJson(json['purchase_date'] as String?),
|
|
||||||
purchasePrice: const DecimalConverter().fromJson(json['purchase_price']),
|
|
||||||
status: json['status'] as String?,
|
|
||||||
companyId: (json['company_id'] as num?)?.toInt(),
|
|
||||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
|
||||||
lastInspectionDate: const NaiveDateConverter()
|
|
||||||
.fromJson(json['last_inspection_date'] as String?),
|
|
||||||
nextInspectionDate: const NaiveDateConverter()
|
|
||||||
.fromJson(json['next_inspection_date'] as String?),
|
|
||||||
remark: json['remark'] as String?,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$UpdateEquipmentRequestImplToJson(
|
|
||||||
_$UpdateEquipmentRequestImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
if (instance.modelsId case final value?) 'models_id': value,
|
|
||||||
if (instance.serialNumber case final value?) 'serial_number': value,
|
|
||||||
if (instance.barcode case final value?) 'barcode': value,
|
|
||||||
if (const NaiveDateConverter().toJson(instance.purchaseDate)
|
|
||||||
case final value?)
|
|
||||||
'purchase_date': value,
|
|
||||||
if (const DecimalConverter().toJson(instance.purchasePrice)
|
|
||||||
case final value?)
|
|
||||||
'purchase_price': value,
|
|
||||||
if (instance.status case final value?) 'status': value,
|
|
||||||
if (instance.companyId case final value?) 'company_id': value,
|
|
||||||
if (instance.warehouseLocationId case final value?)
|
|
||||||
'warehouse_location_id': value,
|
|
||||||
if (const NaiveDateConverter().toJson(instance.lastInspectionDate)
|
|
||||||
case final value?)
|
|
||||||
'last_inspection_date': value,
|
|
||||||
if (const NaiveDateConverter().toJson(instance.nextInspectionDate)
|
|
||||||
case final value?)
|
|
||||||
'next_inspection_date': value,
|
|
||||||
if (instance.remark case final value?) 'remark': value,
|
|
||||||
};
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
import 'package:superport/core/utils/equipment_status_converter.dart';
|
|
||||||
import 'package:superport/data/models/model_dto.dart';
|
|
||||||
|
|
||||||
part 'equipment_response.freezed.dart';
|
|
||||||
part 'equipment_response.g.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentResponse with _$EquipmentResponse {
|
|
||||||
const factory EquipmentResponse({
|
|
||||||
required int id,
|
|
||||||
@JsonKey(name: 'equipment_number') required String equipmentNumber,
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
|
|
||||||
@JsonKey(name: 'models_id') int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
||||||
String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') String? purchasePrice,
|
|
||||||
@EquipmentStatusJsonConverter() required String status,
|
|
||||||
@JsonKey(name: 'company_id') int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
|
||||||
String? remark,
|
|
||||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
|
||||||
@JsonKey(name: 'updated_at') required DateTime updatedAt,
|
|
||||||
// 추가 필드 (조인된 데이터)
|
|
||||||
@JsonKey(name: 'company_name') String? companyName,
|
|
||||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
|
||||||
// Sprint 3: Added model relationship (includes vendor info)
|
|
||||||
ModelDto? model,
|
|
||||||
}) = _EquipmentResponse;
|
|
||||||
|
|
||||||
factory EquipmentResponse.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentResponseFromJson(json);
|
|
||||||
}
|
|
||||||
@@ -1,610 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
// 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 'equipment_response.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(T value) => value;
|
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
||||||
|
|
||||||
EquipmentResponse _$EquipmentResponseFromJson(Map<String, dynamic> json) {
|
|
||||||
return _EquipmentResponse.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$EquipmentResponse {
|
|
||||||
int get id => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'equipment_number')
|
|
||||||
String get equipmentNumber =>
|
|
||||||
throw _privateConstructorUsedError; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
|
|
||||||
@JsonKey(name: 'models_id')
|
|
||||||
int? get modelsId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'serial_number')
|
|
||||||
String? get serialNumber => throw _privateConstructorUsedError;
|
|
||||||
String? get barcode => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
String? get purchasePrice => throw _privateConstructorUsedError;
|
|
||||||
@EquipmentStatusJsonConverter()
|
|
||||||
String get status => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'company_id')
|
|
||||||
int? get companyId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'warehouse_location_id')
|
|
||||||
int? get warehouseLocationId => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
DateTime? get lastInspectionDate => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
DateTime? get nextInspectionDate => throw _privateConstructorUsedError;
|
|
||||||
String? get remark => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'created_at')
|
|
||||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'updated_at')
|
|
||||||
DateTime get updatedAt =>
|
|
||||||
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
|
|
||||||
@JsonKey(name: 'company_name')
|
|
||||||
String? get companyName => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(name: 'warehouse_name')
|
|
||||||
String? get warehouseName =>
|
|
||||||
throw _privateConstructorUsedError; // Sprint 3: Added model relationship (includes vendor info)
|
|
||||||
ModelDto? get model => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Serializes this EquipmentResponse to a JSON map.
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$EquipmentResponseCopyWith<EquipmentResponse> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $EquipmentResponseCopyWith<$Res> {
|
|
||||||
factory $EquipmentResponseCopyWith(
|
|
||||||
EquipmentResponse value, $Res Function(EquipmentResponse) then) =
|
|
||||||
_$EquipmentResponseCopyWithImpl<$Res, EquipmentResponse>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{int id,
|
|
||||||
@JsonKey(name: 'equipment_number') String equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
||||||
String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') String? purchasePrice,
|
|
||||||
@EquipmentStatusJsonConverter() String status,
|
|
||||||
@JsonKey(name: 'company_id') int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
|
||||||
String? remark,
|
|
||||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
|
||||||
@JsonKey(name: 'updated_at') DateTime updatedAt,
|
|
||||||
@JsonKey(name: 'company_name') String? companyName,
|
|
||||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
|
||||||
ModelDto? model});
|
|
||||||
|
|
||||||
$ModelDtoCopyWith<$Res>? get model;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
|
|
||||||
implements $EquipmentResponseCopyWith<$Res> {
|
|
||||||
_$EquipmentResponseCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? id = null,
|
|
||||||
Object? equipmentNumber = null,
|
|
||||||
Object? modelsId = freezed,
|
|
||||||
Object? serialNumber = freezed,
|
|
||||||
Object? barcode = freezed,
|
|
||||||
Object? purchaseDate = freezed,
|
|
||||||
Object? purchasePrice = freezed,
|
|
||||||
Object? status = null,
|
|
||||||
Object? companyId = freezed,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? lastInspectionDate = freezed,
|
|
||||||
Object? nextInspectionDate = freezed,
|
|
||||||
Object? remark = freezed,
|
|
||||||
Object? createdAt = null,
|
|
||||||
Object? updatedAt = null,
|
|
||||||
Object? companyName = freezed,
|
|
||||||
Object? warehouseName = freezed,
|
|
||||||
Object? model = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
id: null == id
|
|
||||||
? _value.id
|
|
||||||
: id // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
equipmentNumber: null == equipmentNumber
|
|
||||||
? _value.equipmentNumber
|
|
||||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
modelsId: freezed == modelsId
|
|
||||||
? _value.modelsId
|
|
||||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
serialNumber: freezed == serialNumber
|
|
||||||
? _value.serialNumber
|
|
||||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
barcode: freezed == barcode
|
|
||||||
? _value.barcode
|
|
||||||
: barcode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
purchaseDate: freezed == purchaseDate
|
|
||||||
? _value.purchaseDate
|
|
||||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
purchasePrice: freezed == purchasePrice
|
|
||||||
? _value.purchasePrice
|
|
||||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
status: null == status
|
|
||||||
? _value.status
|
|
||||||
: status // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
companyId: freezed == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
lastInspectionDate: freezed == lastInspectionDate
|
|
||||||
? _value.lastInspectionDate
|
|
||||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
nextInspectionDate: freezed == nextInspectionDate
|
|
||||||
? _value.nextInspectionDate
|
|
||||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
remark: freezed == remark
|
|
||||||
? _value.remark
|
|
||||||
: remark // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
createdAt: null == createdAt
|
|
||||||
? _value.createdAt
|
|
||||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime,
|
|
||||||
updatedAt: null == updatedAt
|
|
||||||
? _value.updatedAt
|
|
||||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime,
|
|
||||||
companyName: freezed == companyName
|
|
||||||
? _value.companyName
|
|
||||||
: companyName // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
warehouseName: freezed == warehouseName
|
|
||||||
? _value.warehouseName
|
|
||||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
model: freezed == model
|
|
||||||
? _value.model
|
|
||||||
: model // ignore: cast_nullable_to_non_nullable
|
|
||||||
as ModelDto?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
$ModelDtoCopyWith<$Res>? get model {
|
|
||||||
if (_value.model == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ModelDtoCopyWith<$Res>(_value.model!, (value) {
|
|
||||||
return _then(_value.copyWith(model: value) as $Val);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$EquipmentResponseImplCopyWith<$Res>
|
|
||||||
implements $EquipmentResponseCopyWith<$Res> {
|
|
||||||
factory _$$EquipmentResponseImplCopyWith(_$EquipmentResponseImpl value,
|
|
||||||
$Res Function(_$EquipmentResponseImpl) then) =
|
|
||||||
__$$EquipmentResponseImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{int id,
|
|
||||||
@JsonKey(name: 'equipment_number') String equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
||||||
String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') String? purchasePrice,
|
|
||||||
@EquipmentStatusJsonConverter() String status,
|
|
||||||
@JsonKey(name: 'company_id') int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
|
|
||||||
String? remark,
|
|
||||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
|
||||||
@JsonKey(name: 'updated_at') DateTime updatedAt,
|
|
||||||
@JsonKey(name: 'company_name') String? companyName,
|
|
||||||
@JsonKey(name: 'warehouse_name') String? warehouseName,
|
|
||||||
ModelDto? model});
|
|
||||||
|
|
||||||
@override
|
|
||||||
$ModelDtoCopyWith<$Res>? get model;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$EquipmentResponseImplCopyWithImpl<$Res>
|
|
||||||
extends _$EquipmentResponseCopyWithImpl<$Res, _$EquipmentResponseImpl>
|
|
||||||
implements _$$EquipmentResponseImplCopyWith<$Res> {
|
|
||||||
__$$EquipmentResponseImplCopyWithImpl(_$EquipmentResponseImpl _value,
|
|
||||||
$Res Function(_$EquipmentResponseImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? id = null,
|
|
||||||
Object? equipmentNumber = null,
|
|
||||||
Object? modelsId = freezed,
|
|
||||||
Object? serialNumber = freezed,
|
|
||||||
Object? barcode = freezed,
|
|
||||||
Object? purchaseDate = freezed,
|
|
||||||
Object? purchasePrice = freezed,
|
|
||||||
Object? status = null,
|
|
||||||
Object? companyId = freezed,
|
|
||||||
Object? warehouseLocationId = freezed,
|
|
||||||
Object? lastInspectionDate = freezed,
|
|
||||||
Object? nextInspectionDate = freezed,
|
|
||||||
Object? remark = freezed,
|
|
||||||
Object? createdAt = null,
|
|
||||||
Object? updatedAt = null,
|
|
||||||
Object? companyName = freezed,
|
|
||||||
Object? warehouseName = freezed,
|
|
||||||
Object? model = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$EquipmentResponseImpl(
|
|
||||||
id: null == id
|
|
||||||
? _value.id
|
|
||||||
: id // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,
|
|
||||||
equipmentNumber: null == equipmentNumber
|
|
||||||
? _value.equipmentNumber
|
|
||||||
: equipmentNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
modelsId: freezed == modelsId
|
|
||||||
? _value.modelsId
|
|
||||||
: modelsId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
serialNumber: freezed == serialNumber
|
|
||||||
? _value.serialNumber
|
|
||||||
: serialNumber // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
barcode: freezed == barcode
|
|
||||||
? _value.barcode
|
|
||||||
: barcode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
purchaseDate: freezed == purchaseDate
|
|
||||||
? _value.purchaseDate
|
|
||||||
: purchaseDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
purchasePrice: freezed == purchasePrice
|
|
||||||
? _value.purchasePrice
|
|
||||||
: purchasePrice // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
status: null == status
|
|
||||||
? _value.status
|
|
||||||
: status // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
companyId: freezed == companyId
|
|
||||||
? _value.companyId
|
|
||||||
: companyId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
warehouseLocationId: freezed == warehouseLocationId
|
|
||||||
? _value.warehouseLocationId
|
|
||||||
: warehouseLocationId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
lastInspectionDate: freezed == lastInspectionDate
|
|
||||||
? _value.lastInspectionDate
|
|
||||||
: lastInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
nextInspectionDate: freezed == nextInspectionDate
|
|
||||||
? _value.nextInspectionDate
|
|
||||||
: nextInspectionDate // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
remark: freezed == remark
|
|
||||||
? _value.remark
|
|
||||||
: remark // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
createdAt: null == createdAt
|
|
||||||
? _value.createdAt
|
|
||||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime,
|
|
||||||
updatedAt: null == updatedAt
|
|
||||||
? _value.updatedAt
|
|
||||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime,
|
|
||||||
companyName: freezed == companyName
|
|
||||||
? _value.companyName
|
|
||||||
: companyName // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
warehouseName: freezed == warehouseName
|
|
||||||
? _value.warehouseName
|
|
||||||
: warehouseName // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
model: freezed == model
|
|
||||||
? _value.model
|
|
||||||
: model // ignore: cast_nullable_to_non_nullable
|
|
||||||
as ModelDto?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$EquipmentResponseImpl implements _EquipmentResponse {
|
|
||||||
const _$EquipmentResponseImpl(
|
|
||||||
{required this.id,
|
|
||||||
@JsonKey(name: 'equipment_number') required this.equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') this.modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') this.serialNumber,
|
|
||||||
this.barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
|
||||||
@EquipmentStatusJsonConverter() required this.status,
|
|
||||||
@JsonKey(name: 'company_id') this.companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date') this.lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date') this.nextInspectionDate,
|
|
||||||
this.remark,
|
|
||||||
@JsonKey(name: 'created_at') required this.createdAt,
|
|
||||||
@JsonKey(name: 'updated_at') required this.updatedAt,
|
|
||||||
@JsonKey(name: 'company_name') this.companyName,
|
|
||||||
@JsonKey(name: 'warehouse_name') this.warehouseName,
|
|
||||||
this.model});
|
|
||||||
|
|
||||||
factory _$EquipmentResponseImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$EquipmentResponseImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final int id;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'equipment_number')
|
|
||||||
final String equipmentNumber;
|
|
||||||
// Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'models_id')
|
|
||||||
final int? modelsId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'serial_number')
|
|
||||||
final String? serialNumber;
|
|
||||||
@override
|
|
||||||
final String? barcode;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
final DateTime? purchaseDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
final String? purchasePrice;
|
|
||||||
@override
|
|
||||||
@EquipmentStatusJsonConverter()
|
|
||||||
final String status;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_id')
|
|
||||||
final int? companyId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_location_id')
|
|
||||||
final int? warehouseLocationId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
final DateTime? lastInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
final DateTime? nextInspectionDate;
|
|
||||||
@override
|
|
||||||
final String? remark;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'created_at')
|
|
||||||
final DateTime createdAt;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'updated_at')
|
|
||||||
final DateTime updatedAt;
|
|
||||||
// 추가 필드 (조인된 데이터)
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_name')
|
|
||||||
final String? companyName;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_name')
|
|
||||||
final String? warehouseName;
|
|
||||||
// Sprint 3: Added model relationship (includes vendor info)
|
|
||||||
@override
|
|
||||||
final ModelDto? model;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, modelsId: $modelsId, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, warehouseName: $warehouseName, model: $model)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$EquipmentResponseImpl &&
|
|
||||||
(identical(other.id, id) || other.id == id) &&
|
|
||||||
(identical(other.equipmentNumber, equipmentNumber) ||
|
|
||||||
other.equipmentNumber == equipmentNumber) &&
|
|
||||||
(identical(other.modelsId, modelsId) ||
|
|
||||||
other.modelsId == modelsId) &&
|
|
||||||
(identical(other.serialNumber, serialNumber) ||
|
|
||||||
other.serialNumber == serialNumber) &&
|
|
||||||
(identical(other.barcode, barcode) || other.barcode == barcode) &&
|
|
||||||
(identical(other.purchaseDate, purchaseDate) ||
|
|
||||||
other.purchaseDate == purchaseDate) &&
|
|
||||||
(identical(other.purchasePrice, purchasePrice) ||
|
|
||||||
other.purchasePrice == purchasePrice) &&
|
|
||||||
(identical(other.status, status) || other.status == status) &&
|
|
||||||
(identical(other.companyId, companyId) ||
|
|
||||||
other.companyId == companyId) &&
|
|
||||||
(identical(other.warehouseLocationId, warehouseLocationId) ||
|
|
||||||
other.warehouseLocationId == warehouseLocationId) &&
|
|
||||||
(identical(other.lastInspectionDate, lastInspectionDate) ||
|
|
||||||
other.lastInspectionDate == lastInspectionDate) &&
|
|
||||||
(identical(other.nextInspectionDate, nextInspectionDate) ||
|
|
||||||
other.nextInspectionDate == nextInspectionDate) &&
|
|
||||||
(identical(other.remark, remark) || other.remark == remark) &&
|
|
||||||
(identical(other.createdAt, createdAt) ||
|
|
||||||
other.createdAt == createdAt) &&
|
|
||||||
(identical(other.updatedAt, updatedAt) ||
|
|
||||||
other.updatedAt == updatedAt) &&
|
|
||||||
(identical(other.companyName, companyName) ||
|
|
||||||
other.companyName == companyName) &&
|
|
||||||
(identical(other.warehouseName, warehouseName) ||
|
|
||||||
other.warehouseName == warehouseName) &&
|
|
||||||
(identical(other.model, model) || other.model == model));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType,
|
|
||||||
id,
|
|
||||||
equipmentNumber,
|
|
||||||
modelsId,
|
|
||||||
serialNumber,
|
|
||||||
barcode,
|
|
||||||
purchaseDate,
|
|
||||||
purchasePrice,
|
|
||||||
status,
|
|
||||||
companyId,
|
|
||||||
warehouseLocationId,
|
|
||||||
lastInspectionDate,
|
|
||||||
nextInspectionDate,
|
|
||||||
remark,
|
|
||||||
createdAt,
|
|
||||||
updatedAt,
|
|
||||||
companyName,
|
|
||||||
warehouseName,
|
|
||||||
model);
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$EquipmentResponseImplCopyWith<_$EquipmentResponseImpl> get copyWith =>
|
|
||||||
__$$EquipmentResponseImplCopyWithImpl<_$EquipmentResponseImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$EquipmentResponseImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _EquipmentResponse implements EquipmentResponse {
|
|
||||||
const factory _EquipmentResponse(
|
|
||||||
{required final int id,
|
|
||||||
@JsonKey(name: 'equipment_number') required final String equipmentNumber,
|
|
||||||
@JsonKey(name: 'models_id') final int? modelsId,
|
|
||||||
@JsonKey(name: 'serial_number') final String? serialNumber,
|
|
||||||
final String? barcode,
|
|
||||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
|
||||||
@JsonKey(name: 'purchase_price') final String? purchasePrice,
|
|
||||||
@EquipmentStatusJsonConverter() required final String status,
|
|
||||||
@JsonKey(name: 'company_id') final int? companyId,
|
|
||||||
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
|
|
||||||
@JsonKey(name: 'last_inspection_date') final DateTime? lastInspectionDate,
|
|
||||||
@JsonKey(name: 'next_inspection_date') final DateTime? nextInspectionDate,
|
|
||||||
final String? remark,
|
|
||||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
|
||||||
@JsonKey(name: 'updated_at') required final DateTime updatedAt,
|
|
||||||
@JsonKey(name: 'company_name') final String? companyName,
|
|
||||||
@JsonKey(name: 'warehouse_name') final String? warehouseName,
|
|
||||||
final ModelDto? model}) = _$EquipmentResponseImpl;
|
|
||||||
|
|
||||||
factory _EquipmentResponse.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$EquipmentResponseImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get id;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'equipment_number')
|
|
||||||
String
|
|
||||||
get equipmentNumber; // Sprint 3: Replaced category1/2/3, manufacturer, modelName with models_id and model
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'models_id')
|
|
||||||
int? get modelsId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'serial_number')
|
|
||||||
String? get serialNumber;
|
|
||||||
@override
|
|
||||||
String? get barcode;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_date')
|
|
||||||
DateTime? get purchaseDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'purchase_price')
|
|
||||||
String? get purchasePrice;
|
|
||||||
@override
|
|
||||||
@EquipmentStatusJsonConverter()
|
|
||||||
String get status;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_id')
|
|
||||||
int? get companyId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_location_id')
|
|
||||||
int? get warehouseLocationId;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'last_inspection_date')
|
|
||||||
DateTime? get lastInspectionDate;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'next_inspection_date')
|
|
||||||
DateTime? get nextInspectionDate;
|
|
||||||
@override
|
|
||||||
String? get remark;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'created_at')
|
|
||||||
DateTime get createdAt;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'updated_at')
|
|
||||||
DateTime get updatedAt; // 추가 필드 (조인된 데이터)
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'company_name')
|
|
||||||
String? get companyName;
|
|
||||||
@override
|
|
||||||
@JsonKey(name: 'warehouse_name')
|
|
||||||
String?
|
|
||||||
get warehouseName; // Sprint 3: Added model relationship (includes vendor info)
|
|
||||||
@override
|
|
||||||
ModelDto? get model;
|
|
||||||
|
|
||||||
/// Create a copy of EquipmentResponse
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$EquipmentResponseImplCopyWith<_$EquipmentResponseImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'equipment_response.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$EquipmentResponseImpl _$$EquipmentResponseImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentResponseImpl(
|
|
||||||
id: (json['id'] as num).toInt(),
|
|
||||||
equipmentNumber: json['equipment_number'] as String,
|
|
||||||
modelsId: (json['models_id'] as num?)?.toInt(),
|
|
||||||
serialNumber: json['serial_number'] as String?,
|
|
||||||
barcode: json['barcode'] as String?,
|
|
||||||
purchaseDate: json['purchase_date'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['purchase_date'] as String),
|
|
||||||
purchasePrice: json['purchase_price'] as String?,
|
|
||||||
status: const EquipmentStatusJsonConverter()
|
|
||||||
.fromJson(json['status'] as String),
|
|
||||||
companyId: (json['company_id'] as num?)?.toInt(),
|
|
||||||
warehouseLocationId: (json['warehouse_location_id'] as num?)?.toInt(),
|
|
||||||
lastInspectionDate: json['last_inspection_date'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['last_inspection_date'] as String),
|
|
||||||
nextInspectionDate: json['next_inspection_date'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['next_inspection_date'] as String),
|
|
||||||
remark: json['remark'] as String?,
|
|
||||||
createdAt: DateTime.parse(json['created_at'] as String),
|
|
||||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
|
||||||
companyName: json['company_name'] as String?,
|
|
||||||
warehouseName: json['warehouse_name'] as String?,
|
|
||||||
model: json['model'] == null
|
|
||||||
? null
|
|
||||||
: ModelDto.fromJson(json['model'] as Map<String, dynamic>),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentResponseImplToJson(
|
|
||||||
_$EquipmentResponseImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'id': instance.id,
|
|
||||||
'equipment_number': instance.equipmentNumber,
|
|
||||||
'models_id': instance.modelsId,
|
|
||||||
'serial_number': instance.serialNumber,
|
|
||||||
'barcode': instance.barcode,
|
|
||||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
|
||||||
'purchase_price': instance.purchasePrice,
|
|
||||||
'status': const EquipmentStatusJsonConverter().toJson(instance.status),
|
|
||||||
'company_id': instance.companyId,
|
|
||||||
'warehouse_location_id': instance.warehouseLocationId,
|
|
||||||
'last_inspection_date': instance.lastInspectionDate?.toIso8601String(),
|
|
||||||
'next_inspection_date': instance.nextInspectionDate?.toIso8601String(),
|
|
||||||
'remark': instance.remark,
|
|
||||||
'created_at': instance.createdAt.toIso8601String(),
|
|
||||||
'updated_at': instance.updatedAt.toIso8601String(),
|
|
||||||
'company_name': instance.companyName,
|
|
||||||
'warehouse_name': instance.warehouseName,
|
|
||||||
'model': instance.model,
|
|
||||||
};
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
import 'package:superport/data/models/equipment_history_dto.dart';
|
|
||||||
import 'package:superport/data/models/company/company_dto.dart';
|
|
||||||
|
|
||||||
part 'equipment_history_companies_link_dto.freezed.dart';
|
|
||||||
part 'equipment_history_companies_link_dto.g.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentHistoryCompaniesLinkDto with _$EquipmentHistoryCompaniesLinkDto {
|
|
||||||
const EquipmentHistoryCompaniesLinkDto._(); // Private constructor for getters
|
|
||||||
|
|
||||||
const factory EquipmentHistoryCompaniesLinkDto({
|
|
||||||
@JsonKey(name: 'Id') int? id,
|
|
||||||
@JsonKey(name: 'companies_id') required int companiesId,
|
|
||||||
@JsonKey(name: 'equipment_history_Id') required int equipmentHistoryId,
|
|
||||||
@JsonKey(name: 'Order') @Default(1) int order,
|
|
||||||
@JsonKey(name: 'is_deleted') @Default(false) bool isDeleted,
|
|
||||||
@JsonKey(name: 'registered_at') required DateTime registeredAt,
|
|
||||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
|
||||||
|
|
||||||
// Related entities (optional, populated in GET requests)
|
|
||||||
CompanyDto? company,
|
|
||||||
EquipmentHistoryDto? equipmentHistory,
|
|
||||||
}) = _EquipmentHistoryCompaniesLinkDto;
|
|
||||||
|
|
||||||
// isActive 계산 속성 (is_deleted의 반대)
|
|
||||||
bool get isActive => !isDeleted;
|
|
||||||
|
|
||||||
factory EquipmentHistoryCompaniesLinkDto.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkDtoFromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentHistoryCompaniesLinkRequestDto with _$EquipmentHistoryCompaniesLinkRequestDto {
|
|
||||||
const factory EquipmentHistoryCompaniesLinkRequestDto({
|
|
||||||
@JsonKey(name: 'companies_id') required int companiesId,
|
|
||||||
@JsonKey(name: 'equipment_history_Id') required int equipmentHistoryId,
|
|
||||||
@JsonKey(name: 'Order') @Default(1) int order,
|
|
||||||
}) = _EquipmentHistoryCompaniesLinkRequestDto;
|
|
||||||
|
|
||||||
factory EquipmentHistoryCompaniesLinkRequestDto.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkRequestDtoFromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentHistoryCompaniesLinkUpdateRequestDto with _$EquipmentHistoryCompaniesLinkUpdateRequestDto {
|
|
||||||
const factory EquipmentHistoryCompaniesLinkUpdateRequestDto({
|
|
||||||
@JsonKey(name: 'companies_id') int? companiesId,
|
|
||||||
@JsonKey(name: 'equipment_history_Id') int? equipmentHistoryId,
|
|
||||||
@JsonKey(name: 'Order') int? order,
|
|
||||||
}) = _EquipmentHistoryCompaniesLinkUpdateRequestDto;
|
|
||||||
|
|
||||||
factory EquipmentHistoryCompaniesLinkUpdateRequestDto.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkUpdateRequestDtoFromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class EquipmentHistoryCompaniesLinkListResponse with _$EquipmentHistoryCompaniesLinkListResponse {
|
|
||||||
const factory EquipmentHistoryCompaniesLinkListResponse({
|
|
||||||
@JsonKey(name: 'data') required List<EquipmentHistoryCompaniesLinkDto> items,
|
|
||||||
@JsonKey(name: 'total') required int totalCount,
|
|
||||||
@JsonKey(name: 'page') required int currentPage,
|
|
||||||
@JsonKey(name: 'total_pages') required int totalPages,
|
|
||||||
@JsonKey(name: 'page_size') int? pageSize,
|
|
||||||
}) = _EquipmentHistoryCompaniesLinkListResponse;
|
|
||||||
|
|
||||||
factory EquipmentHistoryCompaniesLinkListResponse.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkListResponseFromJson(json);
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,101 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'equipment_history_companies_link_dto.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$EquipmentHistoryCompaniesLinkDtoImpl
|
|
||||||
_$$EquipmentHistoryCompaniesLinkDtoImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkDtoImpl(
|
|
||||||
id: (json['Id'] as num?)?.toInt(),
|
|
||||||
companiesId: (json['companies_id'] as num).toInt(),
|
|
||||||
equipmentHistoryId: (json['equipment_history_Id'] as num).toInt(),
|
|
||||||
order: (json['Order'] as num?)?.toInt() ?? 1,
|
|
||||||
isDeleted: json['is_deleted'] as bool? ?? false,
|
|
||||||
registeredAt: DateTime.parse(json['registered_at'] as String),
|
|
||||||
updatedAt: json['updated_at'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['updated_at'] as String),
|
|
||||||
company: json['company'] == null
|
|
||||||
? null
|
|
||||||
: CompanyDto.fromJson(json['company'] as Map<String, dynamic>),
|
|
||||||
equipmentHistory: json['equipmentHistory'] == null
|
|
||||||
? null
|
|
||||||
: EquipmentHistoryDto.fromJson(
|
|
||||||
json['equipmentHistory'] as Map<String, dynamic>),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentHistoryCompaniesLinkDtoImplToJson(
|
|
||||||
_$EquipmentHistoryCompaniesLinkDtoImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'Id': instance.id,
|
|
||||||
'companies_id': instance.companiesId,
|
|
||||||
'equipment_history_Id': instance.equipmentHistoryId,
|
|
||||||
'Order': instance.order,
|
|
||||||
'is_deleted': instance.isDeleted,
|
|
||||||
'registered_at': instance.registeredAt.toIso8601String(),
|
|
||||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
|
||||||
'company': instance.company,
|
|
||||||
'equipmentHistory': instance.equipmentHistory,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$EquipmentHistoryCompaniesLinkRequestDtoImpl
|
|
||||||
_$$EquipmentHistoryCompaniesLinkRequestDtoImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkRequestDtoImpl(
|
|
||||||
companiesId: (json['companies_id'] as num).toInt(),
|
|
||||||
equipmentHistoryId: (json['equipment_history_Id'] as num).toInt(),
|
|
||||||
order: (json['Order'] as num?)?.toInt() ?? 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentHistoryCompaniesLinkRequestDtoImplToJson(
|
|
||||||
_$EquipmentHistoryCompaniesLinkRequestDtoImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'companies_id': instance.companiesId,
|
|
||||||
'equipment_history_Id': instance.equipmentHistoryId,
|
|
||||||
'Order': instance.order,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl
|
|
||||||
_$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl(
|
|
||||||
companiesId: (json['companies_id'] as num?)?.toInt(),
|
|
||||||
equipmentHistoryId: (json['equipment_history_Id'] as num?)?.toInt(),
|
|
||||||
order: (json['Order'] as num?)?.toInt(),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentHistoryCompaniesLinkUpdateRequestDtoImplToJson(
|
|
||||||
_$EquipmentHistoryCompaniesLinkUpdateRequestDtoImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'companies_id': instance.companiesId,
|
|
||||||
'equipment_history_Id': instance.equipmentHistoryId,
|
|
||||||
'Order': instance.order,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$EquipmentHistoryCompaniesLinkListResponseImpl
|
|
||||||
_$$EquipmentHistoryCompaniesLinkListResponseImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$EquipmentHistoryCompaniesLinkListResponseImpl(
|
|
||||||
items: (json['data'] as List<dynamic>)
|
|
||||||
.map((e) => EquipmentHistoryCompaniesLinkDto.fromJson(
|
|
||||||
e as Map<String, dynamic>))
|
|
||||||
.toList(),
|
|
||||||
totalCount: (json['total'] as num).toInt(),
|
|
||||||
currentPage: (json['page'] as num).toInt(),
|
|
||||||
totalPages: (json['total_pages'] as num).toInt(),
|
|
||||||
pageSize: (json['page_size'] as num?)?.toInt(),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$EquipmentHistoryCompaniesLinkListResponseImplToJson(
|
|
||||||
_$EquipmentHistoryCompaniesLinkListResponseImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'data': instance.items,
|
|
||||||
'total': instance.totalCount,
|
|
||||||
'page': instance.currentPage,
|
|
||||||
'total_pages': instance.totalPages,
|
|
||||||
'page_size': instance.pageSize,
|
|
||||||
};
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
/// Auth 도메인 UseCase 모음
|
|
||||||
library;
|
|
||||||
export 'login_usecase.dart';
|
|
||||||
export 'logout_usecase.dart';
|
|
||||||
export 'refresh_token_usecase.dart';
|
|
||||||
export 'get_current_user_usecase.dart';
|
|
||||||
export 'check_auth_status_usecase.dart';
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
/// Company 도메인 UseCase 모음
|
|
||||||
library;
|
|
||||||
export 'get_companies_usecase.dart';
|
|
||||||
export 'create_company_usecase.dart';
|
|
||||||
export 'update_company_usecase.dart';
|
|
||||||
export 'delete_company_usecase.dart';
|
|
||||||
export 'get_company_detail_usecase.dart';
|
|
||||||
export 'toggle_company_status_usecase.dart';
|
|
||||||
|
|
||||||
// 계층 구조 관련 UseCase
|
|
||||||
export 'get_company_hierarchy_usecase.dart';
|
|
||||||
export 'update_parent_company_usecase.dart';
|
|
||||||
export 'validate_company_deletion_usecase.dart';
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
/// Equipment 도메인 UseCase 모음
|
|
||||||
library;
|
|
||||||
export 'get_equipments_usecase.dart';
|
|
||||||
export 'get_equipment_detail_usecase.dart';
|
|
||||||
export 'create_equipment_usecase.dart';
|
|
||||||
export 'update_equipment_usecase.dart';
|
|
||||||
export 'delete_equipment_usecase.dart';
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/// User 도메인 UseCase 모음
|
|
||||||
library;
|
|
||||||
export 'get_users_usecase.dart';
|
|
||||||
export 'create_user_usecase.dart';
|
|
||||||
export 'update_user_usecase.dart';
|
|
||||||
export 'delete_user_usecase.dart';
|
|
||||||
export 'get_user_detail_usecase.dart';
|
|
||||||
export 'reset_password_usecase.dart';
|
|
||||||
export 'toggle_user_status_usecase.dart';
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
// WarehouseLocation UseCase barrel file
|
|
||||||
export 'get_warehouse_locations_usecase.dart';
|
|
||||||
export 'get_warehouse_location_detail_usecase.dart';
|
|
||||||
export 'create_warehouse_location_usecase.dart';
|
|
||||||
export 'update_warehouse_location_usecase.dart';
|
|
||||||
export 'delete_warehouse_location_usecase.dart';
|
|
||||||
@@ -1,6 +1 @@
|
|||||||
export 'custom_widgets/form_field_wrapper.dart';
|
export 'custom_widgets/form_field_wrapper.dart';
|
||||||
export 'custom_widgets/date_picker_field.dart';
|
|
||||||
export 'custom_widgets/highlight_text.dart';
|
|
||||||
export 'custom_widgets/autocomplete_dropdown.dart';
|
|
||||||
export 'custom_widgets/category_selection_field.dart';
|
|
||||||
export 'custom_widgets/category_data.dart';
|
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'highlight_text.dart';
|
|
||||||
|
|
||||||
// 자동완성 드롭다운 공통 위젯
|
|
||||||
class AutocompleteDropdown extends StatelessWidget {
|
|
||||||
// 드롭다운에 표시할 항목 리스트
|
|
||||||
final List<String> items;
|
|
||||||
// 현재 입력된 텍스트(하이라이트 기준)
|
|
||||||
final String inputText;
|
|
||||||
// 항목 선택 시 콜백
|
|
||||||
final void Function(String) onSelect;
|
|
||||||
// 드롭다운 표시 여부
|
|
||||||
final bool showDropdown;
|
|
||||||
// 최대 높이(항목 개수에 따라 자동 조절)
|
|
||||||
final double maxHeight;
|
|
||||||
// 드롭다운이 비었을 때 표시할 위젯
|
|
||||||
final Widget emptyWidget;
|
|
||||||
|
|
||||||
const AutocompleteDropdown({
|
|
||||||
super.key,
|
|
||||||
required this.items,
|
|
||||||
required this.inputText,
|
|
||||||
required this.onSelect,
|
|
||||||
required this.showDropdown,
|
|
||||||
this.maxHeight = 200,
|
|
||||||
this.emptyWidget = const Padding(
|
|
||||||
padding: EdgeInsets.all(12.0),
|
|
||||||
child: Text('검색 결과가 없습니다'),
|
|
||||||
),
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AnimatedContainer(
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
height:
|
|
||||||
showDropdown
|
|
||||||
? (items.length > 4 ? maxHeight : items.length * 50.0)
|
|
||||||
: 0,
|
|
||||||
margin: EdgeInsets.only(top: showDropdown ? 4 : 0),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
physics: const ClampingScrollPhysics(),
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {}, // 이벤트 버블링 방지
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
border: Border.all(color: Colors.grey.shade300),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.grey.withAlpha(77),
|
|
||||||
spreadRadius: 1,
|
|
||||||
blurRadius: 3,
|
|
||||||
offset: const Offset(0, 1),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child:
|
|
||||||
items.isEmpty
|
|
||||||
? emptyWidget
|
|
||||||
: ListView.separated(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
itemCount: items.length,
|
|
||||||
separatorBuilder:
|
|
||||||
(context, index) =>
|
|
||||||
Divider(height: 1, color: Colors.grey.shade200),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final String item = items[index];
|
|
||||||
return ListTile(
|
|
||||||
dense: true,
|
|
||||||
title: HighlightText(
|
|
||||||
text: item,
|
|
||||||
highlight: inputText,
|
|
||||||
highlightColor: Theme.of(context).primaryColor,
|
|
||||||
),
|
|
||||||
onTap: () => onSelect(item),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
// 카테고리 데이터 (예시)
|
|
||||||
final Map<String, Map<String, List<String>>> categoryData = {
|
|
||||||
'컴퓨터': {
|
|
||||||
'데스크탑': ['사무용', '게이밍', '워크스테이션'],
|
|
||||||
'노트북': ['사무용', '게이밍', '울트라북'],
|
|
||||||
'태블릿': ['안드로이드', 'iOS', '윈도우'],
|
|
||||||
},
|
|
||||||
'네트워크': {
|
|
||||||
'라우터': ['가정용', '기업용', '산업용'],
|
|
||||||
'스위치': ['관리형', '비관리형'],
|
|
||||||
'액세스 포인트': ['실내용', '실외용'],
|
|
||||||
},
|
|
||||||
'주변기기': {
|
|
||||||
'모니터': ['LCD', 'LED', 'OLED'],
|
|
||||||
'키보드': ['유선', '무선', '기계식'],
|
|
||||||
'마우스': ['유선', '무선', '트랙볼'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,562 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'autocomplete_dropdown.dart';
|
|
||||||
import 'form_field_wrapper.dart';
|
|
||||||
import 'category_data.dart';
|
|
||||||
|
|
||||||
// 카테고리 선택 필드 (대분류/중분류/소분류)
|
|
||||||
class CategorySelectionField extends StatefulWidget {
|
|
||||||
final String category;
|
|
||||||
final String subCategory;
|
|
||||||
final String subSubCategory;
|
|
||||||
final Function(String, String, String) onCategoryChanged;
|
|
||||||
final bool isRequired;
|
|
||||||
|
|
||||||
const CategorySelectionField({
|
|
||||||
super.key,
|
|
||||||
required this.category,
|
|
||||||
required this.subCategory,
|
|
||||||
required this.subSubCategory,
|
|
||||||
required this.onCategoryChanged,
|
|
||||||
this.isRequired = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<CategorySelectionField> createState() => _CategorySelectionFieldState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CategorySelectionFieldState extends State<CategorySelectionField> {
|
|
||||||
// 검색 관련 컨트롤러 및 상태 변수
|
|
||||||
final TextEditingController _categoryController = TextEditingController();
|
|
||||||
final FocusNode _categoryFocusNode = FocusNode();
|
|
||||||
bool _showCategoryDropdown = false;
|
|
||||||
List<String> _filteredCategories = [];
|
|
||||||
|
|
||||||
// 중분류 관련 변수
|
|
||||||
final TextEditingController _subCategoryController = TextEditingController();
|
|
||||||
final FocusNode _subCategoryFocusNode = FocusNode();
|
|
||||||
bool _showSubCategoryDropdown = false;
|
|
||||||
List<String> _filteredSubCategories = [];
|
|
||||||
|
|
||||||
// 소분류 관련 변수
|
|
||||||
final TextEditingController _subSubCategoryController =
|
|
||||||
TextEditingController();
|
|
||||||
final FocusNode _subSubCategoryFocusNode = FocusNode();
|
|
||||||
bool _showSubSubCategoryDropdown = false;
|
|
||||||
List<String> _filteredSubSubCategories = [];
|
|
||||||
|
|
||||||
List<String> _allCategories = [];
|
|
||||||
String _selectedCategory = '';
|
|
||||||
String _selectedSubCategory = '';
|
|
||||||
String _selectedSubSubCategory = '';
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_selectedCategory = widget.category;
|
|
||||||
_selectedSubCategory = widget.subCategory;
|
|
||||||
_selectedSubSubCategory = widget.subSubCategory;
|
|
||||||
_categoryController.text = _selectedCategory;
|
|
||||||
_subCategoryController.text = _selectedSubCategory;
|
|
||||||
_subSubCategoryController.text = _selectedSubSubCategory;
|
|
||||||
|
|
||||||
// 모든 카테고리 목록 초기화
|
|
||||||
_allCategories = categoryData.keys.toList();
|
|
||||||
_filteredCategories = List.from(_allCategories);
|
|
||||||
|
|
||||||
// 중분류 목록 초기화
|
|
||||||
_updateSubCategories();
|
|
||||||
|
|
||||||
// 소분류 목록 초기화
|
|
||||||
_updateSubSubCategories();
|
|
||||||
|
|
||||||
// 대분류 컨트롤러 리스너 설정
|
|
||||||
_categoryController.addListener(_onCategoryTextChanged);
|
|
||||||
_categoryFocusNode.addListener(() {
|
|
||||||
setState(() {
|
|
||||||
if (_categoryFocusNode.hasFocus) {
|
|
||||||
_showCategoryDropdown = _filteredCategories.isNotEmpty;
|
|
||||||
} else {
|
|
||||||
_showCategoryDropdown = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 중분류 컨트롤러 리스너 설정
|
|
||||||
_subCategoryController.addListener(_onSubCategoryTextChanged);
|
|
||||||
_subCategoryFocusNode.addListener(() {
|
|
||||||
setState(() {
|
|
||||||
if (_subCategoryFocusNode.hasFocus) {
|
|
||||||
_showSubCategoryDropdown = _filteredSubCategories.isNotEmpty;
|
|
||||||
} else {
|
|
||||||
_showSubCategoryDropdown = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 소분류 컨트롤러 리스너 설정
|
|
||||||
_subSubCategoryController.addListener(_onSubSubCategoryTextChanged);
|
|
||||||
_subSubCategoryFocusNode.addListener(() {
|
|
||||||
setState(() {
|
|
||||||
if (_subSubCategoryFocusNode.hasFocus) {
|
|
||||||
_showSubSubCategoryDropdown = _filteredSubSubCategories.isNotEmpty;
|
|
||||||
} else {
|
|
||||||
_showSubSubCategoryDropdown = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_categoryController.dispose();
|
|
||||||
_categoryFocusNode.dispose();
|
|
||||||
_subCategoryController.dispose();
|
|
||||||
_subCategoryFocusNode.dispose();
|
|
||||||
_subSubCategoryController.dispose();
|
|
||||||
_subSubCategoryFocusNode.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 중분류 목록 업데이트
|
|
||||||
void _updateSubCategories() {
|
|
||||||
if (_selectedCategory.isNotEmpty) {
|
|
||||||
final subCategories =
|
|
||||||
categoryData[_selectedCategory]?.keys.toList() ?? [];
|
|
||||||
_filteredSubCategories = List.from(subCategories);
|
|
||||||
} else {
|
|
||||||
_filteredSubCategories = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 소분류 목록 업데이트
|
|
||||||
void _updateSubSubCategories() {
|
|
||||||
if (_selectedCategory.isNotEmpty && _selectedSubCategory.isNotEmpty) {
|
|
||||||
final subSubCategories =
|
|
||||||
categoryData[_selectedCategory]?[_selectedSubCategory] ?? [];
|
|
||||||
_filteredSubSubCategories = List.from(subSubCategories);
|
|
||||||
} else {
|
|
||||||
_filteredSubSubCategories = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onCategoryTextChanged() {
|
|
||||||
final text = _categoryController.text;
|
|
||||||
setState(() {
|
|
||||||
_selectedCategory = text;
|
|
||||||
|
|
||||||
if (text.isEmpty) {
|
|
||||||
_filteredCategories = List.from(_allCategories);
|
|
||||||
} else {
|
|
||||||
_filteredCategories =
|
|
||||||
_allCategories
|
|
||||||
.where(
|
|
||||||
(item) => item.toLowerCase().contains(text.toLowerCase()),
|
|
||||||
)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
// 시작 부분이 일치하는 항목 우선 정렬
|
|
||||||
_filteredCategories.sort((a, b) {
|
|
||||||
bool aStartsWith = a.toLowerCase().startsWith(text.toLowerCase());
|
|
||||||
bool bStartsWith = b.toLowerCase().startsWith(text.toLowerCase());
|
|
||||||
|
|
||||||
if (aStartsWith && !bStartsWith) return -1;
|
|
||||||
if (!aStartsWith && bStartsWith) return 1;
|
|
||||||
return a.compareTo(b);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
_showCategoryDropdown =
|
|
||||||
_filteredCategories.isNotEmpty && _categoryFocusNode.hasFocus;
|
|
||||||
|
|
||||||
// 카테고리가 변경되면 하위 카테고리 초기화
|
|
||||||
if (_selectedCategory != widget.category) {
|
|
||||||
_selectedSubCategory = '';
|
|
||||||
_subCategoryController.text = '';
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_subSubCategoryController.text = '';
|
|
||||||
_updateSubCategories();
|
|
||||||
_updateSubSubCategories();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 콜백 호출
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
_selectedSubSubCategory,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 중분류 텍스트 변경 핸들러
|
|
||||||
void _onSubCategoryTextChanged() {
|
|
||||||
final text = _subCategoryController.text;
|
|
||||||
setState(() {
|
|
||||||
_selectedSubCategory = text;
|
|
||||||
|
|
||||||
if (_selectedCategory.isNotEmpty) {
|
|
||||||
final subCategories =
|
|
||||||
categoryData[_selectedCategory]?.keys.toList() ?? [];
|
|
||||||
|
|
||||||
if (text.isEmpty) {
|
|
||||||
_filteredSubCategories = List.from(subCategories);
|
|
||||||
} else {
|
|
||||||
_filteredSubCategories =
|
|
||||||
subCategories
|
|
||||||
.where(
|
|
||||||
(item) => item.toLowerCase().contains(text.toLowerCase()),
|
|
||||||
)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
// 시작 부분이 일치하는 항목 우선 정렬
|
|
||||||
_filteredSubCategories.sort((a, b) {
|
|
||||||
bool aStartsWith = a.toLowerCase().startsWith(text.toLowerCase());
|
|
||||||
bool bStartsWith = b.toLowerCase().startsWith(text.toLowerCase());
|
|
||||||
|
|
||||||
if (aStartsWith && !bStartsWith) return -1;
|
|
||||||
if (!aStartsWith && bStartsWith) return 1;
|
|
||||||
return a.compareTo(b);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_filteredSubCategories = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
_showSubCategoryDropdown =
|
|
||||||
_filteredSubCategories.isNotEmpty && _subCategoryFocusNode.hasFocus;
|
|
||||||
|
|
||||||
// 중분류가 변경되면 소분류 초기화
|
|
||||||
if (_selectedSubCategory != widget.subCategory) {
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_subSubCategoryController.text = '';
|
|
||||||
_updateSubSubCategories();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 콜백 호출
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
_selectedSubSubCategory,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 소분류 텍스트 변경 핸들러
|
|
||||||
void _onSubSubCategoryTextChanged() {
|
|
||||||
final text = _subSubCategoryController.text;
|
|
||||||
setState(() {
|
|
||||||
_selectedSubSubCategory = text;
|
|
||||||
|
|
||||||
if (_selectedCategory.isNotEmpty && _selectedSubCategory.isNotEmpty) {
|
|
||||||
final subSubCategories =
|
|
||||||
categoryData[_selectedCategory]?[_selectedSubCategory] ?? [];
|
|
||||||
|
|
||||||
if (text.isEmpty) {
|
|
||||||
_filteredSubSubCategories = List.from(subSubCategories);
|
|
||||||
} else {
|
|
||||||
_filteredSubSubCategories =
|
|
||||||
subSubCategories
|
|
||||||
.where(
|
|
||||||
(item) => item.toLowerCase().contains(text.toLowerCase()),
|
|
||||||
)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
// 시작 부분이 일치하는 항목 우선 정렬
|
|
||||||
_filteredSubSubCategories.sort((a, b) {
|
|
||||||
bool aStartsWith = a.toLowerCase().startsWith(text.toLowerCase());
|
|
||||||
bool bStartsWith = b.toLowerCase().startsWith(text.toLowerCase());
|
|
||||||
|
|
||||||
if (aStartsWith && !bStartsWith) return -1;
|
|
||||||
if (!aStartsWith && bStartsWith) return 1;
|
|
||||||
return a.compareTo(b);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_filteredSubSubCategories = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
_showSubSubCategoryDropdown =
|
|
||||||
_filteredSubSubCategories.isNotEmpty &&
|
|
||||||
_subSubCategoryFocusNode.hasFocus;
|
|
||||||
|
|
||||||
// 콜백 호출
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
_selectedSubSubCategory,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _selectCategory(String category) {
|
|
||||||
setState(() {
|
|
||||||
_selectedCategory = category;
|
|
||||||
_categoryController.text = category;
|
|
||||||
_showCategoryDropdown = false;
|
|
||||||
_selectedSubCategory = '';
|
|
||||||
_subCategoryController.text = '';
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_subSubCategoryController.text = '';
|
|
||||||
_updateSubCategories();
|
|
||||||
_updateSubSubCategories();
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
_selectedSubSubCategory,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 중분류 선택 핸들러
|
|
||||||
void _selectSubCategory(String subCategory) {
|
|
||||||
setState(() {
|
|
||||||
_selectedSubCategory = subCategory;
|
|
||||||
_subCategoryController.text = subCategory;
|
|
||||||
_showSubCategoryDropdown = false;
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_subSubCategoryController.text = '';
|
|
||||||
_updateSubSubCategories();
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
_selectedSubSubCategory,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 소분류 선택 핸들러
|
|
||||||
void _selectSubSubCategory(String subSubCategory) {
|
|
||||||
setState(() {
|
|
||||||
_selectedSubSubCategory = subSubCategory;
|
|
||||||
_subSubCategoryController.text = subSubCategory;
|
|
||||||
_showSubSubCategoryDropdown = false;
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
_selectedSubSubCategory,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return FormFieldWrapper(
|
|
||||||
label: '카테고리',
|
|
||||||
isRequired: widget.isRequired,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
// 대분류 입력 필드 (자동완성)
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
TextFormField(
|
|
||||||
controller: _categoryController,
|
|
||||||
focusNode: _categoryFocusNode,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: '대분류',
|
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12,
|
|
||||||
vertical: 12,
|
|
||||||
),
|
|
||||||
suffixIcon:
|
|
||||||
_categoryController.text.isNotEmpty
|
|
||||||
? IconButton(
|
|
||||||
icon: const Icon(Icons.clear),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_categoryController.clear();
|
|
||||||
_selectedCategory = '';
|
|
||||||
_selectedSubCategory = '';
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_subCategoryController.clear();
|
|
||||||
_subSubCategoryController.clear();
|
|
||||||
_filteredCategories = List.from(_allCategories);
|
|
||||||
_filteredSubCategories = [];
|
|
||||||
_filteredSubSubCategories = [];
|
|
||||||
_showCategoryDropdown =
|
|
||||||
_categoryFocusNode.hasFocus;
|
|
||||||
widget.onCategoryChanged('', '', '');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: IconButton(
|
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_showCategoryDropdown = !_showCategoryDropdown;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
validator: (value) {
|
|
||||||
if (widget.isRequired && (value == null || value.isEmpty)) {
|
|
||||||
return '대분류를 선택해주세요';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
|
||||||
if (!_showCategoryDropdown) {
|
|
||||||
_showCategoryDropdown = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
// 대분류 자동완성 드롭다운
|
|
||||||
AutocompleteDropdown(
|
|
||||||
items: _filteredCategories,
|
|
||||||
inputText: _categoryController.text,
|
|
||||||
onSelect: _selectCategory,
|
|
||||||
showDropdown: _showCategoryDropdown,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
|
|
||||||
// 중분류 및 소분류 선택 행
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
// 중분류 입력 필드 (자동완성)
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
TextFormField(
|
|
||||||
controller: _subCategoryController,
|
|
||||||
focusNode: _subCategoryFocusNode,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: '중분류',
|
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12,
|
|
||||||
vertical: 12,
|
|
||||||
),
|
|
||||||
suffixIcon:
|
|
||||||
_subCategoryController.text.isNotEmpty
|
|
||||||
? IconButton(
|
|
||||||
icon: const Icon(Icons.clear),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_subCategoryController.clear();
|
|
||||||
_selectedSubCategory = '';
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_subSubCategoryController.clear();
|
|
||||||
_updateSubCategories();
|
|
||||||
_updateSubSubCategories();
|
|
||||||
_showSubCategoryDropdown =
|
|
||||||
_subCategoryFocusNode.hasFocus;
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: IconButton(
|
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_showSubCategoryDropdown =
|
|
||||||
!_showSubCategoryDropdown;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
enabled: _selectedCategory.isNotEmpty,
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
|
||||||
if (!_showSubCategoryDropdown &&
|
|
||||||
_filteredSubCategories.isNotEmpty) {
|
|
||||||
_showSubCategoryDropdown = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
// 중분류 자동완성 드롭다운
|
|
||||||
AutocompleteDropdown(
|
|
||||||
items: _filteredSubCategories,
|
|
||||||
inputText: _subCategoryController.text,
|
|
||||||
onSelect: _selectSubCategory,
|
|
||||||
showDropdown: _showSubCategoryDropdown,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
|
|
||||||
// 소분류 입력 필드 (자동완성)
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
TextFormField(
|
|
||||||
controller: _subSubCategoryController,
|
|
||||||
focusNode: _subSubCategoryFocusNode,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: '소분류',
|
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12,
|
|
||||||
vertical: 12,
|
|
||||||
),
|
|
||||||
suffixIcon:
|
|
||||||
_subSubCategoryController.text.isNotEmpty
|
|
||||||
? IconButton(
|
|
||||||
icon: const Icon(Icons.clear),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_subSubCategoryController.clear();
|
|
||||||
_selectedSubSubCategory = '';
|
|
||||||
_updateSubSubCategories();
|
|
||||||
_showSubSubCategoryDropdown =
|
|
||||||
_subSubCategoryFocusNode.hasFocus;
|
|
||||||
widget.onCategoryChanged(
|
|
||||||
_selectedCategory,
|
|
||||||
_selectedSubCategory,
|
|
||||||
'',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: IconButton(
|
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_showSubSubCategoryDropdown =
|
|
||||||
!_showSubSubCategoryDropdown;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
enabled:
|
|
||||||
_selectedCategory.isNotEmpty &&
|
|
||||||
_selectedSubCategory.isNotEmpty,
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
|
||||||
if (!_showSubSubCategoryDropdown &&
|
|
||||||
_filteredSubSubCategories.isNotEmpty) {
|
|
||||||
_showSubSubCategoryDropdown = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
// 소분류 자동완성 드롭다운
|
|
||||||
AutocompleteDropdown(
|
|
||||||
items: _filteredSubSubCategories,
|
|
||||||
inputText: _subSubCategoryController.text,
|
|
||||||
onSelect: _selectSubSubCategory,
|
|
||||||
showDropdown: _showSubSubCategoryDropdown,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'form_field_wrapper.dart';
|
|
||||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
|
||||||
|
|
||||||
// 날짜 선택 필드
|
|
||||||
class DatePickerField extends StatelessWidget {
|
|
||||||
final DateTime selectedDate;
|
|
||||||
final Function(DateTime) onDateChanged;
|
|
||||||
final bool allowFutureDate;
|
|
||||||
final bool isRequired;
|
|
||||||
|
|
||||||
const DatePickerField({
|
|
||||||
super.key,
|
|
||||||
required this.selectedDate,
|
|
||||||
required this.onDateChanged,
|
|
||||||
this.allowFutureDate = false,
|
|
||||||
this.isRequired = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
final DateTime? picked = await showDatePicker(
|
|
||||||
context: context,
|
|
||||||
initialDate: selectedDate,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: allowFutureDate ? DateTime(2100) : DateTime.now(),
|
|
||||||
);
|
|
||||||
if (picked != null && picked != selectedDate) {
|
|
||||||
onDateChanged(picked);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: FormFieldWrapper(
|
|
||||||
label: '날짜',
|
|
||||||
isRequired: isRequired,
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 15),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(color: Colors.grey.shade400),
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${selectedDate.year}-${selectedDate.month.toString().padLeft(2, '0')}-${selectedDate.day.toString().padLeft(2, '0')}',
|
|
||||||
style: ShadcnTheme.bodyMedium,
|
|
||||||
),
|
|
||||||
const Icon(Icons.calendar_today, size: 20),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
// 자동완성 드롭다운에서 텍스트 하이라이트를 위한 위젯
|
|
||||||
class HighlightText extends StatelessWidget {
|
|
||||||
// 전체 텍스트
|
|
||||||
final String text;
|
|
||||||
// 하이라이트할 부분
|
|
||||||
final String highlight;
|
|
||||||
// 하이라이트 색상
|
|
||||||
final Color highlightColor;
|
|
||||||
// 텍스트 스타일
|
|
||||||
final TextStyle? style;
|
|
||||||
|
|
||||||
const HighlightText({
|
|
||||||
super.key,
|
|
||||||
required this.text,
|
|
||||||
required this.highlight,
|
|
||||||
this.highlightColor = Colors.blue,
|
|
||||||
this.style,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (highlight.isEmpty) {
|
|
||||||
// 하이라이트가 없으면 전체 텍스트 반환
|
|
||||||
return Text(text, style: style);
|
|
||||||
}
|
|
||||||
final String lowerText = text.toLowerCase();
|
|
||||||
final String lowerHighlight = highlight.toLowerCase();
|
|
||||||
final int start = lowerText.indexOf(lowerHighlight);
|
|
||||||
if (start < 0) {
|
|
||||||
// 일치하는 부분이 없으면 전체 텍스트 반환
|
|
||||||
return Text(text, style: style);
|
|
||||||
}
|
|
||||||
final int end = start + highlight.length;
|
|
||||||
return RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
style: style ?? DefaultTextStyle.of(context).style,
|
|
||||||
children: [
|
|
||||||
if (start > 0) TextSpan(text: text.substring(0, start)),
|
|
||||||
TextSpan(
|
|
||||||
text: text.substring(start, end),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: highlightColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (end < text.length) TextSpan(text: text.substring(end)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user