flutter_bloc_pattern library

Classes

BaseBloc
Base class for all bloc
BlocProvider<T extends BaseBloc>
Provides BaseBloc to all descendants of this Widget. This should generally be a root widget in your App
BlocProviders
A bloc provider that exposes that merges multiple other BlocProviders into one.
DisposeCallbackBaseBloc
Base bloc that implements BaseBloc.dispose by passing callback to constructor, and call it when BaseBloc.dispose called.
RxStreamBuilder<T>
Rx stream builder that will pre-populate the streams initial data if the given stream is an stream that holds the streams current value such as a ValueStream or a ReplayStream

Extensions

BlocProviderExtension on BuildContext
Retrieve the bloc from the BlocProvider by this BuildContext.

Typedefs

Func0<R> = R Function()
Represents a function with zero arguments: () -> R.
Func1<T, R> = R Function(T)
Represents a function with one argument: (T) -> R.
Func2<T1, T2, R> = R Function(T1, T2)
Represents a function with two arguments: (T1, T2) -> R.
Func3<T1, T2, T3, R> = R Function(T1, T2, T3)
Represents a function with three arguments: (T1, T2, T3) -> R.
Func4<T1, T2, T3, T4, R> = R Function(T1, T2, T3, T4)
Represents a function with four arguments: (T1, T2, T3, T4) -> R.
Func5<T1, T2, T3, T4, T5, R> = R Function(T1, T2, T3, T4, T5)
Represents a function with five arguments: (T1, T2, T3, T4, T5) -> R.
Func6<T1, T2, T3, T4, T5, T6, R> = R Function(T1, T2, T3, T4, T5, T6)
Represents a function with six arguments: (T1, T2, T3, T4, T5, T6) -> R.
Func7<T1, T2, T3, T4, T5, T6, T7, R> = R Function(T1, T2, T3, T4, T5, T6, T7)
Represents a function with seven arguments: (T1, T2, T3, T4, T5, T6, T7) -> R.
Func8<T1, T2, T3, T4, T5, T6, T7, T8, R> = R Function(T1, T2, T3, T4, T5, T6, T7, T8)
Represents a function with eight arguments: (T1, T2, T3, T4, T5, T6, T7, T8) -> R.
Func9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> = R Function(T1, T2, T3, T4, T5, T6, T7, T8, T9)
Represents a function with nine arguments: (T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R.
RxWidgetBuilder<T> = Widget Function(BuildContext context, T data)
Signature for strategies that build widgets based on asynchronous interaction.
VoidAction = void Function()
Represents a function that have no arguments and return no data.

Exceptions / Errors

BlocProviderError
If the BlocProvider.of method fails, this error will be thrown.
InvalidStateStreamError<T>
Invalid state error caused by a StateStream.
UnhandledStreamError
Error emitted from Stream when using RxStreamBuilder.