AsyncNotifier<S>.withData constructor

AsyncNotifier<S>.withData(
  1. S data
)

Creates an AsyncNotifier with initial data.

state is the initial data to set. The notifier starts with the provided data state.

Example:

// Start with data state
AsyncNotifier<String>.withData('Initial data')

Implementation

AsyncNotifier.withData(S data) : super(AsyncState.data(data)) {
  _initialize(setState);
}