Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

[DISCUSSION] Should Cubit expose Stream API? #46

@chimon2000

Description

@chimon2000

Something I immediately noticed is that because Cubit inherits from Stream, it surfaces the entire Stream API. This seems like a leaky abstraction, and I'm wondering whether there is some way that the API could be hidden?

One option I could see is for Cubit to have a protected/private CubitStream<State> stream property, rather than inherit from it. The most minimal change might be something like the following.

abstract class Cubit<State> {
  @protected
  CubitStream<State> stream;

  State get state => _stream.state;
}

Metadata

Metadata

Assignees

Labels

feedback wantedLooking for feedback from the communityquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions