import 'package:flutter_bloc/flutter_bloc.dart';

import 'account_event.dart';
import 'account_state.dart';

class AccountBloc extends Bloc<AccountEvent, AccountState> {
  AccountBloc({AccountStatus initialStatus = AccountStatus.undefined})
    : super(AccountState(status: initialStatus)) {
    on<AccountStatusChanged>(
      (event, emit) => emit(state.copyWith(status: event.status)),
    );
  }

  void setStatus(AccountStatus status) => add(AccountStatusChanged(status));
}
