Skip to content

Commit

Permalink
fix necessary problems and remove unnecessary things
Browse files Browse the repository at this point in the history
  • Loading branch information
FlutterWiz committed Oct 26, 2022
1 parent 4a1950a commit 10b26e7
Show file tree
Hide file tree
Showing 18 changed files with 304 additions and 273 deletions.
2 changes: 1 addition & 1 deletion lib/application/auth/sign_in_form/sign_in_form_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// ignore: depend_on_referenced_packages
import 'package:bloc/bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_firebase_ddd_bloc/application/auth/sign_in_form/sign_in_form_state.dart';
import 'package:flutter_firebase_ddd_bloc/domain/auth/auth_failure.dart';
import 'package:flutter_firebase_ddd_bloc/domain/auth/i_auth_facade.dart';
import 'package:flutter_firebase_ddd_bloc/domain/auth/value_objects.dart';
Expand All @@ -10,6 +9,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';

part 'sign_in_form_event.dart';
part 'sign_in_form_state.dart';
part 'sign_in_form_bloc.freezed.dart';

@injectable
Expand Down
213 changes: 213 additions & 0 deletions lib/application/auth/sign_in_form/sign_in_form_bloc.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -810,3 +810,216 @@ abstract class SignInWithEmailAndPasswordPressed implements SignInFormEvent {
const factory SignInWithEmailAndPasswordPressed() =
_$SignInWithEmailAndPasswordPressed;
}

/// @nodoc
mixin _$SignInFormState {
EmailAddress get emailAddress => throw _privateConstructorUsedError;
Password get password => throw _privateConstructorUsedError;
bool get isSubmitting => throw _privateConstructorUsedError;
AutovalidateMode? get showErrorMessages => throw _privateConstructorUsedError;
Option<Either<AuthFailure, Unit>> get authFailureOrSuccessOption =>
throw _privateConstructorUsedError;

@JsonKey(ignore: true)
$SignInFormStateCopyWith<SignInFormState> get copyWith =>
throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $SignInFormStateCopyWith<$Res> {
factory $SignInFormStateCopyWith(
SignInFormState value, $Res Function(SignInFormState) then) =
_$SignInFormStateCopyWithImpl<$Res, SignInFormState>;
@useResult
$Res call(
{EmailAddress emailAddress,
Password password,
bool isSubmitting,
AutovalidateMode? showErrorMessages,
Option<Either<AuthFailure, Unit>> authFailureOrSuccessOption});
}

/// @nodoc
class _$SignInFormStateCopyWithImpl<$Res, $Val extends SignInFormState>
implements $SignInFormStateCopyWith<$Res> {
_$SignInFormStateCopyWithImpl(this._value, this._then);

// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;

@pragma('vm:prefer-inline')
@override
$Res call({
Object? emailAddress = null,
Object? password = null,
Object? isSubmitting = null,
Object? showErrorMessages = freezed,
Object? authFailureOrSuccessOption = null,
}) {
return _then(_value.copyWith(
emailAddress: null == emailAddress
? _value.emailAddress
: emailAddress // ignore: cast_nullable_to_non_nullable
as EmailAddress,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as Password,
isSubmitting: null == isSubmitting
? _value.isSubmitting
: isSubmitting // ignore: cast_nullable_to_non_nullable
as bool,
showErrorMessages: freezed == showErrorMessages
? _value.showErrorMessages
: showErrorMessages // ignore: cast_nullable_to_non_nullable
as AutovalidateMode?,
authFailureOrSuccessOption: null == authFailureOrSuccessOption
? _value.authFailureOrSuccessOption
: authFailureOrSuccessOption // ignore: cast_nullable_to_non_nullable
as Option<Either<AuthFailure, Unit>>,
) as $Val);
}
}

/// @nodoc
abstract class _$$_SignInFormStateCopyWith<$Res>
implements $SignInFormStateCopyWith<$Res> {
factory _$$_SignInFormStateCopyWith(
_$_SignInFormState value, $Res Function(_$_SignInFormState) then) =
__$$_SignInFormStateCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{EmailAddress emailAddress,
Password password,
bool isSubmitting,
AutovalidateMode? showErrorMessages,
Option<Either<AuthFailure, Unit>> authFailureOrSuccessOption});
}

/// @nodoc
class __$$_SignInFormStateCopyWithImpl<$Res>
extends _$SignInFormStateCopyWithImpl<$Res, _$_SignInFormState>
implements _$$_SignInFormStateCopyWith<$Res> {
__$$_SignInFormStateCopyWithImpl(
_$_SignInFormState _value, $Res Function(_$_SignInFormState) _then)
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? emailAddress = null,
Object? password = null,
Object? isSubmitting = null,
Object? showErrorMessages = freezed,
Object? authFailureOrSuccessOption = null,
}) {
return _then(_$_SignInFormState(
emailAddress: null == emailAddress
? _value.emailAddress
: emailAddress // ignore: cast_nullable_to_non_nullable
as EmailAddress,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as Password,
isSubmitting: null == isSubmitting
? _value.isSubmitting
: isSubmitting // ignore: cast_nullable_to_non_nullable
as bool,
showErrorMessages: freezed == showErrorMessages
? _value.showErrorMessages
: showErrorMessages // ignore: cast_nullable_to_non_nullable
as AutovalidateMode?,
authFailureOrSuccessOption: null == authFailureOrSuccessOption
? _value.authFailureOrSuccessOption
: authFailureOrSuccessOption // ignore: cast_nullable_to_non_nullable
as Option<Either<AuthFailure, Unit>>,
));
}
}

/// @nodoc
class _$_SignInFormState extends _SignInFormState {
_$_SignInFormState(
{required this.emailAddress,
required this.password,
required this.isSubmitting,
required this.showErrorMessages,
required this.authFailureOrSuccessOption})
: super._();

@override
final EmailAddress emailAddress;
@override
final Password password;
@override
final bool isSubmitting;
@override
final AutovalidateMode? showErrorMessages;
@override
final Option<Either<AuthFailure, Unit>> authFailureOrSuccessOption;

@override
String toString() {
return 'SignInFormState(emailAddress: $emailAddress, password: $password, isSubmitting: $isSubmitting, showErrorMessages: $showErrorMessages, authFailureOrSuccessOption: $authFailureOrSuccessOption)';
}

@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$_SignInFormState &&
(identical(other.emailAddress, emailAddress) ||
other.emailAddress == emailAddress) &&
(identical(other.password, password) ||
other.password == password) &&
(identical(other.isSubmitting, isSubmitting) ||
other.isSubmitting == isSubmitting) &&
(identical(other.showErrorMessages, showErrorMessages) ||
other.showErrorMessages == showErrorMessages) &&
(identical(other.authFailureOrSuccessOption,
authFailureOrSuccessOption) ||
other.authFailureOrSuccessOption ==
authFailureOrSuccessOption));
}

@override
int get hashCode => Object.hash(runtimeType, emailAddress, password,
isSubmitting, showErrorMessages, authFailureOrSuccessOption);

@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$_SignInFormStateCopyWith<_$_SignInFormState> get copyWith =>
__$$_SignInFormStateCopyWithImpl<_$_SignInFormState>(this, _$identity);
}

abstract class _SignInFormState extends SignInFormState {
factory _SignInFormState(
{required final EmailAddress emailAddress,
required final Password password,
required final bool isSubmitting,
required final AutovalidateMode? showErrorMessages,
required final Option<Either<AuthFailure, Unit>>
authFailureOrSuccessOption}) = _$_SignInFormState;
_SignInFormState._() : super._();

@override
EmailAddress get emailAddress;
@override
Password get password;
@override
bool get isSubmitting;
@override
AutovalidateMode? get showErrorMessages;
@override
Option<Either<AuthFailure, Unit>> get authFailureOrSuccessOption;
@override
@JsonKey(ignore: true)
_$$_SignInFormStateCopyWith<_$_SignInFormState> get copyWith =>
throw _privateConstructorUsedError;
}
8 changes: 2 additions & 6 deletions lib/application/auth/sign_in_form/sign_in_form_state.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_firebase_ddd_bloc/domain/auth/auth_failure.dart';
import 'package:flutter_firebase_ddd_bloc/domain/auth/value_objects.dart';
import 'package:fpdart/fpdart.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'sign_in_form_state.freezed.dart';

part of "sign_in_form_bloc.dart";

@freezed
class SignInFormState with _$SignInFormState {
Expand Down
Loading

0 comments on commit 10b26e7

Please sign in to comment.