Closed gilangsatria09 closed 2 years ago
Hi @gilangsatria09 👋 Thanks for opening an issue!
You need to await the call to token.fold to prevent the event handler from completing before emit is called.
Let me know if that helps! 👍
Thank you so much for reply my issues this fast!!
so, what i should do is add await to the token.fold like this: var token = await fetchToken(NoParams()); await token.fold((l) async => emit(ErrorState('error')), (r) async {
am i right?
Thank you so much for reply my issues this fast!!
so, what i should do is add await to the token.fold like this: var token = await fetchToken(NoParams()); await token.fold((l) async => emit(ErrorState('error')), (r) async {
am i right?
Yup, no problem! 👍 Let me know if that resolves the issue.
omg!!! thank you soooooo much, it really worked. thank you for helping me despite my bad english
omg!!! thank you soooooo much, it really worked. thank you for helping me despite my bad english
No problem! 😄
Description I tried called emit inside dartz fold after i called await function
var token = await fetchToken(NoParams()); token.fold((l) async => emit(ErrorState('error')), (r) async { //Error Unhandled Exception if this line added var res = await getBanner(GetBannerParams(token: r));
Expected Behavior I expected that emit(GetHomeDataSuccess) is called successful
Screenshots