feat: API 통합 2차 작업 완료
- 자동 로그인 구현: 앱 시작 시 토큰 확인 후 적절한 화면으로 라우팅 - AuthInterceptor 개선: AuthService와 통합하여 토큰 관리 일원화 - 로그아웃 기능 개선: AuthService를 사용한 API 로그아웃 처리 - 대시보드 API 연동: MockDataService에서 실제 API로 완전 전환 - Dashboard DTO 모델 생성 (OverviewStats, RecentActivity 등) - DashboardRemoteDataSource 및 DashboardService 구현 - OverviewController를 ChangeNotifier 패턴으로 개선 - OverviewScreenRedesign에 Provider 패턴 적용 - API 통합 진행 상황 문서 업데이트
This commit is contained in:
403
lib/data/models/dashboard/overview_stats.freezed.dart
Normal file
403
lib/data/models/dashboard/overview_stats.freezed.dart
Normal file
@@ -0,0 +1,403 @@
|
||||
// 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 'overview_stats.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');
|
||||
|
||||
OverviewStats _$OverviewStatsFromJson(Map<String, dynamic> json) {
|
||||
return _OverviewStats.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$OverviewStats {
|
||||
@JsonKey(name: 'total_equipment')
|
||||
int get totalEquipment => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'available_equipment')
|
||||
int get availableEquipment => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'in_use_equipment')
|
||||
int get inUseEquipment => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'maintenance_equipment')
|
||||
int get maintenanceEquipment => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_companies')
|
||||
int get totalCompanies => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_users')
|
||||
int get totalUsers => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'active_licenses')
|
||||
int get activeLicenses => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiring_licenses')
|
||||
int get expiringLicenses => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_rentals')
|
||||
int get totalRentals => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'active_rentals')
|
||||
int get activeRentals => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this OverviewStats to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of OverviewStats
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$OverviewStatsCopyWith<OverviewStats> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $OverviewStatsCopyWith<$Res> {
|
||||
factory $OverviewStatsCopyWith(
|
||||
OverviewStats value, $Res Function(OverviewStats) then) =
|
||||
_$OverviewStatsCopyWithImpl<$Res, OverviewStats>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'total_equipment') int totalEquipment,
|
||||
@JsonKey(name: 'available_equipment') int availableEquipment,
|
||||
@JsonKey(name: 'in_use_equipment') int inUseEquipment,
|
||||
@JsonKey(name: 'maintenance_equipment') int maintenanceEquipment,
|
||||
@JsonKey(name: 'total_companies') int totalCompanies,
|
||||
@JsonKey(name: 'total_users') int totalUsers,
|
||||
@JsonKey(name: 'active_licenses') int activeLicenses,
|
||||
@JsonKey(name: 'expiring_licenses') int expiringLicenses,
|
||||
@JsonKey(name: 'total_rentals') int totalRentals,
|
||||
@JsonKey(name: 'active_rentals') int activeRentals});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$OverviewStatsCopyWithImpl<$Res, $Val extends OverviewStats>
|
||||
implements $OverviewStatsCopyWith<$Res> {
|
||||
_$OverviewStatsCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of OverviewStats
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? totalEquipment = null,
|
||||
Object? availableEquipment = null,
|
||||
Object? inUseEquipment = null,
|
||||
Object? maintenanceEquipment = null,
|
||||
Object? totalCompanies = null,
|
||||
Object? totalUsers = null,
|
||||
Object? activeLicenses = null,
|
||||
Object? expiringLicenses = null,
|
||||
Object? totalRentals = null,
|
||||
Object? activeRentals = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
totalEquipment: null == totalEquipment
|
||||
? _value.totalEquipment
|
||||
: totalEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
availableEquipment: null == availableEquipment
|
||||
? _value.availableEquipment
|
||||
: availableEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
inUseEquipment: null == inUseEquipment
|
||||
? _value.inUseEquipment
|
||||
: inUseEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
maintenanceEquipment: null == maintenanceEquipment
|
||||
? _value.maintenanceEquipment
|
||||
: maintenanceEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalCompanies: null == totalCompanies
|
||||
? _value.totalCompanies
|
||||
: totalCompanies // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalUsers: null == totalUsers
|
||||
? _value.totalUsers
|
||||
: totalUsers // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
activeLicenses: null == activeLicenses
|
||||
? _value.activeLicenses
|
||||
: activeLicenses // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
expiringLicenses: null == expiringLicenses
|
||||
? _value.expiringLicenses
|
||||
: expiringLicenses // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalRentals: null == totalRentals
|
||||
? _value.totalRentals
|
||||
: totalRentals // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
activeRentals: null == activeRentals
|
||||
? _value.activeRentals
|
||||
: activeRentals // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$OverviewStatsImplCopyWith<$Res>
|
||||
implements $OverviewStatsCopyWith<$Res> {
|
||||
factory _$$OverviewStatsImplCopyWith(
|
||||
_$OverviewStatsImpl value, $Res Function(_$OverviewStatsImpl) then) =
|
||||
__$$OverviewStatsImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'total_equipment') int totalEquipment,
|
||||
@JsonKey(name: 'available_equipment') int availableEquipment,
|
||||
@JsonKey(name: 'in_use_equipment') int inUseEquipment,
|
||||
@JsonKey(name: 'maintenance_equipment') int maintenanceEquipment,
|
||||
@JsonKey(name: 'total_companies') int totalCompanies,
|
||||
@JsonKey(name: 'total_users') int totalUsers,
|
||||
@JsonKey(name: 'active_licenses') int activeLicenses,
|
||||
@JsonKey(name: 'expiring_licenses') int expiringLicenses,
|
||||
@JsonKey(name: 'total_rentals') int totalRentals,
|
||||
@JsonKey(name: 'active_rentals') int activeRentals});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$OverviewStatsImplCopyWithImpl<$Res>
|
||||
extends _$OverviewStatsCopyWithImpl<$Res, _$OverviewStatsImpl>
|
||||
implements _$$OverviewStatsImplCopyWith<$Res> {
|
||||
__$$OverviewStatsImplCopyWithImpl(
|
||||
_$OverviewStatsImpl _value, $Res Function(_$OverviewStatsImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of OverviewStats
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? totalEquipment = null,
|
||||
Object? availableEquipment = null,
|
||||
Object? inUseEquipment = null,
|
||||
Object? maintenanceEquipment = null,
|
||||
Object? totalCompanies = null,
|
||||
Object? totalUsers = null,
|
||||
Object? activeLicenses = null,
|
||||
Object? expiringLicenses = null,
|
||||
Object? totalRentals = null,
|
||||
Object? activeRentals = null,
|
||||
}) {
|
||||
return _then(_$OverviewStatsImpl(
|
||||
totalEquipment: null == totalEquipment
|
||||
? _value.totalEquipment
|
||||
: totalEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
availableEquipment: null == availableEquipment
|
||||
? _value.availableEquipment
|
||||
: availableEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
inUseEquipment: null == inUseEquipment
|
||||
? _value.inUseEquipment
|
||||
: inUseEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
maintenanceEquipment: null == maintenanceEquipment
|
||||
? _value.maintenanceEquipment
|
||||
: maintenanceEquipment // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalCompanies: null == totalCompanies
|
||||
? _value.totalCompanies
|
||||
: totalCompanies // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalUsers: null == totalUsers
|
||||
? _value.totalUsers
|
||||
: totalUsers // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
activeLicenses: null == activeLicenses
|
||||
? _value.activeLicenses
|
||||
: activeLicenses // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
expiringLicenses: null == expiringLicenses
|
||||
? _value.expiringLicenses
|
||||
: expiringLicenses // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalRentals: null == totalRentals
|
||||
? _value.totalRentals
|
||||
: totalRentals // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
activeRentals: null == activeRentals
|
||||
? _value.activeRentals
|
||||
: activeRentals // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$OverviewStatsImpl implements _OverviewStats {
|
||||
const _$OverviewStatsImpl(
|
||||
{@JsonKey(name: 'total_equipment') required this.totalEquipment,
|
||||
@JsonKey(name: 'available_equipment') required this.availableEquipment,
|
||||
@JsonKey(name: 'in_use_equipment') required this.inUseEquipment,
|
||||
@JsonKey(name: 'maintenance_equipment')
|
||||
required this.maintenanceEquipment,
|
||||
@JsonKey(name: 'total_companies') required this.totalCompanies,
|
||||
@JsonKey(name: 'total_users') required this.totalUsers,
|
||||
@JsonKey(name: 'active_licenses') required this.activeLicenses,
|
||||
@JsonKey(name: 'expiring_licenses') required this.expiringLicenses,
|
||||
@JsonKey(name: 'total_rentals') required this.totalRentals,
|
||||
@JsonKey(name: 'active_rentals') required this.activeRentals});
|
||||
|
||||
factory _$OverviewStatsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$OverviewStatsImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'total_equipment')
|
||||
final int totalEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'available_equipment')
|
||||
final int availableEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'in_use_equipment')
|
||||
final int inUseEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'maintenance_equipment')
|
||||
final int maintenanceEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'total_companies')
|
||||
final int totalCompanies;
|
||||
@override
|
||||
@JsonKey(name: 'total_users')
|
||||
final int totalUsers;
|
||||
@override
|
||||
@JsonKey(name: 'active_licenses')
|
||||
final int activeLicenses;
|
||||
@override
|
||||
@JsonKey(name: 'expiring_licenses')
|
||||
final int expiringLicenses;
|
||||
@override
|
||||
@JsonKey(name: 'total_rentals')
|
||||
final int totalRentals;
|
||||
@override
|
||||
@JsonKey(name: 'active_rentals')
|
||||
final int activeRentals;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'OverviewStats(totalEquipment: $totalEquipment, availableEquipment: $availableEquipment, inUseEquipment: $inUseEquipment, maintenanceEquipment: $maintenanceEquipment, totalCompanies: $totalCompanies, totalUsers: $totalUsers, activeLicenses: $activeLicenses, expiringLicenses: $expiringLicenses, totalRentals: $totalRentals, activeRentals: $activeRentals)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$OverviewStatsImpl &&
|
||||
(identical(other.totalEquipment, totalEquipment) ||
|
||||
other.totalEquipment == totalEquipment) &&
|
||||
(identical(other.availableEquipment, availableEquipment) ||
|
||||
other.availableEquipment == availableEquipment) &&
|
||||
(identical(other.inUseEquipment, inUseEquipment) ||
|
||||
other.inUseEquipment == inUseEquipment) &&
|
||||
(identical(other.maintenanceEquipment, maintenanceEquipment) ||
|
||||
other.maintenanceEquipment == maintenanceEquipment) &&
|
||||
(identical(other.totalCompanies, totalCompanies) ||
|
||||
other.totalCompanies == totalCompanies) &&
|
||||
(identical(other.totalUsers, totalUsers) ||
|
||||
other.totalUsers == totalUsers) &&
|
||||
(identical(other.activeLicenses, activeLicenses) ||
|
||||
other.activeLicenses == activeLicenses) &&
|
||||
(identical(other.expiringLicenses, expiringLicenses) ||
|
||||
other.expiringLicenses == expiringLicenses) &&
|
||||
(identical(other.totalRentals, totalRentals) ||
|
||||
other.totalRentals == totalRentals) &&
|
||||
(identical(other.activeRentals, activeRentals) ||
|
||||
other.activeRentals == activeRentals));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
totalEquipment,
|
||||
availableEquipment,
|
||||
inUseEquipment,
|
||||
maintenanceEquipment,
|
||||
totalCompanies,
|
||||
totalUsers,
|
||||
activeLicenses,
|
||||
expiringLicenses,
|
||||
totalRentals,
|
||||
activeRentals);
|
||||
|
||||
/// Create a copy of OverviewStats
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$OverviewStatsImplCopyWith<_$OverviewStatsImpl> get copyWith =>
|
||||
__$$OverviewStatsImplCopyWithImpl<_$OverviewStatsImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$OverviewStatsImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _OverviewStats implements OverviewStats {
|
||||
const factory _OverviewStats(
|
||||
{@JsonKey(name: 'total_equipment') required final int totalEquipment,
|
||||
@JsonKey(name: 'available_equipment')
|
||||
required final int availableEquipment,
|
||||
@JsonKey(name: 'in_use_equipment') required final int inUseEquipment,
|
||||
@JsonKey(name: 'maintenance_equipment')
|
||||
required final int maintenanceEquipment,
|
||||
@JsonKey(name: 'total_companies') required final int totalCompanies,
|
||||
@JsonKey(name: 'total_users') required final int totalUsers,
|
||||
@JsonKey(name: 'active_licenses') required final int activeLicenses,
|
||||
@JsonKey(name: 'expiring_licenses') required final int expiringLicenses,
|
||||
@JsonKey(name: 'total_rentals') required final int totalRentals,
|
||||
@JsonKey(name: 'active_rentals')
|
||||
required final int activeRentals}) = _$OverviewStatsImpl;
|
||||
|
||||
factory _OverviewStats.fromJson(Map<String, dynamic> json) =
|
||||
_$OverviewStatsImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'total_equipment')
|
||||
int get totalEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'available_equipment')
|
||||
int get availableEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'in_use_equipment')
|
||||
int get inUseEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'maintenance_equipment')
|
||||
int get maintenanceEquipment;
|
||||
@override
|
||||
@JsonKey(name: 'total_companies')
|
||||
int get totalCompanies;
|
||||
@override
|
||||
@JsonKey(name: 'total_users')
|
||||
int get totalUsers;
|
||||
@override
|
||||
@JsonKey(name: 'active_licenses')
|
||||
int get activeLicenses;
|
||||
@override
|
||||
@JsonKey(name: 'expiring_licenses')
|
||||
int get expiringLicenses;
|
||||
@override
|
||||
@JsonKey(name: 'total_rentals')
|
||||
int get totalRentals;
|
||||
@override
|
||||
@JsonKey(name: 'active_rentals')
|
||||
int get activeRentals;
|
||||
|
||||
/// Create a copy of OverviewStats
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$OverviewStatsImplCopyWith<_$OverviewStatsImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
Reference in New Issue
Block a user