Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

BlocListener? #15

Closed
antholeole opened this issue Jul 27, 2021 · 1 comment
Closed

BlocListener? #15

antholeole opened this issue Jul 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@antholeole
Copy link

Is there a way to use this with bloc listener? currently, I'm literally just taking the state and doing:

BlocListener<MyCubit, MyState>(
      listener: (context, state) {
          state.join(
              (_) {}, //empty here, as we don't do anything with this state
              (wantedState) => print(wantedState.wantedProperty); //do something here
         );
    }
)

Is it possible to have a function on on a state like:

state.on<WantedState>((wantedState) => print(wantedState.wantedProperty));

so that you can choose to only react to a single state as opposed to needing to put a voider function on every unwanted state?

@felangel felangel added the enhancement New feature or request label Dec 20, 2021
@felangel
Copy link
Owner

This package is discontinued in favor of sealed class modifiers introduced in Dart 3.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants