ScopedConsumer<TStore extends BaseStore<TState> , TState> constructor
const
ScopedConsumer<TStore extends BaseStore<TState> , TState> ({
- Key? key,
- dynamic distinct(
- TState state
- bool filter(
- TState state
- void onStateListener(
- BuildContext context,
- TState state
- void onErrorListener(
- BuildContext context,
- dynamic error
- void onLoadingListener(
- BuildContext context,
- bool isLoading
- TStore? store,
- Widget onStateBuilder(
- BuildContext context,
- TState state
- Widget onErrorBuilder(
- BuildContext context,
- dynamic error
- Widget onLoadingBuilder(
- BuildContext context
ScopedConsumer constructor class
Implementation
const ScopedConsumer({
Key? key,
this.distinct,
this.filter,
this.onStateListener,
this.onErrorListener,
this.onLoadingListener,
this.store,
this.onStateBuilder,
this.onErrorBuilder,
this.onLoadingBuilder,
}) : assert(
(onStateListener != null || onErrorListener != null || onLoadingListener != null) && (onStateBuilder != null || onErrorBuilder != null || onLoadingBuilder != null),
'Define at least one listener (onStateListener, onErrorListener, onLoadingListener) or one builder (onStateBuilder, onErrorBuilder, onLoadingBuilder)',
),
assert(
distinct == null ? true : onStateListener != null,
'Distinct needs onState implementation',
),
assert(
filter == null ? true : onStateListener != null,
'Filter needs onState implementation',
),
super(key: key);