EnakPoint & EnakCoin wallet, PIN, outlet, order, community, reward

- Wallet EnakPoint & EnakCoin: beranda, riwayat, saldo kedaluwarsa, kode
  bayar, tukar EnakCoin, transfer
- PIN (buat, ganti, lupa), outlet, riwayat order, game spin
- Halaman community, webview, coming soon, dan ikon menu beranda baru
- Redesign Reward Saya: kartu tiket, filter chip, detail kode + QR
- Hapus customer point loader, menu, dan checkout lama
- Base URL ke enaklo-pos-api.altru.id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
efrilm
2026-10-01 01:43:22 +07:00
co-authored by Claude Opus 5.5
parent 5954510b93
commit f5e3075205
253 changed files with 47212 additions and 17437 deletions
@@ -0,0 +1,41 @@
import 'package:bloc/bloc.dart';
import 'package:dartz/dartz.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';
import '../../../domain/wallet/wallet.dart';
part 'wallet_expiring_loader_event.dart';
part 'wallet_expiring_loader_state.dart';
part 'wallet_expiring_loader_bloc.freezed.dart';
@injectable
class WalletExpiringLoaderBloc
extends Bloc<WalletExpiringLoaderEvent, WalletExpiringLoaderState> {
final IWalletRepository _repository;
WalletExpiringLoaderBloc(this._repository)
: super(WalletExpiringLoaderState.initial()) {
on<WalletExpiringLoaderEvent>(_onWalletExpiringLoaderEvent);
}
Future<void> _onWalletExpiringLoaderEvent(
WalletExpiringLoaderEvent event,
Emitter<WalletExpiringLoaderState> emit,
) {
return event.map(
fetched: (e) async {
emit(state.copyWith(isFetching: true, failureOption: none()));
final result = await _repository.getExpiring();
final data = result.fold(
(f) => state.copyWith(failureOption: optionOf(f)),
(expiring) => state.copyWith(expiring: expiring),
);
emit(data.copyWith(isFetching: false));
},
);
}
}
@@ -0,0 +1,495 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package
// 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 'wallet_expiring_loader_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$WalletExpiringLoaderEvent {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is WalletExpiringLoaderEvent);
}
@override
int get hashCode => runtimeType.hashCode;
@override
String toString() {
return 'WalletExpiringLoaderEvent()';
}
}
/// @nodoc
class $WalletExpiringLoaderEventCopyWith<$Res> {
$WalletExpiringLoaderEventCopyWith(WalletExpiringLoaderEvent _, $Res Function(WalletExpiringLoaderEvent) __);
}
/// Adds pattern-matching-related methods to [WalletExpiringLoaderEvent].
extension WalletExpiringLoaderEventPatterns on WalletExpiringLoaderEvent {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>({TResult Function( _Fetched value)? fetched,required TResult orElse(),}){
final _that = this;
switch (_that) {
case _Fetched() when fetched != null:
return fetched(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>({required TResult Function( _Fetched value) fetched,}){
final _that = this;
switch (_that) {
case _Fetched():
return fetched(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>({TResult? Function( _Fetched value)? fetched,}){
final _that = this;
switch (_that) {
case _Fetched() when fetched != null:
return fetched(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>({TResult Function()? fetched,required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Fetched() when fetched != null:
return fetched();case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>({required TResult Function() fetched,}) {final _that = this;
switch (_that) {
case _Fetched():
return fetched();case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>({TResult? Function()? fetched,}) {final _that = this;
switch (_that) {
case _Fetched() when fetched != null:
return fetched();case _:
return null;
}
}
}
/// @nodoc
class _Fetched implements WalletExpiringLoaderEvent {
const _Fetched();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Fetched);
}
@override
int get hashCode => runtimeType.hashCode;
@override
String toString() {
return 'WalletExpiringLoaderEvent.fetched()';
}
}
/// @nodoc
mixin _$WalletExpiringLoaderState {
WalletExpiring get expiring; Option<WalletFailure> get failureOption; bool get isFetching;
/// Create a copy of WalletExpiringLoaderState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$WalletExpiringLoaderStateCopyWith<WalletExpiringLoaderState> get copyWith => _$WalletExpiringLoaderStateCopyWithImpl<WalletExpiringLoaderState>(this as WalletExpiringLoaderState, _$identity);
@override
bool operator ==(Object other) {
final _this = this as WalletExpiringLoaderState;
return identical(this, other) || (other.runtimeType == runtimeType&&other is WalletExpiringLoaderState&&(identical(other.expiring, _this.expiring) || other.expiring == _this.expiring)&&(identical(other.failureOption, _this.failureOption) || other.failureOption == _this.failureOption)&&(identical(other.isFetching, _this.isFetching) || other.isFetching == _this.isFetching));
}
@override
int get hashCode {
final _this = this as WalletExpiringLoaderState;
return Object.hash(runtimeType,_this.expiring,_this.failureOption,_this.isFetching);
}
@override
String toString() {
final _this = this as WalletExpiringLoaderState;
return 'WalletExpiringLoaderState(expiring: ${_this.expiring}, failureOption: ${_this.failureOption}, isFetching: ${_this.isFetching})';
}
}
/// @nodoc
abstract mixin class $WalletExpiringLoaderStateCopyWith<$Res> {
factory $WalletExpiringLoaderStateCopyWith(WalletExpiringLoaderState value, $Res Function(WalletExpiringLoaderState) _then) = _$WalletExpiringLoaderStateCopyWithImpl;
@useResult
$Res call({
WalletExpiring expiring, Option<WalletFailure> failureOption, bool isFetching
});
$WalletExpiringCopyWith<$Res> get expiring;
}
/// @nodoc
class _$WalletExpiringLoaderStateCopyWithImpl<$Res>
implements $WalletExpiringLoaderStateCopyWith<$Res> {
_$WalletExpiringLoaderStateCopyWithImpl(this._self, this._then);
final WalletExpiringLoaderState _self;
final $Res Function(WalletExpiringLoaderState) _then;
/// Create a copy of WalletExpiringLoaderState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? expiring = null,Object? failureOption = null,Object? isFetching = null,}) {
return _then(WalletExpiringLoaderState(
expiring: null == expiring ? _self.expiring : expiring // ignore: cast_nullable_to_non_nullable
as WalletExpiring,failureOption: null == failureOption ? _self.failureOption : failureOption // ignore: cast_nullable_to_non_nullable
as Option<WalletFailure>,isFetching: null == isFetching ? _self.isFetching : isFetching // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of WalletExpiringLoaderState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$WalletExpiringCopyWith<$Res> get expiring {
return $WalletExpiringCopyWith<$Res>(_self.expiring, (value) {
return _then(_self.copyWith(expiring: value));
});
}
}
/// Adds pattern-matching-related methods to [WalletExpiringLoaderState].
extension WalletExpiringLoaderStatePatterns on WalletExpiringLoaderState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _WalletExpiringLoaderState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _WalletExpiringLoaderState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _WalletExpiringLoaderState value) $default,){
final _that = this;
switch (_that) {
case _WalletExpiringLoaderState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _WalletExpiringLoaderState value)? $default,){
final _that = this;
switch (_that) {
case _WalletExpiringLoaderState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( WalletExpiring expiring, Option<WalletFailure> failureOption, bool isFetching)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _WalletExpiringLoaderState() when $default != null:
return $default(_that.expiring,_that.failureOption,_that.isFetching);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( WalletExpiring expiring, Option<WalletFailure> failureOption, bool isFetching) $default,) {final _that = this;
switch (_that) {
case _WalletExpiringLoaderState():
return $default(_that.expiring,_that.failureOption,_that.isFetching);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( WalletExpiring expiring, Option<WalletFailure> failureOption, bool isFetching)? $default,) {final _that = this;
switch (_that) {
case _WalletExpiringLoaderState() when $default != null:
return $default(_that.expiring,_that.failureOption,_that.isFetching);case _:
return null;
}
}
}
/// @nodoc
class _WalletExpiringLoaderState implements WalletExpiringLoaderState {
const _WalletExpiringLoaderState({required this.expiring, required this.failureOption, this.isFetching = false});
@override final WalletExpiring expiring;
@override final Option<WalletFailure> failureOption;
@override@JsonKey() final bool isFetching;
/// Create a copy of WalletExpiringLoaderState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$WalletExpiringLoaderStateCopyWith<_WalletExpiringLoaderState> get copyWith => __$WalletExpiringLoaderStateCopyWithImpl<_WalletExpiringLoaderState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _WalletExpiringLoaderState&&(identical(other.expiring, expiring) || other.expiring == expiring)&&(identical(other.failureOption, failureOption) || other.failureOption == failureOption)&&(identical(other.isFetching, isFetching) || other.isFetching == isFetching));
}
@override
int get hashCode {
return Object.hash(runtimeType,expiring,failureOption,isFetching);
}
@override
String toString() {
return 'WalletExpiringLoaderState(expiring: $expiring, failureOption: $failureOption, isFetching: $isFetching)';
}
}
/// @nodoc
abstract mixin class _$WalletExpiringLoaderStateCopyWith<$Res> implements $WalletExpiringLoaderStateCopyWith<$Res> {
factory _$WalletExpiringLoaderStateCopyWith(_WalletExpiringLoaderState value, $Res Function(_WalletExpiringLoaderState) _then) = __$WalletExpiringLoaderStateCopyWithImpl;
@override @useResult
$Res call({
WalletExpiring expiring, Option<WalletFailure> failureOption, bool isFetching
});
@override $WalletExpiringCopyWith<$Res> get expiring;
}
/// @nodoc
class __$WalletExpiringLoaderStateCopyWithImpl<$Res>
implements _$WalletExpiringLoaderStateCopyWith<$Res> {
__$WalletExpiringLoaderStateCopyWithImpl(this._self, this._then);
final _WalletExpiringLoaderState _self;
final $Res Function(_WalletExpiringLoaderState) _then;
/// Create a copy of WalletExpiringLoaderState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? expiring = null,Object? failureOption = null,Object? isFetching = null,}) {
return _then(_WalletExpiringLoaderState(
expiring: null == expiring ? _self.expiring : expiring // ignore: cast_nullable_to_non_nullable
as WalletExpiring,failureOption: null == failureOption ? _self.failureOption : failureOption // ignore: cast_nullable_to_non_nullable
as Option<WalletFailure>,isFetching: null == isFetching ? _self.isFetching : isFetching // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of WalletExpiringLoaderState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$WalletExpiringCopyWith<$Res> get expiring {
return $WalletExpiringCopyWith<$Res>(_self.expiring, (value) {
return _then(_self.copyWith(expiring: value));
});
}
}
// dart format on
@@ -0,0 +1,6 @@
part of 'wallet_expiring_loader_bloc.dart';
@freezed
abstract class WalletExpiringLoaderEvent with _$WalletExpiringLoaderEvent {
const factory WalletExpiringLoaderEvent.fetched() = _Fetched;
}
@@ -0,0 +1,15 @@
part of 'wallet_expiring_loader_bloc.dart';
@freezed
abstract class WalletExpiringLoaderState with _$WalletExpiringLoaderState {
const factory WalletExpiringLoaderState({
required WalletExpiring expiring,
required Option<WalletFailure> failureOption,
@Default(false) bool isFetching,
}) = _WalletExpiringLoaderState;
factory WalletExpiringLoaderState.initial() => WalletExpiringLoaderState(
expiring: WalletExpiring.empty(),
failureOption: none(),
);
}