forked from eatvio/eatvio_app
27 lines
753 B
Dart
27 lines
753 B
Dart
import 'package:eatvio_app/features/auth/auth_screen/models/auth_model.dart';
|
|
import 'package:equatable/equatable.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
part 'auth_event.dart';
|
|
part 'auth_state.dart';
|
|
|
|
/// A bloc that manages the state of a Auth according to the event that is dispatched to it.
|
|
class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
|
AuthBloc(AuthState initialState) : super(initialState) {
|
|
on<AuthInitialEvent>(_onInitialize);
|
|
}
|
|
|
|
_onInitialize(
|
|
AuthInitialEvent event,
|
|
Emitter<AuthState> emit,
|
|
) async {
|
|
emit(
|
|
state.copyWith(
|
|
emailController: TextEditingController(),
|
|
passwordController: TextEditingController(),
|
|
),
|
|
);
|
|
}
|
|
}
|