forked from eatvio/eatvio_app
23 lines
718 B
Dart
23 lines
718 B
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:flutter/material.dart';
|
|
import '/core/app_export.dart';
|
|
import 'package:eatvio_app/presentation/auth/auth_screen/models/auth_model.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()));
|
|
}
|
|
}
|