Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

BlocBuilder constructors #25

Open
PlugFox opened this issue Aug 16, 2021 · 2 comments
Open

BlocBuilder constructors #25

PlugFox opened this issue Aug 16, 2021 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@PlugFox
Copy link
Owner

PlugFox commented Aug 16, 2021

Create varius mixins on default BlocBuilder, BlocListener, BlocConsumer

BlocBuilder / BlocListener / BlocConsumer
Default BlocBuilder

BlocBuilder.distinct / BlocListener.distinct / BlocConsumer.distinct
Distinct in buildWhen & listenWhen by default

BlocBuilder.change / BlocListener.change / BlocConsumer.change
Ability to manipulate Change instead of State

@PlugFox PlugFox added the enhancement New feature or request label Aug 16, 2021
@PlugFox PlugFox added this to the 0.2.0 milestone Aug 16, 2021
@zs-dima
Copy link
Contributor

zs-dima commented Aug 23, 2021

BlocBuilder.distinct - distinct looks more like default BlocBuilder behavior
so maybe better to create BlocBuilder.nondistinct constructor instead

@zs-dima
Copy link
Contributor

zs-dima commented Aug 23, 2021

Could be nice to create 2 more constructors:

  1. BlocBuilder.where<State> or BlocBuilder.whereState<State> - to filter certain states only

  2. BlocBuilder.whereConvert<State> - to filter certain states plus to be able to map states stream with Result Function(State state) delegate

Example:
https://gist.github.com/zs-dima/009139aa960612e036287d1147aed19c

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