Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: calling multiple events inside a widget that resets states to initial values #4053

Open
Micro-Prog opened this issue Feb 1, 2024 · 3 comments
Labels
needs repro info The issue is missing a reproduction sample and/or steps question Further information is requested waiting for response Waiting for follow up

Comments

@Micro-Prog
Copy link

Micro-Prog commented Feb 1, 2024

Hello,

I have set the flutter_bloc in my app which controls multiple states, the problems is that when calling two states inside my widget, the one of them resets the other one to {} value. is there any solution to overcome this?
note that all states are read properly without any problem by looking at the console log, but one of them is reset after a while.

@Micro-Prog Micro-Prog added the chore no production code change label Feb 1, 2024
@felangel
Copy link
Owner

felangel commented Feb 1, 2024

Hi @Micro-Prog 👋
Thanks for opening an issue!

It's really difficult to help without a link to a minimal reproduction sample that I can run locally to see the issue. Can you please provide a link to a minimal reproduction sample on either GitHub or DartPad? Thanks!

@felangel felangel added question Further information is requested waiting for response Waiting for follow up needs repro info The issue is missing a reproduction sample and/or steps and removed chore no production code change labels Feb 1, 2024
@Micro-Prog
Copy link
Author

Hi @Micro-Prog 👋 Thanks for opening an issue!

It's really difficult to help without a link to a minimal reproduction sample that I can run locally to see the issue. Can you please provide a link to a minimal reproduction sample on either GitHub or DartPad? Thanks!

**

sorry, i pushed the minimal version to my github: https://github.com/Micro-Prog/myapp-flutter
please note that the app is a testing app, i've created 2 dynamic pages called presentation (which reads data from bloc --> sqlite database and shows test types(grammer or vocab)) and levels (which reads data from database and shows language levels). the problems is that when reading 2 events inside the levels widget (), the state.testStructures is read correctly but then turns into {}. this causes the expanded tile in the levels screen to be 'no info'.
i tested many times and i noticed the issue is when calling 2 events in the initState() of the widget, and when calling one event, there is no problem.

@Micro-Prog
Copy link
Author

Hi @Micro-Prog 👋 Thanks for opening an issue!

It's really difficult to help without a link to a minimal reproduction sample that I can run locally to see the issue. Can you please provide a link to a minimal reproduction sample on either GitHub or DartPad? Thanks!

is there any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro info The issue is missing a reproduction sample and/or steps question Further information is requested waiting for response Waiting for follow up
Projects
None yet
Development

No branches or pull requests

2 participants