ScopedConsumer<TStore extends BaseStore<TState>, TState> constructor

const ScopedConsumer<TStore extends BaseStore<TState>, TState>({
  1. Key? key,
  2. dynamic distinct(
    1. TState state
    )?,
  3. bool filter(
    1. TState state
    )?,
  4. void onStateListener(
    1. BuildContext context,
    2. TState state
    )?,
  5. void onErrorListener(
    1. BuildContext context,
    2. dynamic error
    )?,
  6. void onLoadingListener(
    1. BuildContext context,
    2. bool isLoading
    )?,
  7. TStore? store,
  8. Widget onStateBuilder(
    1. BuildContext context,
    2. TState state
    )?,
  9. Widget onErrorBuilder(
    1. BuildContext context,
    2. dynamic error
    )?,
  10. Widget onLoadingBuilder(
    1. 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);