Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Felix Angelov
@felangel
12:06 am
:zzz:
Ken Lee
@KenAragorn
EU?
Felix Angelov
@felangel
No I'm in the US (CST)
Ken Lee
@KenAragorn
1.06pm here, ok...great, thanks a lot...been a pleasure chatting and got your direct input on my issue....appreciate it a lot. Have a good rest.
Felix Angelov
@felangel
anytime! thanks haha
Ken Lee
@KenAragorn
@felangel thanks!
Denis Chuvasov
@dened
Hello @felangel, thanks a lot for your library. I have the same problem like felangel/bloc#394
I don't know what I should do. For example. Usecase: create a new entity. I have a scaffold which has button and some body. When I press button I wanna to show progress on button. What I do now. I added stream to my block which responses for button state. Or I must create State which has a button state and body state. What I should do when happened failure?
Felix Angelov
@felangel
@dened have you taken a look at felangel/bloc#232
Pratik Parikh
@pratikpparikh
@felangel I have a quick question for you on felangel/bloc#484. Can you share your thoughts?
Renato Franceschinelli
@rlfrenato

Hi All,

Is there anyway to provide the Bloc back when navigation back button is pressed?

I'm trying to implement authentication with SMS code, and here is the problem I'm facing.

Page 1 - page where user can enter phone number - when submitted, it dispacthes an event to validate the phone number, if all OK I have a BlocListener to navigate to Page 2 providing the bloc)

Page 2 - it's the page where user enters SMS code, if I hit navigation back in this page I can't submit the phone number again with the following error "Bad state: Cannot add new events after calling close"

Felix Angelov
@felangel
@pratikpparikh I’ll take a look shortly
@rlfrenato that means you’re disposing the bloc incorrectly. Are you using BlocProvider to create the bloc instance?
Renato Franceschinelli
@rlfrenato
@felangel Thanks for the quick reply, I've figured out the problem, the bloc was provided to Page 1 through BlocProvider, then I was providing it again to Page 2 through BlocProvider as well, which it is not required as it's in context already. Silly mistake :S
Felix Angelov
@felangel
No problem! Glad you figured it out 🎉
Kirk Charles P. Niverba
@kirkcharlesniv
how do you go back from a post detail widget to your search delegate without refreshing or restarting the state?
dominwong4
@dominwong4
Just pop? I think
Kirk Charles P. Niverba
@kirkcharlesniv
it only occurs when using search delegate
when on the main screen, it doesn't refresh/restart state on navigator.pop
Kirk Charles P. Niverba
@kirkcharlesniv
i think this is a flutter problem, not related to bloc.
Kirk Charles P. Niverba
@kirkcharlesniv
image.png
image.png
SplashScreen widget is not showing
(following the firebase_login tutorial)
Tõnis Ostrat
@tonisostrat
maybe your state change to Unauthenticated happens so fast the phone doesn't have time to actually render it?
Kirk Charles P. Niverba
@kirkcharlesniv
ah makes sense, thanks!
Trevor Hill
@Hilldaddy_Jr_twitter
Hey guys! novice question about good practice for state management.
When using bloc, should the widgets they serve typically always be stateless? (excluding situations like animations where stateful is needed)
For example, I have a sign in page that requires data from an API, and I want the UI to be responsive so that loading, loaded, etc all have their own renders based on states provided from the bloc.
My question is, once the sign in screen is rendered, is it okay to store the username, password, etc. in the state of the stateful widget, and then dispatch them to the bloc all at once as arguments to the event, or should I try to store all user input in my same bloc?
tapizquent
@tapizquent
If you are not going to render another page where you cause your widget to rebuild, which would cause you to lose your data
Felix Angelov
@felangel
Hey @Hilldaddy_Jr_twitter 👋
I would recommend passing the data like usernames and passwords to the bloc via events you dispatch
Did you take a look at the login tutorial?
In most cases you should not need a StatefulWidget
sclee15
@sclee15
Is there a way to serialize and deserialize equitable objects painlessly?
dominwong4
@dominwong4
Hi
some bloc structure question
image.png
I have implemented item list with custom filtering
but I put all the filter elements inside the same bloc
should I separate them by two bloc like filterBloc & transactionBloc?
Felix Angelov
@felangel
@sclee15 you can use json serializable with equatable
@dominwong4 it’s up to you. Mostly depends on if you’re going to need to consume both the raw and filtered in different parts of your app. If yes, then I’d recommend splitting the filtering into a separate filtered bloc otherwise it might be overkill if the raw transactions won’t be consumed
Kirk Charles P. Niverba
@kirkcharlesniv

[FEEDBACK]

in firebase_login_bloc you need to set your SHA1 and SHA256 fingerprint in your firebase app's console or it will result into a PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

Felix Angelov
@felangel
👍 is that a new requirement?
Kirk Charles P. Niverba
@kirkcharlesniv
it's a requirement to do, but I don't know if it's a recent issue
Felix Angelov
@felangel
Good to know. Thanks!
Kirk Charles P. Niverba
@kirkcharlesniv
dominwong4
@dominwong4
I see
thanks
sclee15
@sclee15
@felangel thank you