From 590bb3329c01da159bfcc456a382365ad50233dc Mon Sep 17 00:00:00 2001 From: efrilm Date: Tue, 19 Aug 2025 11:08:33 +0700 Subject: [PATCH] feat: outlet information page --- .../current_outlet_loader_bloc.dart | 40 + .../current_outlet_loader_bloc.freezed.dart | 382 +++++++ .../current_outlet_loader_event.dart | 6 + .../current_outlet_loader_state.dart | 15 + lib/common/url/api_path.dart | 3 + lib/domain/outlet/entities/outlet_entity.dart | 32 + .../outlet/failures/outlet_failure.dart | 10 + lib/domain/outlet/outlet.dart | 10 + lib/domain/outlet/outlet.freezed.dart | 1009 +++++++++++++++++ .../repositories/i_outlet_repository.dart | 5 + .../datasource/remote_data_provider.dart | 39 + lib/infrastructure/outlet/dto/outlet_dto.dart | 44 + lib/infrastructure/outlet/outlet_dtos.dart | 8 + .../outlet/outlet_dtos.freezed.dart | 431 +++++++ lib/infrastructure/outlet/outlet_dtos.g.dart | 37 + .../repositories/outlet_repository.dart | 36 + lib/injection.config.dart | 19 + .../pages/outlet/outlet_information_page.dart | 403 +++++++ .../profile/widgets/business_setting.dart | 4 +- lib/presentation/router/app_router.dart | 3 + lib/presentation/router/app_router.gr.dart | 220 ++-- 21 files changed, 2652 insertions(+), 104 deletions(-) create mode 100644 lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.dart create mode 100644 lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.freezed.dart create mode 100644 lib/application/outlet/current_outlet_loader/current_outlet_loader_event.dart create mode 100644 lib/application/outlet/current_outlet_loader/current_outlet_loader_state.dart create mode 100644 lib/domain/outlet/entities/outlet_entity.dart create mode 100644 lib/domain/outlet/failures/outlet_failure.dart create mode 100644 lib/domain/outlet/outlet.dart create mode 100644 lib/domain/outlet/outlet.freezed.dart create mode 100644 lib/domain/outlet/repositories/i_outlet_repository.dart create mode 100644 lib/infrastructure/outlet/datasource/remote_data_provider.dart create mode 100644 lib/infrastructure/outlet/dto/outlet_dto.dart create mode 100644 lib/infrastructure/outlet/outlet_dtos.dart create mode 100644 lib/infrastructure/outlet/outlet_dtos.freezed.dart create mode 100644 lib/infrastructure/outlet/outlet_dtos.g.dart create mode 100644 lib/infrastructure/outlet/repositories/outlet_repository.dart create mode 100644 lib/presentation/pages/outlet/outlet_information_page.dart diff --git a/lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.dart b/lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.dart new file mode 100644 index 0000000..943ed23 --- /dev/null +++ b/lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.dart @@ -0,0 +1,40 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:injectable/injectable.dart'; + +import '../../../domain/outlet/outlet.dart'; + +part 'current_outlet_loader_event.dart'; +part 'current_outlet_loader_state.dart'; +part 'current_outlet_loader_bloc.freezed.dart'; + +@injectable +class CurrentOutletLoaderBloc + extends Bloc { + final IOutletRepository _repository; + CurrentOutletLoaderBloc(this._repository) + : super(CurrentOutletLoaderState.initial()) { + on(_onCurrentOutletLoaderEvent); + } + + Future _onCurrentOutletLoaderEvent( + CurrentOutletLoaderEvent event, + Emitter emit, + ) { + return event.map( + fetched: (e) async { + emit(state.copyWith(isFetching: true, failureOptionOutlet: none())); + + final result = await _repository.currentOutlet(); + + var data = result.fold( + (f) => state.copyWith(failureOptionOutlet: optionOf(f)), + (currentOutlet) => state.copyWith(outlet: currentOutlet), + ); + + emit(data.copyWith(isFetching: false)); + }, + ); + } +} diff --git a/lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.freezed.dart b/lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.freezed.dart new file mode 100644 index 0000000..e78ce9f --- /dev/null +++ b/lib/application/outlet/current_outlet_loader/current_outlet_loader_bloc.freezed.dart @@ -0,0 +1,382 @@ +// 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 'current_outlet_loader_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(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', +); + +/// @nodoc +mixin _$CurrentOutletLoaderEvent { + @optionalTypeArgs + TResult when({ + required TResult Function() fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? fetched, + required TResult orElse(), + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_Fetched value) fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Fetched value)? fetched, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Fetched value)? fetched, + required TResult orElse(), + }) => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CurrentOutletLoaderEventCopyWith<$Res> { + factory $CurrentOutletLoaderEventCopyWith( + CurrentOutletLoaderEvent value, + $Res Function(CurrentOutletLoaderEvent) then, + ) = _$CurrentOutletLoaderEventCopyWithImpl<$Res, CurrentOutletLoaderEvent>; +} + +/// @nodoc +class _$CurrentOutletLoaderEventCopyWithImpl< + $Res, + $Val extends CurrentOutletLoaderEvent +> + implements $CurrentOutletLoaderEventCopyWith<$Res> { + _$CurrentOutletLoaderEventCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of CurrentOutletLoaderEvent + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$FetchedImplCopyWith<$Res> { + factory _$$FetchedImplCopyWith( + _$FetchedImpl value, + $Res Function(_$FetchedImpl) then, + ) = __$$FetchedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$FetchedImplCopyWithImpl<$Res> + extends _$CurrentOutletLoaderEventCopyWithImpl<$Res, _$FetchedImpl> + implements _$$FetchedImplCopyWith<$Res> { + __$$FetchedImplCopyWithImpl( + _$FetchedImpl _value, + $Res Function(_$FetchedImpl) _then, + ) : super(_value, _then); + + /// Create a copy of CurrentOutletLoaderEvent + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$FetchedImpl implements _Fetched { + const _$FetchedImpl(); + + @override + String toString() { + return 'CurrentOutletLoaderEvent.fetched()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$FetchedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({required TResult Function() fetched}) { + return fetched(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({TResult? Function()? fetched}) { + return fetched?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? fetched, + required TResult orElse(), + }) { + if (fetched != null) { + return fetched(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Fetched value) fetched, + }) { + return fetched(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Fetched value)? fetched, + }) { + return fetched?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Fetched value)? fetched, + required TResult orElse(), + }) { + if (fetched != null) { + return fetched(this); + } + return orElse(); + } +} + +abstract class _Fetched implements CurrentOutletLoaderEvent { + const factory _Fetched() = _$FetchedImpl; +} + +/// @nodoc +mixin _$CurrentOutletLoaderState { + Outlet get outlet => throw _privateConstructorUsedError; + Option get failureOptionOutlet => + throw _privateConstructorUsedError; + bool get isFetching => throw _privateConstructorUsedError; + + /// Create a copy of CurrentOutletLoaderState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $CurrentOutletLoaderStateCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CurrentOutletLoaderStateCopyWith<$Res> { + factory $CurrentOutletLoaderStateCopyWith( + CurrentOutletLoaderState value, + $Res Function(CurrentOutletLoaderState) then, + ) = _$CurrentOutletLoaderStateCopyWithImpl<$Res, CurrentOutletLoaderState>; + @useResult + $Res call({ + Outlet outlet, + Option failureOptionOutlet, + bool isFetching, + }); + + $OutletCopyWith<$Res> get outlet; +} + +/// @nodoc +class _$CurrentOutletLoaderStateCopyWithImpl< + $Res, + $Val extends CurrentOutletLoaderState +> + implements $CurrentOutletLoaderStateCopyWith<$Res> { + _$CurrentOutletLoaderStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of CurrentOutletLoaderState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? outlet = null, + Object? failureOptionOutlet = null, + Object? isFetching = null, + }) { + return _then( + _value.copyWith( + outlet: null == outlet + ? _value.outlet + : outlet // ignore: cast_nullable_to_non_nullable + as Outlet, + failureOptionOutlet: null == failureOptionOutlet + ? _value.failureOptionOutlet + : failureOptionOutlet // ignore: cast_nullable_to_non_nullable + as Option, + isFetching: null == isFetching + ? _value.isFetching + : isFetching // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); + } + + /// Create a copy of CurrentOutletLoaderState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $OutletCopyWith<$Res> get outlet { + return $OutletCopyWith<$Res>(_value.outlet, (value) { + return _then(_value.copyWith(outlet: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$CurrentOutletLoaderStateImplCopyWith<$Res> + implements $CurrentOutletLoaderStateCopyWith<$Res> { + factory _$$CurrentOutletLoaderStateImplCopyWith( + _$CurrentOutletLoaderStateImpl value, + $Res Function(_$CurrentOutletLoaderStateImpl) then, + ) = __$$CurrentOutletLoaderStateImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + Outlet outlet, + Option failureOptionOutlet, + bool isFetching, + }); + + @override + $OutletCopyWith<$Res> get outlet; +} + +/// @nodoc +class __$$CurrentOutletLoaderStateImplCopyWithImpl<$Res> + extends + _$CurrentOutletLoaderStateCopyWithImpl< + $Res, + _$CurrentOutletLoaderStateImpl + > + implements _$$CurrentOutletLoaderStateImplCopyWith<$Res> { + __$$CurrentOutletLoaderStateImplCopyWithImpl( + _$CurrentOutletLoaderStateImpl _value, + $Res Function(_$CurrentOutletLoaderStateImpl) _then, + ) : super(_value, _then); + + /// Create a copy of CurrentOutletLoaderState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? outlet = null, + Object? failureOptionOutlet = null, + Object? isFetching = null, + }) { + return _then( + _$CurrentOutletLoaderStateImpl( + outlet: null == outlet + ? _value.outlet + : outlet // ignore: cast_nullable_to_non_nullable + as Outlet, + failureOptionOutlet: null == failureOptionOutlet + ? _value.failureOptionOutlet + : failureOptionOutlet // ignore: cast_nullable_to_non_nullable + as Option, + isFetching: null == isFetching + ? _value.isFetching + : isFetching // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); + } +} + +/// @nodoc + +class _$CurrentOutletLoaderStateImpl implements _CurrentOutletLoaderState { + const _$CurrentOutletLoaderStateImpl({ + required this.outlet, + required this.failureOptionOutlet, + this.isFetching = false, + }); + + @override + final Outlet outlet; + @override + final Option failureOptionOutlet; + @override + @JsonKey() + final bool isFetching; + + @override + String toString() { + return 'CurrentOutletLoaderState(outlet: $outlet, failureOptionOutlet: $failureOptionOutlet, isFetching: $isFetching)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CurrentOutletLoaderStateImpl && + (identical(other.outlet, outlet) || other.outlet == outlet) && + (identical(other.failureOptionOutlet, failureOptionOutlet) || + other.failureOptionOutlet == failureOptionOutlet) && + (identical(other.isFetching, isFetching) || + other.isFetching == isFetching)); + } + + @override + int get hashCode => + Object.hash(runtimeType, outlet, failureOptionOutlet, isFetching); + + /// Create a copy of CurrentOutletLoaderState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$CurrentOutletLoaderStateImplCopyWith<_$CurrentOutletLoaderStateImpl> + get copyWith => + __$$CurrentOutletLoaderStateImplCopyWithImpl< + _$CurrentOutletLoaderStateImpl + >(this, _$identity); +} + +abstract class _CurrentOutletLoaderState implements CurrentOutletLoaderState { + const factory _CurrentOutletLoaderState({ + required final Outlet outlet, + required final Option failureOptionOutlet, + final bool isFetching, + }) = _$CurrentOutletLoaderStateImpl; + + @override + Outlet get outlet; + @override + Option get failureOptionOutlet; + @override + bool get isFetching; + + /// Create a copy of CurrentOutletLoaderState + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CurrentOutletLoaderStateImplCopyWith<_$CurrentOutletLoaderStateImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/application/outlet/current_outlet_loader/current_outlet_loader_event.dart b/lib/application/outlet/current_outlet_loader/current_outlet_loader_event.dart new file mode 100644 index 0000000..4a536c8 --- /dev/null +++ b/lib/application/outlet/current_outlet_loader/current_outlet_loader_event.dart @@ -0,0 +1,6 @@ +part of 'current_outlet_loader_bloc.dart'; + +@freezed +class CurrentOutletLoaderEvent with _$CurrentOutletLoaderEvent { + const factory CurrentOutletLoaderEvent.fetched() = _Fetched; +} diff --git a/lib/application/outlet/current_outlet_loader/current_outlet_loader_state.dart b/lib/application/outlet/current_outlet_loader/current_outlet_loader_state.dart new file mode 100644 index 0000000..658ef89 --- /dev/null +++ b/lib/application/outlet/current_outlet_loader/current_outlet_loader_state.dart @@ -0,0 +1,15 @@ +part of 'current_outlet_loader_bloc.dart'; + +@freezed +class CurrentOutletLoaderState with _$CurrentOutletLoaderState { + const factory CurrentOutletLoaderState({ + required Outlet outlet, + required Option failureOptionOutlet, + @Default(false) bool isFetching, + }) = _CurrentOutletLoaderState; + + factory CurrentOutletLoaderState.initial() => CurrentOutletLoaderState( + outlet: Outlet.empty(), + failureOptionOutlet: none(), + ); +} diff --git a/lib/common/url/api_path.dart b/lib/common/url/api_path.dart index 875d092..a3cdc1b 100644 --- a/lib/common/url/api_path.dart +++ b/lib/common/url/api_path.dart @@ -27,4 +27,7 @@ class ApiPath { // Order static const String order = '/api/v1/orders'; + + // Outlet + static const String outlet = '/api/v1/outlets'; } diff --git a/lib/domain/outlet/entities/outlet_entity.dart b/lib/domain/outlet/entities/outlet_entity.dart new file mode 100644 index 0000000..fcca16c --- /dev/null +++ b/lib/domain/outlet/entities/outlet_entity.dart @@ -0,0 +1,32 @@ +part of '../outlet.dart'; + +@freezed +class Outlet with _$Outlet { + const factory Outlet({ + required String id, + required String organizationId, + required String name, + required String address, + required String phoneNumber, + required String businessType, + required String currency, + required int taxRate, + required bool isActive, + required DateTime createdAt, + required DateTime updatedAt, + }) = _Outlet; + + factory Outlet.empty() => Outlet( + id: '', + organizationId: '', + name: '', + address: '', + phoneNumber: '', + businessType: '', + currency: '', + taxRate: 0, + isActive: false, + createdAt: DateTime(1970), + updatedAt: DateTime(1970), + ); +} diff --git a/lib/domain/outlet/failures/outlet_failure.dart b/lib/domain/outlet/failures/outlet_failure.dart new file mode 100644 index 0000000..1f53408 --- /dev/null +++ b/lib/domain/outlet/failures/outlet_failure.dart @@ -0,0 +1,10 @@ +part of '../outlet.dart'; + +@freezed +sealed class OutletFailure with _$OutletFailure { + const factory OutletFailure.serverError(ApiFailure failure) = _ServerError; + const factory OutletFailure.unexpectedError() = _UnexpectedError; + const factory OutletFailure.empty() = _Empty; + const factory OutletFailure.dynamicErrorMessage(String erroMessage) = + _DynamicErrorMessage; +} diff --git a/lib/domain/outlet/outlet.dart b/lib/domain/outlet/outlet.dart new file mode 100644 index 0000000..32c2ff4 --- /dev/null +++ b/lib/domain/outlet/outlet.dart @@ -0,0 +1,10 @@ +import 'package:dartz/dartz.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +import '../../common/api/api_failure.dart'; + +part 'outlet.freezed.dart'; + +part 'entities/outlet_entity.dart'; +part 'failures/outlet_failure.dart'; +part 'repositories/i_outlet_repository.dart'; diff --git a/lib/domain/outlet/outlet.freezed.dart b/lib/domain/outlet/outlet.freezed.dart new file mode 100644 index 0000000..d8d857e --- /dev/null +++ b/lib/domain/outlet/outlet.freezed.dart @@ -0,0 +1,1009 @@ +// 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 'outlet.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(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', +); + +/// @nodoc +mixin _$Outlet { + String get id => throw _privateConstructorUsedError; + String get organizationId => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + String get address => throw _privateConstructorUsedError; + String get phoneNumber => throw _privateConstructorUsedError; + String get businessType => throw _privateConstructorUsedError; + String get currency => throw _privateConstructorUsedError; + int get taxRate => throw _privateConstructorUsedError; + bool get isActive => throw _privateConstructorUsedError; + DateTime get createdAt => throw _privateConstructorUsedError; + DateTime get updatedAt => throw _privateConstructorUsedError; + + /// Create a copy of Outlet + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $OutletCopyWith get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $OutletCopyWith<$Res> { + factory $OutletCopyWith(Outlet value, $Res Function(Outlet) then) = + _$OutletCopyWithImpl<$Res, Outlet>; + @useResult + $Res call({ + String id, + String organizationId, + String name, + String address, + String phoneNumber, + String businessType, + String currency, + int taxRate, + bool isActive, + DateTime createdAt, + DateTime updatedAt, + }); +} + +/// @nodoc +class _$OutletCopyWithImpl<$Res, $Val extends Outlet> + implements $OutletCopyWith<$Res> { + _$OutletCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of Outlet + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? organizationId = null, + Object? name = null, + Object? address = null, + Object? phoneNumber = null, + Object? businessType = null, + Object? currency = null, + Object? taxRate = null, + Object? isActive = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + organizationId: null == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + phoneNumber: null == phoneNumber + ? _value.phoneNumber + : phoneNumber // ignore: cast_nullable_to_non_nullable + as String, + businessType: null == businessType + ? _value.businessType + : businessType // ignore: cast_nullable_to_non_nullable + as String, + currency: null == currency + ? _value.currency + : currency // ignore: cast_nullable_to_non_nullable + as String, + taxRate: null == taxRate + ? _value.taxRate + : taxRate // ignore: cast_nullable_to_non_nullable + as int, + isActive: null == isActive + ? _value.isActive + : isActive // ignore: cast_nullable_to_non_nullable + as bool, + 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, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$OutletImplCopyWith<$Res> implements $OutletCopyWith<$Res> { + factory _$$OutletImplCopyWith( + _$OutletImpl value, + $Res Function(_$OutletImpl) then, + ) = __$$OutletImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String id, + String organizationId, + String name, + String address, + String phoneNumber, + String businessType, + String currency, + int taxRate, + bool isActive, + DateTime createdAt, + DateTime updatedAt, + }); +} + +/// @nodoc +class __$$OutletImplCopyWithImpl<$Res> + extends _$OutletCopyWithImpl<$Res, _$OutletImpl> + implements _$$OutletImplCopyWith<$Res> { + __$$OutletImplCopyWithImpl( + _$OutletImpl _value, + $Res Function(_$OutletImpl) _then, + ) : super(_value, _then); + + /// Create a copy of Outlet + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? organizationId = null, + Object? name = null, + Object? address = null, + Object? phoneNumber = null, + Object? businessType = null, + Object? currency = null, + Object? taxRate = null, + Object? isActive = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then( + _$OutletImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + organizationId: null == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + phoneNumber: null == phoneNumber + ? _value.phoneNumber + : phoneNumber // ignore: cast_nullable_to_non_nullable + as String, + businessType: null == businessType + ? _value.businessType + : businessType // ignore: cast_nullable_to_non_nullable + as String, + currency: null == currency + ? _value.currency + : currency // ignore: cast_nullable_to_non_nullable + as String, + taxRate: null == taxRate + ? _value.taxRate + : taxRate // ignore: cast_nullable_to_non_nullable + as int, + isActive: null == isActive + ? _value.isActive + : isActive // ignore: cast_nullable_to_non_nullable + as bool, + 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, + ), + ); + } +} + +/// @nodoc + +class _$OutletImpl implements _Outlet { + const _$OutletImpl({ + required this.id, + required this.organizationId, + required this.name, + required this.address, + required this.phoneNumber, + required this.businessType, + required this.currency, + required this.taxRate, + required this.isActive, + required this.createdAt, + required this.updatedAt, + }); + + @override + final String id; + @override + final String organizationId; + @override + final String name; + @override + final String address; + @override + final String phoneNumber; + @override + final String businessType; + @override + final String currency; + @override + final int taxRate; + @override + final bool isActive; + @override + final DateTime createdAt; + @override + final DateTime updatedAt; + + @override + String toString() { + return 'Outlet(id: $id, organizationId: $organizationId, name: $name, address: $address, phoneNumber: $phoneNumber, businessType: $businessType, currency: $currency, taxRate: $taxRate, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$OutletImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.organizationId, organizationId) || + other.organizationId == organizationId) && + (identical(other.name, name) || other.name == name) && + (identical(other.address, address) || other.address == address) && + (identical(other.phoneNumber, phoneNumber) || + other.phoneNumber == phoneNumber) && + (identical(other.businessType, businessType) || + other.businessType == businessType) && + (identical(other.currency, currency) || + other.currency == currency) && + (identical(other.taxRate, taxRate) || other.taxRate == taxRate) && + (identical(other.isActive, isActive) || + other.isActive == isActive) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + organizationId, + name, + address, + phoneNumber, + businessType, + currency, + taxRate, + isActive, + createdAt, + updatedAt, + ); + + /// Create a copy of Outlet + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$OutletImplCopyWith<_$OutletImpl> get copyWith => + __$$OutletImplCopyWithImpl<_$OutletImpl>(this, _$identity); +} + +abstract class _Outlet implements Outlet { + const factory _Outlet({ + required final String id, + required final String organizationId, + required final String name, + required final String address, + required final String phoneNumber, + required final String businessType, + required final String currency, + required final int taxRate, + required final bool isActive, + required final DateTime createdAt, + required final DateTime updatedAt, + }) = _$OutletImpl; + + @override + String get id; + @override + String get organizationId; + @override + String get name; + @override + String get address; + @override + String get phoneNumber; + @override + String get businessType; + @override + String get currency; + @override + int get taxRate; + @override + bool get isActive; + @override + DateTime get createdAt; + @override + DateTime get updatedAt; + + /// Create a copy of Outlet + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$OutletImplCopyWith<_$OutletImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$OutletFailure { + @optionalTypeArgs + TResult when({ + required TResult Function(ApiFailure failure) serverError, + required TResult Function() unexpectedError, + required TResult Function() empty, + required TResult Function(String erroMessage) dynamicErrorMessage, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ApiFailure failure)? serverError, + TResult? Function()? unexpectedError, + TResult? Function()? empty, + TResult? Function(String erroMessage)? dynamicErrorMessage, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ApiFailure failure)? serverError, + TResult Function()? unexpectedError, + TResult Function()? empty, + TResult Function(String erroMessage)? dynamicErrorMessage, + required TResult orElse(), + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_Empty value) empty, + required TResult Function(_DynamicErrorMessage value) dynamicErrorMessage, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_Empty value)? empty, + TResult? Function(_DynamicErrorMessage value)? dynamicErrorMessage, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_Empty value)? empty, + TResult Function(_DynamicErrorMessage value)? dynamicErrorMessage, + required TResult orElse(), + }) => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $OutletFailureCopyWith<$Res> { + factory $OutletFailureCopyWith( + OutletFailure value, + $Res Function(OutletFailure) then, + ) = _$OutletFailureCopyWithImpl<$Res, OutletFailure>; +} + +/// @nodoc +class _$OutletFailureCopyWithImpl<$Res, $Val extends OutletFailure> + implements $OutletFailureCopyWith<$Res> { + _$OutletFailureCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$ServerErrorImplCopyWith<$Res> { + factory _$$ServerErrorImplCopyWith( + _$ServerErrorImpl value, + $Res Function(_$ServerErrorImpl) then, + ) = __$$ServerErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({ApiFailure failure}); + + $ApiFailureCopyWith<$Res> get failure; +} + +/// @nodoc +class __$$ServerErrorImplCopyWithImpl<$Res> + extends _$OutletFailureCopyWithImpl<$Res, _$ServerErrorImpl> + implements _$$ServerErrorImplCopyWith<$Res> { + __$$ServerErrorImplCopyWithImpl( + _$ServerErrorImpl _value, + $Res Function(_$ServerErrorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? failure = null}) { + return _then( + _$ServerErrorImpl( + null == failure + ? _value.failure + : failure // ignore: cast_nullable_to_non_nullable + as ApiFailure, + ), + ); + } + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ApiFailureCopyWith<$Res> get failure { + return $ApiFailureCopyWith<$Res>(_value.failure, (value) { + return _then(_value.copyWith(failure: value)); + }); + } +} + +/// @nodoc + +class _$ServerErrorImpl implements _ServerError { + const _$ServerErrorImpl(this.failure); + + @override + final ApiFailure failure; + + @override + String toString() { + return 'OutletFailure.serverError(failure: $failure)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ServerErrorImpl && + (identical(other.failure, failure) || other.failure == failure)); + } + + @override + int get hashCode => Object.hash(runtimeType, failure); + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith => + __$$ServerErrorImplCopyWithImpl<_$ServerErrorImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ApiFailure failure) serverError, + required TResult Function() unexpectedError, + required TResult Function() empty, + required TResult Function(String erroMessage) dynamicErrorMessage, + }) { + return serverError(failure); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ApiFailure failure)? serverError, + TResult? Function()? unexpectedError, + TResult? Function()? empty, + TResult? Function(String erroMessage)? dynamicErrorMessage, + }) { + return serverError?.call(failure); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ApiFailure failure)? serverError, + TResult Function()? unexpectedError, + TResult Function()? empty, + TResult Function(String erroMessage)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (serverError != null) { + return serverError(failure); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_Empty value) empty, + required TResult Function(_DynamicErrorMessage value) dynamicErrorMessage, + }) { + return serverError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_Empty value)? empty, + TResult? Function(_DynamicErrorMessage value)? dynamicErrorMessage, + }) { + return serverError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_Empty value)? empty, + TResult Function(_DynamicErrorMessage value)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (serverError != null) { + return serverError(this); + } + return orElse(); + } +} + +abstract class _ServerError implements OutletFailure { + const factory _ServerError(final ApiFailure failure) = _$ServerErrorImpl; + + ApiFailure get failure; + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$UnexpectedErrorImplCopyWith<$Res> { + factory _$$UnexpectedErrorImplCopyWith( + _$UnexpectedErrorImpl value, + $Res Function(_$UnexpectedErrorImpl) then, + ) = __$$UnexpectedErrorImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$UnexpectedErrorImplCopyWithImpl<$Res> + extends _$OutletFailureCopyWithImpl<$Res, _$UnexpectedErrorImpl> + implements _$$UnexpectedErrorImplCopyWith<$Res> { + __$$UnexpectedErrorImplCopyWithImpl( + _$UnexpectedErrorImpl _value, + $Res Function(_$UnexpectedErrorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$UnexpectedErrorImpl implements _UnexpectedError { + const _$UnexpectedErrorImpl(); + + @override + String toString() { + return 'OutletFailure.unexpectedError()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$UnexpectedErrorImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ApiFailure failure) serverError, + required TResult Function() unexpectedError, + required TResult Function() empty, + required TResult Function(String erroMessage) dynamicErrorMessage, + }) { + return unexpectedError(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ApiFailure failure)? serverError, + TResult? Function()? unexpectedError, + TResult? Function()? empty, + TResult? Function(String erroMessage)? dynamicErrorMessage, + }) { + return unexpectedError?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ApiFailure failure)? serverError, + TResult Function()? unexpectedError, + TResult Function()? empty, + TResult Function(String erroMessage)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (unexpectedError != null) { + return unexpectedError(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_Empty value) empty, + required TResult Function(_DynamicErrorMessage value) dynamicErrorMessage, + }) { + return unexpectedError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_Empty value)? empty, + TResult? Function(_DynamicErrorMessage value)? dynamicErrorMessage, + }) { + return unexpectedError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_Empty value)? empty, + TResult Function(_DynamicErrorMessage value)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (unexpectedError != null) { + return unexpectedError(this); + } + return orElse(); + } +} + +abstract class _UnexpectedError implements OutletFailure { + const factory _UnexpectedError() = _$UnexpectedErrorImpl; +} + +/// @nodoc +abstract class _$$EmptyImplCopyWith<$Res> { + factory _$$EmptyImplCopyWith( + _$EmptyImpl value, + $Res Function(_$EmptyImpl) then, + ) = __$$EmptyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$EmptyImplCopyWithImpl<$Res> + extends _$OutletFailureCopyWithImpl<$Res, _$EmptyImpl> + implements _$$EmptyImplCopyWith<$Res> { + __$$EmptyImplCopyWithImpl( + _$EmptyImpl _value, + $Res Function(_$EmptyImpl) _then, + ) : super(_value, _then); + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$EmptyImpl implements _Empty { + const _$EmptyImpl(); + + @override + String toString() { + return 'OutletFailure.empty()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$EmptyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ApiFailure failure) serverError, + required TResult Function() unexpectedError, + required TResult Function() empty, + required TResult Function(String erroMessage) dynamicErrorMessage, + }) { + return empty(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ApiFailure failure)? serverError, + TResult? Function()? unexpectedError, + TResult? Function()? empty, + TResult? Function(String erroMessage)? dynamicErrorMessage, + }) { + return empty?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ApiFailure failure)? serverError, + TResult Function()? unexpectedError, + TResult Function()? empty, + TResult Function(String erroMessage)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (empty != null) { + return empty(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_Empty value) empty, + required TResult Function(_DynamicErrorMessage value) dynamicErrorMessage, + }) { + return empty(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_Empty value)? empty, + TResult? Function(_DynamicErrorMessage value)? dynamicErrorMessage, + }) { + return empty?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_Empty value)? empty, + TResult Function(_DynamicErrorMessage value)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (empty != null) { + return empty(this); + } + return orElse(); + } +} + +abstract class _Empty implements OutletFailure { + const factory _Empty() = _$EmptyImpl; +} + +/// @nodoc +abstract class _$$DynamicErrorMessageImplCopyWith<$Res> { + factory _$$DynamicErrorMessageImplCopyWith( + _$DynamicErrorMessageImpl value, + $Res Function(_$DynamicErrorMessageImpl) then, + ) = __$$DynamicErrorMessageImplCopyWithImpl<$Res>; + @useResult + $Res call({String erroMessage}); +} + +/// @nodoc +class __$$DynamicErrorMessageImplCopyWithImpl<$Res> + extends _$OutletFailureCopyWithImpl<$Res, _$DynamicErrorMessageImpl> + implements _$$DynamicErrorMessageImplCopyWith<$Res> { + __$$DynamicErrorMessageImplCopyWithImpl( + _$DynamicErrorMessageImpl _value, + $Res Function(_$DynamicErrorMessageImpl) _then, + ) : super(_value, _then); + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? erroMessage = null}) { + return _then( + _$DynamicErrorMessageImpl( + null == erroMessage + ? _value.erroMessage + : erroMessage // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } +} + +/// @nodoc + +class _$DynamicErrorMessageImpl implements _DynamicErrorMessage { + const _$DynamicErrorMessageImpl(this.erroMessage); + + @override + final String erroMessage; + + @override + String toString() { + return 'OutletFailure.dynamicErrorMessage(erroMessage: $erroMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DynamicErrorMessageImpl && + (identical(other.erroMessage, erroMessage) || + other.erroMessage == erroMessage)); + } + + @override + int get hashCode => Object.hash(runtimeType, erroMessage); + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$DynamicErrorMessageImplCopyWith<_$DynamicErrorMessageImpl> get copyWith => + __$$DynamicErrorMessageImplCopyWithImpl<_$DynamicErrorMessageImpl>( + this, + _$identity, + ); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(ApiFailure failure) serverError, + required TResult Function() unexpectedError, + required TResult Function() empty, + required TResult Function(String erroMessage) dynamicErrorMessage, + }) { + return dynamicErrorMessage(erroMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ApiFailure failure)? serverError, + TResult? Function()? unexpectedError, + TResult? Function()? empty, + TResult? Function(String erroMessage)? dynamicErrorMessage, + }) { + return dynamicErrorMessage?.call(erroMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ApiFailure failure)? serverError, + TResult Function()? unexpectedError, + TResult Function()? empty, + TResult Function(String erroMessage)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (dynamicErrorMessage != null) { + return dynamicErrorMessage(erroMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_Empty value) empty, + required TResult Function(_DynamicErrorMessage value) dynamicErrorMessage, + }) { + return dynamicErrorMessage(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_Empty value)? empty, + TResult? Function(_DynamicErrorMessage value)? dynamicErrorMessage, + }) { + return dynamicErrorMessage?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_Empty value)? empty, + TResult Function(_DynamicErrorMessage value)? dynamicErrorMessage, + required TResult orElse(), + }) { + if (dynamicErrorMessage != null) { + return dynamicErrorMessage(this); + } + return orElse(); + } +} + +abstract class _DynamicErrorMessage implements OutletFailure { + const factory _DynamicErrorMessage(final String erroMessage) = + _$DynamicErrorMessageImpl; + + String get erroMessage; + + /// Create a copy of OutletFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$DynamicErrorMessageImplCopyWith<_$DynamicErrorMessageImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/domain/outlet/repositories/i_outlet_repository.dart b/lib/domain/outlet/repositories/i_outlet_repository.dart new file mode 100644 index 0000000..9514707 --- /dev/null +++ b/lib/domain/outlet/repositories/i_outlet_repository.dart @@ -0,0 +1,5 @@ +part of '../outlet.dart'; + +abstract class IOutletRepository { + Future> currentOutlet(); +} diff --git a/lib/infrastructure/outlet/datasource/remote_data_provider.dart b/lib/infrastructure/outlet/datasource/remote_data_provider.dart new file mode 100644 index 0000000..622c548 --- /dev/null +++ b/lib/infrastructure/outlet/datasource/remote_data_provider.dart @@ -0,0 +1,39 @@ +import 'dart:developer'; + +import 'package:data_channel/data_channel.dart'; +import 'package:injectable/injectable.dart'; + +import '../../../common/api/api_client.dart'; +import '../../../common/api/api_failure.dart'; +import '../../../common/function/app_function.dart'; +import '../../../common/url/api_path.dart'; +import '../../../domain/outlet/outlet.dart'; +import '../outlet_dtos.dart'; + +@injectable +class OutletRemoteDataProvider { + final ApiClient _apiClient; + final String _logName = 'OutletRemoteDataProvider'; + + OutletRemoteDataProvider(this._apiClient); + + Future> fetchById({required outletId}) async { + try { + final response = await _apiClient.get( + '${ApiPath.outlet}/detail/$outletId', + headers: getAuthorizationHeader(), + ); + + if (response.data['data'] == null) { + return DC.error(OutletFailure.empty()); + } + + final dto = OutletDto.fromJson(response.data['data']); + + return DC.data(dto); + } on ApiFailure catch (e, s) { + log('fetchOutletByIdError', name: _logName, error: e, stackTrace: s); + return DC.error(OutletFailure.serverError(e)); + } + } +} diff --git a/lib/infrastructure/outlet/dto/outlet_dto.dart b/lib/infrastructure/outlet/dto/outlet_dto.dart new file mode 100644 index 0000000..2e46eeb --- /dev/null +++ b/lib/infrastructure/outlet/dto/outlet_dto.dart @@ -0,0 +1,44 @@ +part of '../outlet_dtos.dart'; + +@freezed +class OutletDto with _$OutletDto { + const OutletDto._(); + + const factory OutletDto({ + @JsonKey(name: 'id') String? id, + @JsonKey(name: 'organization_id') String? organizationId, + @JsonKey(name: 'name') String? name, + @JsonKey(name: 'address') String? address, + @JsonKey(name: 'phone_number') String? phoneNumber, + @JsonKey(name: 'business_type') String? businessType, + @JsonKey(name: 'currency') String? currency, + @JsonKey(name: 'tax_rate') int? taxRate, + @JsonKey(name: 'is_active') bool? isActive, + @JsonKey(name: 'created_at') String? createdAt, + @JsonKey(name: 'updated_at') String? updatedAt, + }) = _OutletDto; + + factory OutletDto.fromJson(Map json) => + _$OutletDtoFromJson(json); + + /// Mapper ke domain + Outlet toDomain() { + return Outlet( + id: id ?? '', + organizationId: organizationId ?? '', + name: name ?? '', + address: address ?? '', + phoneNumber: phoneNumber ?? '', + businessType: businessType ?? '', + currency: currency ?? '', + taxRate: taxRate ?? 0, + isActive: isActive ?? false, + createdAt: createdAt != null + ? DateTime.tryParse(createdAt!) ?? DateTime(1970) + : DateTime(1970), + updatedAt: updatedAt != null + ? DateTime.tryParse(updatedAt!) ?? DateTime(1970) + : DateTime(1970), + ); + } +} diff --git a/lib/infrastructure/outlet/outlet_dtos.dart b/lib/infrastructure/outlet/outlet_dtos.dart new file mode 100644 index 0000000..b028073 --- /dev/null +++ b/lib/infrastructure/outlet/outlet_dtos.dart @@ -0,0 +1,8 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +import '../../domain/outlet/outlet.dart'; + +part 'outlet_dtos.freezed.dart'; +part 'outlet_dtos.g.dart'; + +part 'dto/outlet_dto.dart'; diff --git a/lib/infrastructure/outlet/outlet_dtos.freezed.dart b/lib/infrastructure/outlet/outlet_dtos.freezed.dart new file mode 100644 index 0000000..97b4392 --- /dev/null +++ b/lib/infrastructure/outlet/outlet_dtos.freezed.dart @@ -0,0 +1,431 @@ +// 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 'outlet_dtos.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(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', +); + +OutletDto _$OutletDtoFromJson(Map json) { + return _OutletDto.fromJson(json); +} + +/// @nodoc +mixin _$OutletDto { + @JsonKey(name: 'id') + String? get id => throw _privateConstructorUsedError; + @JsonKey(name: 'organization_id') + String? get organizationId => throw _privateConstructorUsedError; + @JsonKey(name: 'name') + String? get name => throw _privateConstructorUsedError; + @JsonKey(name: 'address') + String? get address => throw _privateConstructorUsedError; + @JsonKey(name: 'phone_number') + String? get phoneNumber => throw _privateConstructorUsedError; + @JsonKey(name: 'business_type') + String? get businessType => throw _privateConstructorUsedError; + @JsonKey(name: 'currency') + String? get currency => throw _privateConstructorUsedError; + @JsonKey(name: 'tax_rate') + int? get taxRate => throw _privateConstructorUsedError; + @JsonKey(name: 'is_active') + bool? get isActive => throw _privateConstructorUsedError; + @JsonKey(name: 'created_at') + String? get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: 'updated_at') + String? get updatedAt => throw _privateConstructorUsedError; + + /// Serializes this OutletDto to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of OutletDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $OutletDtoCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $OutletDtoCopyWith<$Res> { + factory $OutletDtoCopyWith(OutletDto value, $Res Function(OutletDto) then) = + _$OutletDtoCopyWithImpl<$Res, OutletDto>; + @useResult + $Res call({ + @JsonKey(name: 'id') String? id, + @JsonKey(name: 'organization_id') String? organizationId, + @JsonKey(name: 'name') String? name, + @JsonKey(name: 'address') String? address, + @JsonKey(name: 'phone_number') String? phoneNumber, + @JsonKey(name: 'business_type') String? businessType, + @JsonKey(name: 'currency') String? currency, + @JsonKey(name: 'tax_rate') int? taxRate, + @JsonKey(name: 'is_active') bool? isActive, + @JsonKey(name: 'created_at') String? createdAt, + @JsonKey(name: 'updated_at') String? updatedAt, + }); +} + +/// @nodoc +class _$OutletDtoCopyWithImpl<$Res, $Val extends OutletDto> + implements $OutletDtoCopyWith<$Res> { + _$OutletDtoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of OutletDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = freezed, + Object? organizationId = freezed, + Object? name = freezed, + Object? address = freezed, + Object? phoneNumber = freezed, + Object? businessType = freezed, + Object? currency = freezed, + Object? taxRate = freezed, + Object? isActive = freezed, + Object? createdAt = freezed, + Object? updatedAt = freezed, + }) { + return _then( + _value.copyWith( + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String?, + organizationId: freezed == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String?, + name: freezed == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String?, + address: freezed == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String?, + phoneNumber: freezed == phoneNumber + ? _value.phoneNumber + : phoneNumber // ignore: cast_nullable_to_non_nullable + as String?, + businessType: freezed == businessType + ? _value.businessType + : businessType // ignore: cast_nullable_to_non_nullable + as String?, + currency: freezed == currency + ? _value.currency + : currency // ignore: cast_nullable_to_non_nullable + as String?, + taxRate: freezed == taxRate + ? _value.taxRate + : taxRate // ignore: cast_nullable_to_non_nullable + as int?, + isActive: freezed == isActive + ? _value.isActive + : isActive // ignore: cast_nullable_to_non_nullable + as bool?, + createdAt: freezed == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String?, + updatedAt: freezed == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$OutletDtoImplCopyWith<$Res> + implements $OutletDtoCopyWith<$Res> { + factory _$$OutletDtoImplCopyWith( + _$OutletDtoImpl value, + $Res Function(_$OutletDtoImpl) then, + ) = __$$OutletDtoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + @JsonKey(name: 'id') String? id, + @JsonKey(name: 'organization_id') String? organizationId, + @JsonKey(name: 'name') String? name, + @JsonKey(name: 'address') String? address, + @JsonKey(name: 'phone_number') String? phoneNumber, + @JsonKey(name: 'business_type') String? businessType, + @JsonKey(name: 'currency') String? currency, + @JsonKey(name: 'tax_rate') int? taxRate, + @JsonKey(name: 'is_active') bool? isActive, + @JsonKey(name: 'created_at') String? createdAt, + @JsonKey(name: 'updated_at') String? updatedAt, + }); +} + +/// @nodoc +class __$$OutletDtoImplCopyWithImpl<$Res> + extends _$OutletDtoCopyWithImpl<$Res, _$OutletDtoImpl> + implements _$$OutletDtoImplCopyWith<$Res> { + __$$OutletDtoImplCopyWithImpl( + _$OutletDtoImpl _value, + $Res Function(_$OutletDtoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of OutletDto + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = freezed, + Object? organizationId = freezed, + Object? name = freezed, + Object? address = freezed, + Object? phoneNumber = freezed, + Object? businessType = freezed, + Object? currency = freezed, + Object? taxRate = freezed, + Object? isActive = freezed, + Object? createdAt = freezed, + Object? updatedAt = freezed, + }) { + return _then( + _$OutletDtoImpl( + id: freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String?, + organizationId: freezed == organizationId + ? _value.organizationId + : organizationId // ignore: cast_nullable_to_non_nullable + as String?, + name: freezed == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String?, + address: freezed == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String?, + phoneNumber: freezed == phoneNumber + ? _value.phoneNumber + : phoneNumber // ignore: cast_nullable_to_non_nullable + as String?, + businessType: freezed == businessType + ? _value.businessType + : businessType // ignore: cast_nullable_to_non_nullable + as String?, + currency: freezed == currency + ? _value.currency + : currency // ignore: cast_nullable_to_non_nullable + as String?, + taxRate: freezed == taxRate + ? _value.taxRate + : taxRate // ignore: cast_nullable_to_non_nullable + as int?, + isActive: freezed == isActive + ? _value.isActive + : isActive // ignore: cast_nullable_to_non_nullable + as bool?, + createdAt: freezed == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String?, + updatedAt: freezed == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$OutletDtoImpl extends _OutletDto { + const _$OutletDtoImpl({ + @JsonKey(name: 'id') this.id, + @JsonKey(name: 'organization_id') this.organizationId, + @JsonKey(name: 'name') this.name, + @JsonKey(name: 'address') this.address, + @JsonKey(name: 'phone_number') this.phoneNumber, + @JsonKey(name: 'business_type') this.businessType, + @JsonKey(name: 'currency') this.currency, + @JsonKey(name: 'tax_rate') this.taxRate, + @JsonKey(name: 'is_active') this.isActive, + @JsonKey(name: 'created_at') this.createdAt, + @JsonKey(name: 'updated_at') this.updatedAt, + }) : super._(); + + factory _$OutletDtoImpl.fromJson(Map json) => + _$$OutletDtoImplFromJson(json); + + @override + @JsonKey(name: 'id') + final String? id; + @override + @JsonKey(name: 'organization_id') + final String? organizationId; + @override + @JsonKey(name: 'name') + final String? name; + @override + @JsonKey(name: 'address') + final String? address; + @override + @JsonKey(name: 'phone_number') + final String? phoneNumber; + @override + @JsonKey(name: 'business_type') + final String? businessType; + @override + @JsonKey(name: 'currency') + final String? currency; + @override + @JsonKey(name: 'tax_rate') + final int? taxRate; + @override + @JsonKey(name: 'is_active') + final bool? isActive; + @override + @JsonKey(name: 'created_at') + final String? createdAt; + @override + @JsonKey(name: 'updated_at') + final String? updatedAt; + + @override + String toString() { + return 'OutletDto(id: $id, organizationId: $organizationId, name: $name, address: $address, phoneNumber: $phoneNumber, businessType: $businessType, currency: $currency, taxRate: $taxRate, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$OutletDtoImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.organizationId, organizationId) || + other.organizationId == organizationId) && + (identical(other.name, name) || other.name == name) && + (identical(other.address, address) || other.address == address) && + (identical(other.phoneNumber, phoneNumber) || + other.phoneNumber == phoneNumber) && + (identical(other.businessType, businessType) || + other.businessType == businessType) && + (identical(other.currency, currency) || + other.currency == currency) && + (identical(other.taxRate, taxRate) || other.taxRate == taxRate) && + (identical(other.isActive, isActive) || + other.isActive == isActive) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + organizationId, + name, + address, + phoneNumber, + businessType, + currency, + taxRate, + isActive, + createdAt, + updatedAt, + ); + + /// Create a copy of OutletDto + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$OutletDtoImplCopyWith<_$OutletDtoImpl> get copyWith => + __$$OutletDtoImplCopyWithImpl<_$OutletDtoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$OutletDtoImplToJson(this); + } +} + +abstract class _OutletDto extends OutletDto { + const factory _OutletDto({ + @JsonKey(name: 'id') final String? id, + @JsonKey(name: 'organization_id') final String? organizationId, + @JsonKey(name: 'name') final String? name, + @JsonKey(name: 'address') final String? address, + @JsonKey(name: 'phone_number') final String? phoneNumber, + @JsonKey(name: 'business_type') final String? businessType, + @JsonKey(name: 'currency') final String? currency, + @JsonKey(name: 'tax_rate') final int? taxRate, + @JsonKey(name: 'is_active') final bool? isActive, + @JsonKey(name: 'created_at') final String? createdAt, + @JsonKey(name: 'updated_at') final String? updatedAt, + }) = _$OutletDtoImpl; + const _OutletDto._() : super._(); + + factory _OutletDto.fromJson(Map json) = + _$OutletDtoImpl.fromJson; + + @override + @JsonKey(name: 'id') + String? get id; + @override + @JsonKey(name: 'organization_id') + String? get organizationId; + @override + @JsonKey(name: 'name') + String? get name; + @override + @JsonKey(name: 'address') + String? get address; + @override + @JsonKey(name: 'phone_number') + String? get phoneNumber; + @override + @JsonKey(name: 'business_type') + String? get businessType; + @override + @JsonKey(name: 'currency') + String? get currency; + @override + @JsonKey(name: 'tax_rate') + int? get taxRate; + @override + @JsonKey(name: 'is_active') + bool? get isActive; + @override + @JsonKey(name: 'created_at') + String? get createdAt; + @override + @JsonKey(name: 'updated_at') + String? get updatedAt; + + /// Create a copy of OutletDto + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$OutletDtoImplCopyWith<_$OutletDtoImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/infrastructure/outlet/outlet_dtos.g.dart b/lib/infrastructure/outlet/outlet_dtos.g.dart new file mode 100644 index 0000000..0c125d3 --- /dev/null +++ b/lib/infrastructure/outlet/outlet_dtos.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'outlet_dtos.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$OutletDtoImpl _$$OutletDtoImplFromJson(Map json) => + _$OutletDtoImpl( + id: json['id'] as String?, + organizationId: json['organization_id'] as String?, + name: json['name'] as String?, + address: json['address'] as String?, + phoneNumber: json['phone_number'] as String?, + businessType: json['business_type'] as String?, + currency: json['currency'] as String?, + taxRate: (json['tax_rate'] as num?)?.toInt(), + isActive: json['is_active'] as bool?, + createdAt: json['created_at'] as String?, + updatedAt: json['updated_at'] as String?, + ); + +Map _$$OutletDtoImplToJson(_$OutletDtoImpl instance) => + { + 'id': instance.id, + 'organization_id': instance.organizationId, + 'name': instance.name, + 'address': instance.address, + 'phone_number': instance.phoneNumber, + 'business_type': instance.businessType, + 'currency': instance.currency, + 'tax_rate': instance.taxRate, + 'is_active': instance.isActive, + 'created_at': instance.createdAt, + 'updated_at': instance.updatedAt, + }; diff --git a/lib/infrastructure/outlet/repositories/outlet_repository.dart b/lib/infrastructure/outlet/repositories/outlet_repository.dart new file mode 100644 index 0000000..a3cc1a1 --- /dev/null +++ b/lib/infrastructure/outlet/repositories/outlet_repository.dart @@ -0,0 +1,36 @@ +import 'dart:developer'; + +import 'package:dartz/dartz.dart'; +import 'package:injectable/injectable.dart'; + +import '../../../domain/outlet/outlet.dart'; +import '../../auth/datasources/local_data_provider.dart'; +import '../datasource/remote_data_provider.dart'; + +@Injectable(as: IOutletRepository) +class OutletRepository implements IOutletRepository { + final OutletRemoteDataProvider _dataProvider; + final AuthLocalDataProvider _authLocalDataProvider; + final String _logName = 'OutletRepository'; + + OutletRepository(this._dataProvider, this._authLocalDataProvider); + + @override + Future> currentOutlet() async { + try { + final authData = await _authLocalDataProvider.currentUser(); + final result = await _dataProvider.fetchById(outletId: authData.outletId); + + if (result.hasError) { + return left(result.error!); + } + + final auth = result.data!.toDomain(); + + return right(auth); + } catch (e, s) { + log('currentOutletError', name: _logName, error: e, stackTrace: s); + return left(const OutletFailure.unexpectedError()); + } + } +} diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 5864f04..4e24815 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -36,6 +36,8 @@ import 'package:apskel_owner_flutter/application/language/language_bloc.dart' as _i455; import 'package:apskel_owner_flutter/application/order/order_loader/order_loader_bloc.dart' as _i1058; +import 'package:apskel_owner_flutter/application/outlet/current_outlet_loader/current_outlet_loader_bloc.dart' + as _i337; import 'package:apskel_owner_flutter/application/product/product_loader/product_loader_bloc.dart' as _i458; import 'package:apskel_owner_flutter/common/api/api_client.dart' as _i115; @@ -53,6 +55,7 @@ import 'package:apskel_owner_flutter/domain/auth/auth.dart' as _i49; import 'package:apskel_owner_flutter/domain/category/category.dart' as _i1020; import 'package:apskel_owner_flutter/domain/customer/customer.dart' as _i48; import 'package:apskel_owner_flutter/domain/order/order.dart' as _i219; +import 'package:apskel_owner_flutter/domain/outlet/outlet.dart' as _i197; import 'package:apskel_owner_flutter/domain/product/product.dart' as _i419; import 'package:apskel_owner_flutter/env.dart' as _i6; import 'package:apskel_owner_flutter/infrastructure/analytic/datasource/remote_data_provider.dart' @@ -77,6 +80,10 @@ import 'package:apskel_owner_flutter/infrastructure/order/datasource/remote_data as _i130; import 'package:apskel_owner_flutter/infrastructure/order/repositories/order_repository.dart' as _i641; +import 'package:apskel_owner_flutter/infrastructure/outlet/datasource/remote_data_provider.dart' + as _i27; +import 'package:apskel_owner_flutter/infrastructure/outlet/repositories/outlet_repository.dart' + as _i13; import 'package:apskel_owner_flutter/infrastructure/product/datasources/remote_data_provider.dart' as _i823; import 'package:apskel_owner_flutter/infrastructure/product/repositories/product_repository.dart' @@ -148,6 +155,9 @@ extension GetItInjectableX on _i174.GetIt { gh.factory<_i1006.CustomerRemoteDataProvider>( () => _i1006.CustomerRemoteDataProvider(gh<_i115.ApiClient>()), ); + gh.factory<_i27.OutletRemoteDataProvider>( + () => _i27.OutletRemoteDataProvider(gh<_i115.ApiClient>()), + ); gh.factory<_i48.ICustomerRepository>( () => _i550.CustomerRepository(gh<_i1006.CustomerRemoteDataProvider>()), ); @@ -175,6 +185,12 @@ extension GetItInjectableX on _i174.GetIt { gh.factory<_i1020.ICategoryRepository>( () => _i869.CategoryRepository(gh<_i333.CategoryRemoteDataProvider>()), ); + gh.factory<_i197.IOutletRepository>( + () => _i13.OutletRepository( + gh<_i27.OutletRemoteDataProvider>(), + gh<_i991.AuthLocalDataProvider>(), + ), + ); gh.factory<_i458.ProductLoaderBloc>( () => _i458.ProductLoaderBloc(gh<_i419.IProductRepository>()), ); @@ -184,6 +200,9 @@ extension GetItInjectableX on _i174.GetIt { gh.factory<_i889.SalesLoaderBloc>( () => _i889.SalesLoaderBloc(gh<_i477.IAnalyticRepository>()), ); + gh.factory<_i337.CurrentOutletLoaderBloc>( + () => _i337.CurrentOutletLoaderBloc(gh<_i197.IOutletRepository>()), + ); gh.factory<_i221.ProductAnalyticLoaderBloc>( () => _i221.ProductAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()), ); diff --git a/lib/presentation/pages/outlet/outlet_information_page.dart b/lib/presentation/pages/outlet/outlet_information_page.dart new file mode 100644 index 0000000..49e122a --- /dev/null +++ b/lib/presentation/pages/outlet/outlet_information_page.dart @@ -0,0 +1,403 @@ +import 'package:flutter/material.dart'; +import 'package:auto_route/auto_route.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +import '../../../application/outlet/current_outlet_loader/current_outlet_loader_bloc.dart'; +import '../../../common/theme/theme.dart'; +import '../../../domain/outlet/outlet.dart'; +import '../../../injection.dart'; +import '../../components/appbar/appbar.dart'; + +// Outlet Information Page +@RoutePage() +class OutletInformationPage extends StatefulWidget implements AutoRouteWrapper { + const OutletInformationPage({super.key}); + + @override + State createState() => _OutletInformationPageState(); + + @override + Widget wrappedRoute(BuildContext context) => BlocProvider( + create: (_) => + getIt() + ..add(CurrentOutletLoaderEvent.fetched()), + child: this, + ); +} + +class _OutletInformationPageState extends State + with TickerProviderStateMixin { + late ScrollController _scrollController; + late AnimationController _fadeController; + late AnimationController _slideController; + late Animation _fadeAnimation; + late Animation _slideAnimation; + + @override + void initState() { + super.initState(); + _scrollController = ScrollController(); + _fadeController = AnimationController( + duration: const Duration(milliseconds: 800), + vsync: this, + ); + _slideController = AnimationController( + duration: const Duration(milliseconds: 600), + vsync: this, + ); + + _fadeAnimation = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation(parent: _fadeController, curve: Curves.easeInOut), + ); + + _slideAnimation = + Tween(begin: const Offset(0, 0.3), end: Offset.zero).animate( + CurvedAnimation(parent: _slideController, curve: Curves.easeOutBack), + ); + + // Start animations + _fadeController.forward(); + _slideController.forward(); + } + + @override + void dispose() { + _scrollController.dispose(); + _fadeController.dispose(); + _slideController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.background, + body: CustomScrollView( + controller: _scrollController, + slivers: [ + SliverAppBar( + expandedHeight: 120.0, + floating: false, + pinned: true, + flexibleSpace: CustomAppBar(title: 'Outlet Information'), + ), + SliverToBoxAdapter( + child: FadeTransition( + opacity: _fadeAnimation, + child: SlideTransition( + position: _slideAnimation, + child: _buildContent(), + ), + ), + ), + ], + ), + ); + } + + Widget _buildContent() { + return BlocBuilder( + builder: (context, state) { + return Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildHeaderCard(state.outlet), + const SizedBox(height: 20), + _buildInfoSection(state.outlet), + const SizedBox(height: 20), + _buildContactSection(state.outlet), + const SizedBox(height: 20), + _buildBusinessSection(state.outlet), + const SizedBox(height: 20), + _buildStatusSection(state.outlet), + const SizedBox(height: 20), + _buildTimestampSection(state.outlet), + ], + ), + ); + }, + ); + } + + Widget _buildHeaderCard(Outlet outlet) { + return TweenAnimationBuilder( + duration: const Duration(milliseconds: 800), + tween: Tween(begin: 0.0, end: 1.0), + builder: (context, value, child) { + return Transform.scale( + scale: 0.8 + (0.2 * value), + child: Container( + padding: const EdgeInsets.all(24), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: AppColor.primaryGradient, + ), + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: AppColor.primary.withOpacity(0.3), + blurRadius: 20, + offset: const Offset(0, 10), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: AppColor.white.withOpacity(0.2), + borderRadius: BorderRadius.circular(12), + ), + child: Icon(Icons.store, color: AppColor.white, size: 24), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + outlet.name, + style: AppStyle.h5.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 4), + Text( + outlet.businessType, + style: AppStyle.md.copyWith( + color: AppColor.white.withOpacity(0.9), + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ); + }, + ); + } + + Widget _buildInfoSection(Outlet outlet) { + return _buildAnimatedCard( + delay: 200, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSectionTitle('General Information', Icons.info_outline), + const SizedBox(height: 16), + _buildInfoRow('Outlet ID', outlet.id, Icons.fingerprint), + _buildInfoRow( + 'Organization ID', + outlet.organizationId, + Icons.business, + ), + _buildInfoRow('Address', outlet.address, Icons.location_on), + ], + ), + ); + } + + Widget _buildContactSection(Outlet outlet) { + return _buildAnimatedCard( + delay: 400, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSectionTitle('Contact Information', Icons.contact_phone), + const SizedBox(height: 16), + _buildInfoRow('Phone Number', outlet.phoneNumber, Icons.phone), + ], + ), + ); + } + + Widget _buildBusinessSection(Outlet outlet) { + return _buildAnimatedCard( + delay: 600, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSectionTitle('Business Settings', Icons.settings_applications), + const SizedBox(height: 16), + _buildInfoRow('Currency', outlet.currency, Icons.monetization_on), + _buildInfoRow('Tax Rate', '${outlet.taxRate}%', Icons.percent), + ], + ), + ); + } + + Widget _buildStatusSection(Outlet outlet) { + return _buildAnimatedCard( + delay: 800, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSectionTitle('Status', Icons.toggle_on), + const SizedBox(height: 16), + Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: BoxDecoration( + color: outlet.isActive + ? AppColor.success.withOpacity(0.1) + : AppColor.error.withOpacity(0.1), + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: outlet.isActive + ? AppColor.success.withOpacity(0.3) + : AppColor.error.withOpacity(0.3), + ), + ), + child: Row( + children: [ + Container( + width: 8, + height: 8, + decoration: BoxDecoration( + color: outlet.isActive ? AppColor.success : AppColor.error, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: 12), + Text( + outlet.isActive ? 'Active' : 'Inactive', + style: AppStyle.md.copyWith( + color: outlet.isActive ? AppColor.success : AppColor.error, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget _buildTimestampSection(Outlet outlet) { + return _buildAnimatedCard( + delay: 1000, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSectionTitle('Timestamps', Icons.schedule), + const SizedBox(height: 16), + _buildInfoRow( + 'Created At', + _formatDateTime(outlet.createdAt), + Icons.add_circle_outline, + ), + _buildInfoRow( + 'Updated At', + _formatDateTime(outlet.updatedAt), + Icons.update, + ), + ], + ), + ); + } + + Widget _buildAnimatedCard({required Widget child, required int delay}) { + return TweenAnimationBuilder( + duration: Duration(milliseconds: 600 + delay), + tween: Tween(begin: 0.0, end: 1.0), + builder: (context, value, _) { + return Transform.translate( + offset: Offset(0, 30 * (1 - value)), + child: Opacity( + opacity: value, + child: Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: AppColor.black.withOpacity(0.05), + blurRadius: 10, + offset: const Offset(0, 5), + ), + ], + ), + child: child, + ), + ), + ); + }, + ); + } + + Widget _buildSectionTitle(String title, IconData icon) { + return Row( + children: [ + Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: AppColor.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: Icon(icon, color: AppColor.primary, size: 20), + ), + const SizedBox(width: 12), + Text( + title, + style: AppStyle.lg.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.textPrimary, + ), + ), + ], + ); + } + + Widget _buildInfoRow(String label, String value, IconData icon) { + return Padding( + padding: const EdgeInsets.only(bottom: 16), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, color: AppColor.textSecondary, size: 20), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: AppStyle.sm.copyWith( + color: AppColor.textSecondary, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(height: 4), + Text( + value, + style: AppStyle.md.copyWith( + color: AppColor.textPrimary, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ], + ), + ); + } + + String _formatDateTime(DateTime dateTime) { + return '${dateTime.day}/${dateTime.month}/${dateTime.year} ${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}'; + } +} diff --git a/lib/presentation/pages/profile/widgets/business_setting.dart b/lib/presentation/pages/profile/widgets/business_setting.dart index 8ba3cc4..12383e8 100644 --- a/lib/presentation/pages/profile/widgets/business_setting.dart +++ b/lib/presentation/pages/profile/widgets/business_setting.dart @@ -43,9 +43,7 @@ class ProfileBusinessSetting extends StatelessWidget { icon: Icons.business_outlined, title: 'Outlet Information', subtitle: 'Manage your Outlet details', - onTap: () { - // Navigate to business info - }, + onTap: () => context.router.push(OutletInformationRoute()), ), ProfileDivider(), diff --git a/lib/presentation/router/app_router.dart b/lib/presentation/router/app_router.dart index f332f41..40c4015 100644 --- a/lib/presentation/router/app_router.dart +++ b/lib/presentation/router/app_router.dart @@ -55,5 +55,8 @@ class AppRouter extends RootStackRouter { // Order AutoRoute(page: OrderDetailRoute.page), + + // Outlet + AutoRoute(page: OutletInformationRoute.page), ]; } diff --git a/lib/presentation/router/app_router.gr.dart b/lib/presentation/router/app_router.gr.dart index 939877e..c1ab17b 100644 --- a/lib/presentation/router/app_router.gr.dart +++ b/lib/presentation/router/app_router.gr.dart @@ -9,7 +9,7 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:apskel_owner_flutter/domain/order/order.dart' as _i22; +import 'package:apskel_owner_flutter/domain/order/order.dart' as _i23; import 'package:apskel_owner_flutter/presentation/pages/auth/login/login_page.dart' as _i8; import 'package:apskel_owner_flutter/presentation/pages/customer/customer_page.dart' @@ -32,50 +32,52 @@ import 'package:apskel_owner_flutter/presentation/pages/order/order_detail/order as _i10; import 'package:apskel_owner_flutter/presentation/pages/order/order_list/order_page.dart' as _i11; -import 'package:apskel_owner_flutter/presentation/pages/product/product_analytic/product_analytic_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/outlet/outlet_information_page.dart' as _i12; -import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/product/product_analytic/product_analytic_page.dart' as _i13; -import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart' as _i14; -import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart' as _i15; -import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' as _i16; -import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' as _i17; -import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' as _i18; -import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' +import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' as _i19; -import 'package:auto_route/auto_route.dart' as _i20; -import 'package:flutter/material.dart' as _i21; +import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' + as _i20; +import 'package:auto_route/auto_route.dart' as _i21; +import 'package:flutter/material.dart' as _i22; /// generated route for /// [_i1.CustomerPage] -class CustomerRoute extends _i20.PageRouteInfo { - const CustomerRoute({List<_i20.PageRouteInfo>? children}) +class CustomerRoute extends _i21.PageRouteInfo { + const CustomerRoute({List<_i21.PageRouteInfo>? children}) : super(CustomerRoute.name, initialChildren: children); static const String name = 'CustomerRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i1.CustomerPage()); + return _i21.WrappedRoute(child: const _i1.CustomerPage()); }, ); } /// generated route for /// [_i2.DailyTasksFormPage] -class DailyTasksFormRoute extends _i20.PageRouteInfo { - const DailyTasksFormRoute({List<_i20.PageRouteInfo>? children}) +class DailyTasksFormRoute extends _i21.PageRouteInfo { + const DailyTasksFormRoute({List<_i21.PageRouteInfo>? children}) : super(DailyTasksFormRoute.name, initialChildren: children); static const String name = 'DailyTasksFormRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { return const _i2.DailyTasksFormPage(); @@ -85,16 +87,16 @@ class DailyTasksFormRoute extends _i20.PageRouteInfo { /// generated route for /// [_i3.ErrorPage] -class ErrorRoute extends _i20.PageRouteInfo { +class ErrorRoute extends _i21.PageRouteInfo { ErrorRoute({ - _i21.Key? key, + _i22.Key? key, String? title, String? message, - _i21.VoidCallback? onRetry, - _i21.VoidCallback? onBack, + _i22.VoidCallback? onRetry, + _i22.VoidCallback? onBack, String? errorCode, - _i21.IconData? errorIcon, - List<_i20.PageRouteInfo>? children, + _i22.IconData? errorIcon, + List<_i21.PageRouteInfo>? children, }) : super( ErrorRoute.name, args: ErrorRouteArgs( @@ -111,7 +113,7 @@ class ErrorRoute extends _i20.PageRouteInfo { static const String name = 'ErrorRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { final args = data.argsAs( @@ -141,19 +143,19 @@ class ErrorRouteArgs { this.errorIcon, }); - final _i21.Key? key; + final _i22.Key? key; final String? title; final String? message; - final _i21.VoidCallback? onRetry; + final _i22.VoidCallback? onRetry; - final _i21.VoidCallback? onBack; + final _i22.VoidCallback? onBack; final String? errorCode; - final _i21.IconData? errorIcon; + final _i22.IconData? errorIcon; @override String toString() { @@ -163,29 +165,29 @@ class ErrorRouteArgs { /// generated route for /// [_i4.FinancePage] -class FinanceRoute extends _i20.PageRouteInfo { - const FinanceRoute({List<_i20.PageRouteInfo>? children}) +class FinanceRoute extends _i21.PageRouteInfo { + const FinanceRoute({List<_i21.PageRouteInfo>? children}) : super(FinanceRoute.name, initialChildren: children); static const String name = 'FinanceRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i4.FinancePage()); + return _i21.WrappedRoute(child: const _i4.FinancePage()); }, ); } /// generated route for /// [_i5.HomePage] -class HomeRoute extends _i20.PageRouteInfo { - const HomeRoute({List<_i20.PageRouteInfo>? children}) +class HomeRoute extends _i21.PageRouteInfo { + const HomeRoute({List<_i21.PageRouteInfo>? children}) : super(HomeRoute.name, initialChildren: children); static const String name = 'HomeRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { return const _i5.HomePage(); @@ -195,29 +197,29 @@ class HomeRoute extends _i20.PageRouteInfo { /// generated route for /// [_i6.InventoryPage] -class InventoryRoute extends _i20.PageRouteInfo { - const InventoryRoute({List<_i20.PageRouteInfo>? children}) +class InventoryRoute extends _i21.PageRouteInfo { + const InventoryRoute({List<_i21.PageRouteInfo>? children}) : super(InventoryRoute.name, initialChildren: children); static const String name = 'InventoryRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i6.InventoryPage()); + return _i21.WrappedRoute(child: const _i6.InventoryPage()); }, ); } /// generated route for /// [_i7.LanguagePage] -class LanguageRoute extends _i20.PageRouteInfo { - const LanguageRoute({List<_i20.PageRouteInfo>? children}) +class LanguageRoute extends _i21.PageRouteInfo { + const LanguageRoute({List<_i21.PageRouteInfo>? children}) : super(LanguageRoute.name, initialChildren: children); static const String name = 'LanguageRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { return const _i7.LanguagePage(); @@ -227,29 +229,29 @@ class LanguageRoute extends _i20.PageRouteInfo { /// generated route for /// [_i8.LoginPage] -class LoginRoute extends _i20.PageRouteInfo { - const LoginRoute({List<_i20.PageRouteInfo>? children}) +class LoginRoute extends _i21.PageRouteInfo { + const LoginRoute({List<_i21.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i8.LoginPage()); + return _i21.WrappedRoute(child: const _i8.LoginPage()); }, ); } /// generated route for /// [_i9.MainPage] -class MainRoute extends _i20.PageRouteInfo { - const MainRoute({List<_i20.PageRouteInfo>? children}) +class MainRoute extends _i21.PageRouteInfo { + const MainRoute({List<_i21.PageRouteInfo>? children}) : super(MainRoute.name, initialChildren: children); static const String name = 'MainRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { return const _i9.MainPage(); @@ -259,11 +261,11 @@ class MainRoute extends _i20.PageRouteInfo { /// generated route for /// [_i10.OrderDetailPage] -class OrderDetailRoute extends _i20.PageRouteInfo { +class OrderDetailRoute extends _i21.PageRouteInfo { OrderDetailRoute({ - _i21.Key? key, - required _i22.Order order, - List<_i20.PageRouteInfo>? children, + _i22.Key? key, + required _i23.Order order, + List<_i21.PageRouteInfo>? children, }) : super( OrderDetailRoute.name, args: OrderDetailRouteArgs(key: key, order: order), @@ -272,7 +274,7 @@ class OrderDetailRoute extends _i20.PageRouteInfo { static const String name = 'OrderDetailRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -284,9 +286,9 @@ class OrderDetailRoute extends _i20.PageRouteInfo { class OrderDetailRouteArgs { const OrderDetailRouteArgs({this.key, required this.order}); - final _i21.Key? key; + final _i22.Key? key; - final _i22.Order order; + final _i23.Order order; @override String toString() { @@ -296,144 +298,160 @@ class OrderDetailRouteArgs { /// generated route for /// [_i11.OrderPage] -class OrderRoute extends _i20.PageRouteInfo { - const OrderRoute({List<_i20.PageRouteInfo>? children}) +class OrderRoute extends _i21.PageRouteInfo { + const OrderRoute({List<_i21.PageRouteInfo>? children}) : super(OrderRoute.name, initialChildren: children); static const String name = 'OrderRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i11.OrderPage()); + return _i21.WrappedRoute(child: const _i11.OrderPage()); }, ); } /// generated route for -/// [_i12.ProductAnalyticPage] -class ProductAnalyticRoute extends _i20.PageRouteInfo { - const ProductAnalyticRoute({List<_i20.PageRouteInfo>? children}) +/// [_i12.OutletInformationPage] +class OutletInformationRoute extends _i21.PageRouteInfo { + const OutletInformationRoute({List<_i21.PageRouteInfo>? children}) + : super(OutletInformationRoute.name, initialChildren: children); + + static const String name = 'OutletInformationRoute'; + + static _i21.PageInfo page = _i21.PageInfo( + name, + builder: (data) { + return _i21.WrappedRoute(child: const _i12.OutletInformationPage()); + }, + ); +} + +/// generated route for +/// [_i13.ProductAnalyticPage] +class ProductAnalyticRoute extends _i21.PageRouteInfo { + const ProductAnalyticRoute({List<_i21.PageRouteInfo>? children}) : super(ProductAnalyticRoute.name, initialChildren: children); static const String name = 'ProductAnalyticRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i12.ProductAnalyticPage()); + return _i21.WrappedRoute(child: const _i13.ProductAnalyticPage()); }, ); } /// generated route for -/// [_i13.ProductPage] -class ProductRoute extends _i20.PageRouteInfo { - const ProductRoute({List<_i20.PageRouteInfo>? children}) +/// [_i14.ProductPage] +class ProductRoute extends _i21.PageRouteInfo { + const ProductRoute({List<_i21.PageRouteInfo>? children}) : super(ProductRoute.name, initialChildren: children); static const String name = 'ProductRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i13.ProductPage()); + return _i21.WrappedRoute(child: const _i14.ProductPage()); }, ); } /// generated route for -/// [_i14.ProfilePage] -class ProfileRoute extends _i20.PageRouteInfo { - const ProfileRoute({List<_i20.PageRouteInfo>? children}) +/// [_i15.ProfilePage] +class ProfileRoute extends _i21.PageRouteInfo { + const ProfileRoute({List<_i21.PageRouteInfo>? children}) : super(ProfileRoute.name, initialChildren: children); static const String name = 'ProfileRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i14.ProfilePage()); + return _i21.WrappedRoute(child: const _i15.ProfilePage()); }, ); } /// generated route for -/// [_i15.PurchasePage] -class PurchaseRoute extends _i20.PageRouteInfo { - const PurchaseRoute({List<_i20.PageRouteInfo>? children}) +/// [_i16.PurchasePage] +class PurchaseRoute extends _i21.PageRouteInfo { + const PurchaseRoute({List<_i21.PageRouteInfo>? children}) : super(PurchaseRoute.name, initialChildren: children); static const String name = 'PurchaseRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return const _i15.PurchasePage(); + return const _i16.PurchasePage(); }, ); } /// generated route for -/// [_i16.ReportPage] -class ReportRoute extends _i20.PageRouteInfo { - const ReportRoute({List<_i20.PageRouteInfo>? children}) +/// [_i17.ReportPage] +class ReportRoute extends _i21.PageRouteInfo { + const ReportRoute({List<_i21.PageRouteInfo>? children}) : super(ReportRoute.name, initialChildren: children); static const String name = 'ReportRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i16.ReportPage()); + return _i21.WrappedRoute(child: const _i17.ReportPage()); }, ); } /// generated route for -/// [_i17.SalesPage] -class SalesRoute extends _i20.PageRouteInfo { - const SalesRoute({List<_i20.PageRouteInfo>? children}) +/// [_i18.SalesPage] +class SalesRoute extends _i21.PageRouteInfo { + const SalesRoute({List<_i21.PageRouteInfo>? children}) : super(SalesRoute.name, initialChildren: children); static const String name = 'SalesRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return _i20.WrappedRoute(child: const _i17.SalesPage()); + return _i21.WrappedRoute(child: const _i18.SalesPage()); }, ); } /// generated route for -/// [_i18.SchedulePage] -class ScheduleRoute extends _i20.PageRouteInfo { - const ScheduleRoute({List<_i20.PageRouteInfo>? children}) +/// [_i19.SchedulePage] +class ScheduleRoute extends _i21.PageRouteInfo { + const ScheduleRoute({List<_i21.PageRouteInfo>? children}) : super(ScheduleRoute.name, initialChildren: children); static const String name = 'ScheduleRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return const _i18.SchedulePage(); + return const _i19.SchedulePage(); }, ); } /// generated route for -/// [_i19.SplashPage] -class SplashRoute extends _i20.PageRouteInfo { - const SplashRoute({List<_i20.PageRouteInfo>? children}) +/// [_i20.SplashPage] +class SplashRoute extends _i21.PageRouteInfo { + const SplashRoute({List<_i21.PageRouteInfo>? children}) : super(SplashRoute.name, initialChildren: children); static const String name = 'SplashRoute'; - static _i20.PageInfo page = _i20.PageInfo( + static _i21.PageInfo page = _i21.PageInfo( name, builder: (data) { - return const _i19.SplashPage(); + return const _i20.SplashPage(); }, ); }