You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use a BLoC (concretely, I am using the flutter_bloc package) inside the onReorder callback in order to 'announce' the changes and persist them.
But I would need to have access to the BuildContext to get the BLoC using something such as BlocProvider.of<MyCustomBloc>(context). So, in a StatelessWidget, a concrete implemenetation of onReorder callback should have this context as parameter as well:
Hi Matej,
I want to use a BLoC (concretely, I am using the
flutter_bloc
package) inside theonReorder
callback in order to 'announce' the changes and persist them.But I would need to have access to the
BuildContext
to get the BLoC using something such asBlocProvider.of<MyCustomBloc>(context)
. So, in a StatelessWidget, a concrete implemenetation ofonReorder
callback should have this context as parameter as well:Of course, for the moment, a StatefulWidget can be used to just store the BLoC retrieved from hierarchy in its state.
What do you think?
Thanks!
The text was updated successfully, but these errors were encountered: