/doesdonts3.dart Secret
Created
September 11, 2020 11:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VerificationBloc extends Bloc<VerificationEvent, VerificationState> { | |
VerificationInfo verification; | |
IVerificationService verificationService = VerificationService(); | |
@override | |
VerificationState get initialState => VerificationInitial(); | |
@override | |
Stream<VerificationState> mapEventToState( | |
VerificationEvent event, | |
) async* { | |
if(event is FeatchVerificationDataEvent){ | |
if(verification == null){ | |
verification = await verificationService.fetchVerificationData(verificationsUrl); | |
yield VerificationDataResponseState(verificationData: verification); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment