bloc

    0

    0

    class UserBloc extends Bloc<UserEvent, UserState> { UserBloc() : super(const UserState()) { onAddUsers(onAddUser); onClearLocalInfo(onClearLocalInfo); onUpdateUsersName(onUpdateUserfirstName); onUpdatePhoneNumber(onUpdatePhoneNumber); onUpdateUserEmail(onUpdateUserEmail); }

    Future<FutureOr<void>> _onAddUser( AddUsers event, Emitter<UserState> emit) async { }

    Future<void> _onUpdateUserfirstName( UpdateUsersName event, Emitter<UserState> emit) async { emit(UserState(allUsers: alluser)); }

    Future<FutureOr<void>> _onUpdatePhoneNumber( UpdatePhoneNumber event, Emitter<UserState> emit) async { emit(UserState(allUsers: alluser)); }

    Future<FutureOr<void>> _onUpdateUserEmail

    import 'package:flutter/material.dart'
    import 'dart:async';
    import 'package:bloc/bloc.dart';
    import 'package:amplify_flutter/amplify_flutter.dart';
    import 'package:equatable/equatable.dart';
    
    
    class UserBloc extends Bloc<UserEvent, UserState> {
      UserBloc() : super(const UserState()) {
        on<AddUsers>(_onAddUser);
        on<ClearLocalInfo>(_onClearLocalInfo);
        on<UpdateUsersName>(_onUpdateUserfirstName);
        on<UpdatePhoneNumber>(_onUpdatePhoneNumber);
        on<UpdateUserEmail>(_onUpdateUserEmail);
      }
    
      Future<FutureOr<void>> _onAddUser(
          AddUsers event, Emitter<UserState> emit) async {
      }
    
      Future<void> _onUpdateUserfirstName(
          UpdateUsersName event, Emitter<UserState> emit) async {
    
        emit(UserState(allUsers: alluser));
      }
    
      Future<FutureOr<void>> _onUpdatePhoneNumber(
          UpdatePhoneNumber event, Emitter<UserState> emit) async {
    
    
        emit(UserState(allUsers: alluser));
      }
    
      Future<FutureOr<void>> _onUpdateUserEmail(
          UpdateUserEmail event, Emitter<UserState> emit) async {
        
    
        emit(UserState(allUsers: alluser));
      }
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.