fix: bloc
This commit is contained in:
parent
1b1e8c5bb4
commit
838707becf
@ -23,10 +23,10 @@ class LoginFormBloc extends Bloc<LoginFormEvent, LoginFormState> {
|
|||||||
) {
|
) {
|
||||||
return event.map(
|
return event.map(
|
||||||
emailChanged: (e) async {
|
emailChanged: (e) async {
|
||||||
emit(state.copyWith(email: e.email));
|
emit(state.copyWith(email: e.email, failureOrAuthOption: none()));
|
||||||
},
|
},
|
||||||
passwordChanged: (e) async {
|
passwordChanged: (e) async {
|
||||||
emit(state.copyWith(password: e.password));
|
emit(state.copyWith(password: e.password, failureOrAuthOption: none()));
|
||||||
},
|
},
|
||||||
submitted: (e) async {
|
submitted: (e) async {
|
||||||
Either<AuthFailure, Auth>? failureOrAuth;
|
Either<AuthFailure, Auth>? failureOrAuth;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class UserEditFormBloc extends Bloc<UserEditFormEvent, UserEditFormState> {
|
|||||||
) {
|
) {
|
||||||
return event.map(
|
return event.map(
|
||||||
nameChanged: (e) async {
|
nameChanged: (e) async {
|
||||||
emit(state.copyWith(name: e.name));
|
emit(state.copyWith(name: e.name, failureOrUserOption: none()));
|
||||||
},
|
},
|
||||||
submitted: (e) async {
|
submitted: (e) async {
|
||||||
Either<UserFailure, User>? failureOrUser;
|
Either<UserFailure, User>? failureOrUser;
|
||||||
|
|||||||
@ -30,6 +30,8 @@ class _ProfileChangePasswordPageState extends State<ProfileChangePasswordPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlocListener<ChangePasswordFormBloc, ChangePasswordFormState>(
|
return BlocListener<ChangePasswordFormBloc, ChangePasswordFormState>(
|
||||||
|
listenWhen: (p, c) =>
|
||||||
|
p.failureOrChangePasswordOption != c.failureOrChangePasswordOption,
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
state.failureOrChangePasswordOption.fold(
|
state.failureOrChangePasswordOption.fold(
|
||||||
() => null,
|
() => null,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user