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:
co-authored by
Claude Opus 5.5
parent
5954510b93
commit
f5e3075205
@@ -0,0 +1,45 @@
|
||||
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 'pin_change_form_event.dart';
|
||||
part 'pin_change_form_state.dart';
|
||||
part 'pin_change_form_bloc.freezed.dart';
|
||||
|
||||
@injectable
|
||||
class PinChangeFormBloc extends Bloc<PinChangeFormEvent, PinChangeFormState> {
|
||||
final IPinRepository _repository;
|
||||
|
||||
PinChangeFormBloc(this._repository) : super(PinChangeFormState.initial()) {
|
||||
on<PinChangeFormEvent>(_onPinChangeFormEvent);
|
||||
}
|
||||
|
||||
Future<void> _onPinChangeFormEvent(
|
||||
PinChangeFormEvent event,
|
||||
Emitter<PinChangeFormState> emit,
|
||||
) {
|
||||
return event.map(
|
||||
submitted: (e) async {
|
||||
emit(
|
||||
state.copyWith(isSubmitting: true, failureOrSuccessOption: none()),
|
||||
);
|
||||
|
||||
final result = await _repository.change(
|
||||
oldPin: e.oldPin,
|
||||
pin: e.pin,
|
||||
confirmPin: e.confirmPin,
|
||||
);
|
||||
|
||||
emit(
|
||||
state.copyWith(
|
||||
isSubmitting: false,
|
||||
failureOrSuccessOption: optionOf(result),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,552 @@
|
||||
// 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 'pin_change_form_bloc.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$PinChangeFormEvent {
|
||||
|
||||
String get oldPin; String get pin; String get confirmPin;
|
||||
/// Create a copy of PinChangeFormEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$PinChangeFormEventCopyWith<PinChangeFormEvent> get copyWith => _$PinChangeFormEventCopyWithImpl<PinChangeFormEvent>(this as PinChangeFormEvent, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
final _this = this as PinChangeFormEvent;
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is PinChangeFormEvent&&(identical(other.oldPin, _this.oldPin) || other.oldPin == _this.oldPin)&&(identical(other.pin, _this.pin) || other.pin == _this.pin)&&(identical(other.confirmPin, _this.confirmPin) || other.confirmPin == _this.confirmPin));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final _this = this as PinChangeFormEvent;
|
||||
return Object.hash(runtimeType,_this.oldPin,_this.pin,_this.confirmPin);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
final _this = this as PinChangeFormEvent;
|
||||
return 'PinChangeFormEvent(oldPin: ${_this.oldPin}, pin: ${_this.pin}, confirmPin: ${_this.confirmPin})';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $PinChangeFormEventCopyWith<$Res> {
|
||||
factory $PinChangeFormEventCopyWith(PinChangeFormEvent value, $Res Function(PinChangeFormEvent) _then) = _$PinChangeFormEventCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String oldPin, String pin, String confirmPin
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$PinChangeFormEventCopyWithImpl<$Res>
|
||||
implements $PinChangeFormEventCopyWith<$Res> {
|
||||
_$PinChangeFormEventCopyWithImpl(this._self, this._then);
|
||||
|
||||
final PinChangeFormEvent _self;
|
||||
final $Res Function(PinChangeFormEvent) _then;
|
||||
|
||||
/// Create a copy of PinChangeFormEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? oldPin = null,Object? pin = null,Object? confirmPin = null,}) {
|
||||
return _then(PinChangeFormEvent.submitted(
|
||||
oldPin: null == oldPin ? _self.oldPin : oldPin // ignore: cast_nullable_to_non_nullable
|
||||
as String,pin: null == pin ? _self.pin : pin // ignore: cast_nullable_to_non_nullable
|
||||
as String,confirmPin: null == confirmPin ? _self.confirmPin : confirmPin // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [PinChangeFormEvent].
|
||||
extension PinChangeFormEventPatterns on PinChangeFormEvent {
|
||||
/// 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( _Submitted value)? submitted,required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Submitted() when submitted != null:
|
||||
return submitted(_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( _Submitted value) submitted,}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Submitted():
|
||||
return submitted(_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( _Submitted value)? submitted,}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Submitted() when submitted != null:
|
||||
return submitted(_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( String oldPin, String pin, String confirmPin)? submitted,required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Submitted() when submitted != null:
|
||||
return submitted(_that.oldPin,_that.pin,_that.confirmPin);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( String oldPin, String pin, String confirmPin) submitted,}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Submitted():
|
||||
return submitted(_that.oldPin,_that.pin,_that.confirmPin);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( String oldPin, String pin, String confirmPin)? submitted,}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Submitted() when submitted != null:
|
||||
return submitted(_that.oldPin,_that.pin,_that.confirmPin);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _Submitted implements PinChangeFormEvent {
|
||||
const _Submitted({required this.oldPin, required this.pin, required this.confirmPin});
|
||||
|
||||
|
||||
@override final String oldPin;
|
||||
@override final String pin;
|
||||
@override final String confirmPin;
|
||||
|
||||
/// Create a copy of PinChangeFormEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SubmittedCopyWith<_Submitted> get copyWith => __$SubmittedCopyWithImpl<_Submitted>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Submitted&&(identical(other.oldPin, oldPin) || other.oldPin == oldPin)&&(identical(other.pin, pin) || other.pin == pin)&&(identical(other.confirmPin, confirmPin) || other.confirmPin == confirmPin));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return Object.hash(runtimeType,oldPin,pin,confirmPin);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PinChangeFormEvent.submitted(oldPin: $oldPin, pin: $pin, confirmPin: $confirmPin)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SubmittedCopyWith<$Res> implements $PinChangeFormEventCopyWith<$Res> {
|
||||
factory _$SubmittedCopyWith(_Submitted value, $Res Function(_Submitted) _then) = __$SubmittedCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String oldPin, String pin, String confirmPin
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$SubmittedCopyWithImpl<$Res>
|
||||
implements _$SubmittedCopyWith<$Res> {
|
||||
__$SubmittedCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _Submitted _self;
|
||||
final $Res Function(_Submitted) _then;
|
||||
|
||||
/// Create a copy of PinChangeFormEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? oldPin = null,Object? pin = null,Object? confirmPin = null,}) {
|
||||
return _then(_Submitted(
|
||||
oldPin: null == oldPin ? _self.oldPin : oldPin // ignore: cast_nullable_to_non_nullable
|
||||
as String,pin: null == pin ? _self.pin : pin // ignore: cast_nullable_to_non_nullable
|
||||
as String,confirmPin: null == confirmPin ? _self.confirmPin : confirmPin // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$PinChangeFormState {
|
||||
|
||||
bool get isSubmitting; Option<Either<WalletFailure, Unit>> get failureOrSuccessOption;
|
||||
/// Create a copy of PinChangeFormState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$PinChangeFormStateCopyWith<PinChangeFormState> get copyWith => _$PinChangeFormStateCopyWithImpl<PinChangeFormState>(this as PinChangeFormState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
final _this = this as PinChangeFormState;
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is PinChangeFormState&&(identical(other.isSubmitting, _this.isSubmitting) || other.isSubmitting == _this.isSubmitting)&&(identical(other.failureOrSuccessOption, _this.failureOrSuccessOption) || other.failureOrSuccessOption == _this.failureOrSuccessOption));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final _this = this as PinChangeFormState;
|
||||
return Object.hash(runtimeType,_this.isSubmitting,_this.failureOrSuccessOption);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
final _this = this as PinChangeFormState;
|
||||
return 'PinChangeFormState(isSubmitting: ${_this.isSubmitting}, failureOrSuccessOption: ${_this.failureOrSuccessOption})';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $PinChangeFormStateCopyWith<$Res> {
|
||||
factory $PinChangeFormStateCopyWith(PinChangeFormState value, $Res Function(PinChangeFormState) _then) = _$PinChangeFormStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool isSubmitting, Option<Either<WalletFailure, Unit>> failureOrSuccessOption
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$PinChangeFormStateCopyWithImpl<$Res>
|
||||
implements $PinChangeFormStateCopyWith<$Res> {
|
||||
_$PinChangeFormStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final PinChangeFormState _self;
|
||||
final $Res Function(PinChangeFormState) _then;
|
||||
|
||||
/// Create a copy of PinChangeFormState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? isSubmitting = null,Object? failureOrSuccessOption = null,}) {
|
||||
return _then(PinChangeFormState(
|
||||
isSubmitting: null == isSubmitting ? _self.isSubmitting : isSubmitting // ignore: cast_nullable_to_non_nullable
|
||||
as bool,failureOrSuccessOption: null == failureOrSuccessOption ? _self.failureOrSuccessOption : failureOrSuccessOption // ignore: cast_nullable_to_non_nullable
|
||||
as Option<Either<WalletFailure, Unit>>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [PinChangeFormState].
|
||||
extension PinChangeFormStatePatterns on PinChangeFormState {
|
||||
/// 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( _PinChangeFormState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _PinChangeFormState() 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( _PinChangeFormState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _PinChangeFormState():
|
||||
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( _PinChangeFormState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _PinChangeFormState() 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( bool isSubmitting, Option<Either<WalletFailure, Unit>> failureOrSuccessOption)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _PinChangeFormState() when $default != null:
|
||||
return $default(_that.isSubmitting,_that.failureOrSuccessOption);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( bool isSubmitting, Option<Either<WalletFailure, Unit>> failureOrSuccessOption) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _PinChangeFormState():
|
||||
return $default(_that.isSubmitting,_that.failureOrSuccessOption);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( bool isSubmitting, Option<Either<WalletFailure, Unit>> failureOrSuccessOption)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _PinChangeFormState() when $default != null:
|
||||
return $default(_that.isSubmitting,_that.failureOrSuccessOption);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _PinChangeFormState implements PinChangeFormState {
|
||||
const _PinChangeFormState({this.isSubmitting = false, required this.failureOrSuccessOption});
|
||||
|
||||
|
||||
@override@JsonKey() final bool isSubmitting;
|
||||
@override final Option<Either<WalletFailure, Unit>> failureOrSuccessOption;
|
||||
|
||||
/// Create a copy of PinChangeFormState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$PinChangeFormStateCopyWith<_PinChangeFormState> get copyWith => __$PinChangeFormStateCopyWithImpl<_PinChangeFormState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _PinChangeFormState&&(identical(other.isSubmitting, isSubmitting) || other.isSubmitting == isSubmitting)&&(identical(other.failureOrSuccessOption, failureOrSuccessOption) || other.failureOrSuccessOption == failureOrSuccessOption));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return Object.hash(runtimeType,isSubmitting,failureOrSuccessOption);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PinChangeFormState(isSubmitting: $isSubmitting, failureOrSuccessOption: $failureOrSuccessOption)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$PinChangeFormStateCopyWith<$Res> implements $PinChangeFormStateCopyWith<$Res> {
|
||||
factory _$PinChangeFormStateCopyWith(_PinChangeFormState value, $Res Function(_PinChangeFormState) _then) = __$PinChangeFormStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool isSubmitting, Option<Either<WalletFailure, Unit>> failureOrSuccessOption
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$PinChangeFormStateCopyWithImpl<$Res>
|
||||
implements _$PinChangeFormStateCopyWith<$Res> {
|
||||
__$PinChangeFormStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _PinChangeFormState _self;
|
||||
final $Res Function(_PinChangeFormState) _then;
|
||||
|
||||
/// Create a copy of PinChangeFormState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? isSubmitting = null,Object? failureOrSuccessOption = null,}) {
|
||||
return _then(_PinChangeFormState(
|
||||
isSubmitting: null == isSubmitting ? _self.isSubmitting : isSubmitting // ignore: cast_nullable_to_non_nullable
|
||||
as bool,failureOrSuccessOption: null == failureOrSuccessOption ? _self.failureOrSuccessOption : failureOrSuccessOption // ignore: cast_nullable_to_non_nullable
|
||||
as Option<Either<WalletFailure, Unit>>,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,11 @@
|
||||
part of 'pin_change_form_bloc.dart';
|
||||
|
||||
@freezed
|
||||
abstract class PinChangeFormEvent with _$PinChangeFormEvent {
|
||||
/// PIN hanya diteruskan ke API, tidak disimpan di state.
|
||||
const factory PinChangeFormEvent.submitted({
|
||||
required String oldPin,
|
||||
required String pin,
|
||||
required String confirmPin,
|
||||
}) = _Submitted;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
part of 'pin_change_form_bloc.dart';
|
||||
|
||||
@freezed
|
||||
abstract class PinChangeFormState with _$PinChangeFormState {
|
||||
const factory PinChangeFormState({
|
||||
@Default(false) bool isSubmitting,
|
||||
required Option<Either<WalletFailure, Unit>> failureOrSuccessOption,
|
||||
}) = _PinChangeFormState;
|
||||
|
||||
factory PinChangeFormState.initial() =>
|
||||
PinChangeFormState(failureOrSuccessOption: none());
|
||||
}
|
||||
Reference in New Issue
Block a user