A Flutter package that wrap flutter bloc package for clearer implementation. It's more similar to MVI pattern which:
- Reflect data state to view (ui)
- Process ui event to update state then make change in ui
This package is use to develop app which use Bloc pattern clearer, quicker, easier by wrapping complicated bloc usage.
+ event processor instance or
+ create processor instance for use in child widget.
- Create State extends DataState class. For ex: LoginState
- Create Event extends UiEvent class. For ex: LoginEvent
-
Create Login screen and implement 3 function
class LoginScreen extends CoreScreen<LoginEvent, LoginState, LoginEventProcessor>
3.1createEventProcessor
: returnEventToStateProcessor
for use in this widget or its child. For ex just:return LoginEventProcessor();
3.2buildScreenUi
: for build screen ui base on data state by usingbuildStateBuilderWidget
buildStateConsumerWidget
buildStateListenerWidget
buildStateSelectorWidget
- and other widgets for UI elements which is not depended to state
For ex: if state is
state.isLoading
is true then show ProgressBarbuildStateBuilderWidget( rebuildOnCondition: (p, c) => p.isLoading != c.isLoading, builder: () => Visibility( visible: state.isLoading, child: LoadingIndicatorWidget())),
-
- Dart 2: >= 2.6.0
- Justin Lewis (Maintainer)