abstract_bloc library

Classes

AbstractConfiguration
AbstractFormBasicState
AbstractFormBloc<S extends AbstractFormBasicState>
AbstractFormBuilder<B extends AbstractFormBloc<S>, S extends AbstractFormBasicState>
AbstractFormConsumer<B extends AbstractFormBloc<S>, S extends AbstractFormState<TModel, TModelValidator>, TModel, TModelValidator extends ModelValidator>
AbstractFormErrorContainer
AbstractFormEvent
AbstractFormInitEvent<TSearchModel>
AbstractFormNoDataContainer
AbstractFormState<TModel, TModelValidator extends ModelValidator>
AbstractFormSubmitEvent
AbstractFormUpdateEvent<TModel>
AbstractItemBloc<S extends AbstractItemState>
AbstractItemBuilder<B extends AbstractItemBloc<S>, S extends AbstractItemState>
AbstractItemConsumer<B extends AbstractItemBloc<S>, S extends AbstractItemState, TItem>
AbstractItemErrorContainer
AbstractItemEvent
AbstractItemFilterableState<TSearchModel, TItem>
AbstractItemLoadEvent<TSearchModel>
AbstractItemNoDataContainer
AbstractItemState<TItem>
AbstractLisErrorContainer
AbstractListBloc<S extends AbstractListState>
AbstractListBuilder<B extends BlocBase<S>, S extends AbstractListState>
AbstractListEvent
AbstractListFilterablePaginatedState<TSearchModel extends Pagination, TListItem>
AbstractListFilterableState<TSearchModel, TListItem>
AbstractListLoadEvent<TSearchModel>
AbstractListLoadMoreEvent
AbstractListNoDataContainer
AbstractListRefreshEvent
AbstractListState<TListItem>
AbstractTranslations
AuthOptions
BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
BezierCircleHeader
bezier + circle indicator,you can use this directly
BezierHeader
bezier container,if you need to implements indicator with bezier ,you can use consider about use this this will add the bezier container effect
Bloc<Event, State>
Takes a Stream of Events as input and transforms them into a Stream of States as output.
BlocBase<State>
An interface for the core functionality implemented by both Bloc and Cubit.
BlocBuilder<B extends StateStreamable<S>, S>
BlocBuilder handles building a widget in response to new states. BlocBuilder is analogous to StreamBuilder but has simplified API to reduce the amount of boilerplate code needed as well as bloc-specific performance improvements. Please refer to BlocListener if you want to "do" anything in response to state changes such as navigation, showing a dialog, etc...
BlocBuilderBase<B extends StateStreamable<S>, S>
Base class for widgets that build themselves based on interaction with a specified bloc.
BlocConsumer<B extends StateStreamable<S>, S>
BlocConsumer exposes a builder and listener in order react to new states. BlocConsumer is analogous to a nested BlocListener and BlocBuilder but reduces the amount of boilerplate needed. BlocConsumer should only be used when it is necessary to both rebuild UI and execute other reactions to state changes in the bloc.
BlocEventSink<Event extends Object?>
An ErrorSink that supports adding events.
BlocListener<B extends StateStreamable<S>, S>
Takes a BlocWidgetListener and an optional bloc and invokes the listener in response to state changes in the bloc. It should be used for functionality that needs to occur only in response to a state change such as navigation, showing a SnackBar, showing a Dialog, etc... The listener is guaranteed to only be called once for each state change unlike the builder in BlocBuilder.
BlocListenerBase<B extends StateStreamable<S>, S>
Base class for widgets that listen to state changes in a specified bloc.
BlocObserver
An interface for observing the behavior of Bloc instances.
BlocOverrides
This class facilitates overriding BlocObserver and EventTransformer. It should be extended by another class in client code with overrides that construct a custom implementation. The implementation in this class defaults to the base blocObserver and eventTransformer implementation. For example:
BlocProvider<T extends StateStreamableSource<Object?>>
Takes a Create function that is responsible for creating the Bloc or Cubit and a child which will have access to the instance via BlocProvider.of(context). It is used as a dependency injection (DI) widget so that a single instance of a Bloc or Cubit can be provided to multiple widgets within a subtree.
BlocSelector<B extends StateStreamable<S>, S, T>
BlocSelector is analogous to BlocBuilder but allows developers to filter updates by selecting a new value based on the bloc state. Unnecessary builds are prevented if the selected value does not change.
CacheResult<T>
CancelToken
You can cancel a request by using a cancel token. One token can be shared with different requests. when a token's cancel method invoked, all requests with this token will be cancelled.
Change<State>
A Change represents the change from one State to another. A Change consists of the currentState and nextState.
ChRefreshString
Chinese
ClassicFooter
the most common indicator,combine with a text and a icon
ClassicHeader
the most common indicator,combine with a text and a icon
Closable
An object that must be closed when no longer in use.
Cubit<State>
A Cubit is similar to Bloc but has no notion of events and relies on methods to emit new states.
CustomFooter
a custom Indicator for footer,the usage I have put in CustomHeader,same with that See also
CustomHeader
a custom Indicator for header
DefaultTransformer
DeRefreshString
German
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use.
DioMixin
Emittable<State extends Object?>
An object that can emit new states.
Emitter<State>
An Emitter is a class which is capable of emitting new states.
EnRefreshString
English
ErrorInterceptorHandler
Handler for error interceptor.
ErrorResult<T>
ErrorSink
A generic destination for errors.
EsRefreshString
Spanish
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
FrRefreshString
French
GridResult<TListItem>
Headers
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
InfoDialog
Interceptor
Dio instance may have interceptor(s) by which you can intercept requests/responses/errors before they are handled by then or catchError. See also:
Interceptors
Interceptors are a queue, and you can add any number of interceptors, All interceptors will be executed in first in first out order.
InterceptorsWrapper
InterceptorsWrapper is a helper class, which is used to conveniently create interceptor(s). See also:
IRestApiClient
ItRefreshString
Italian
JpRefreshString
Japanese
KrRefreshString
Korean
LinkFooter
enable footer link other footer place outside the viewport
LinkHeader
enable header link other header place outside the viewport
ListParam<T>
LoadIndicator
a widget implements pull up load
LoadIndicatorState<T extends LoadIndicator>
LoadingProcessor
footer Indicator exposure interface
Lock
Add lock/unlock API for interceptors.
LoggingOptions
Options to customize logging of http requests/responses
LogInterceptor
LogInterceptor is used to print logs during network requests. It's better to add LogInterceptor to the tail of the interceptor queue, otherwise the changes made in the interceptor behind A will not be printed out. This is because the execution of interceptors is in the order of addition.
MaterialClassicHeader
mostly use flutter inner's RefreshIndicator
ModelValidator
MultiBlocListener
Merges multiple BlocListener widgets into one widget tree.
MultiBlocProvider
Merges multiple BlocProvider widgets into one widget tree.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.
MultiRepositoryProvider
Merges multiple RepositoryProvider widgets into one widget tree.
NetworkResult<T>
NlRefreshString
Dutch
Options
Every request can pass an Options object which will be merged with Dio.options
Pagination
PaginationConfiguration
PropertyValidator<T>
PtRefreshString
QueuedInterceptor
Serialize the request/response/error before they enter the interceptor.
QueuedInterceptorsWrapper
QueuedInterceptorsWrapper is a helper class, which is used to conveniently create QueuedInterceptor(s). See also:
RedirectRecord
RefreshConfiguration
Controls how SmartRefresher widgets behave in a subtree.the usage just like ScrollConfiguration
RefreshController
A controller controll header and footer state, it can trigger driving request Refresh ,set the initalRefresh,status if needed
RefreshIndicator
a widget implements ios pull down refresh effect and Android material RefreshIndicator overScroll effect
RefreshIndicatorState<T extends RefreshIndicator>
Internal Implementation of Head Indicator
RefreshLocalizations
Implementation of localized strings for the ClassicHeader,ClassicFooter,TwoLevelHeader
RefreshLocalizationsDelegate
RefreshNotifier<T>
RefreshPhysics
a scrollPhysics for config refresh scroll effect,enable viewport out of edge whatever physics it is in ClampingScrollPhysics, it doesn't allow to flip out of edge,but in RefreshPhysics,it will allow to do that, by parent physics passing,it also can attach the different of iOS and Android different scroll effect it also handles interception scrolling when refreshed, or when the second floor is open and closed. with SpringDescription passing,you can custom spring back animate,the more paramter can be setting in RefreshConfiguration
RefreshProcessor
head Indicator exposure interface
RefreshString
interface implements different language
RepositoryProvider<T>
Takes a Create function that is responsible for creating the repository and a child which will have access to the repository via RepositoryProvider.of(context). It is used as a dependency injection (DI) widget so that a single instance of a repository can be provided to multiple widgets within a subtree.
RequestInterceptorHandler
Handler for request interceptor.
RequestOptions
Response<T>
Response describes the http Response info.
ResponseBody
ResponseInterceptorHandler
Handler for response interceptor.
RestApiClient
RestApiClientHeaders
RestApiClientOptions
RestApiClientRequestOptions
Result<T>
RuRefreshString
Russian
SmartRefresher
This is the most important component that provides drop-down refresh and up loading. RefreshController must not be null,Only one controller to one SmartRefresher
SmartRefresherState
StateStreamable<State>
A Streamable that provides synchronous access to the current state.
StateStreamableSource<State>
A StateStreamable that must be closed when no longer in use.
Streamable<State extends Object?>
An object that provides access to a stream of states over time.
SuccessResult<T>
SvRefreshString
Swedish
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
Transition<Event, State>
A Transition is the change from one state to another. Consists of the currentState, an event, and the nextState.
TwoLevelHeader
this header help you implements twoLevel function easyily, the behaviour just like TaoBao,XieCheng(携程) App TwoLevel
UkRefreshString
WaterDropHeader
QQ ios refresh header effect
WaterDropMaterialHeader
attach the waterdrop effect to MaterialClassicHeader

Mixins

IndicatorStateMixin<T extends StatefulWidget, V>
mixin in IndicatorState,it will get position and remove when dispose,init mode state
OptionsMixin

Extensions

ReadContext
Exposes the read method.
SelectContext
Adds a select method on BuildContext.
WatchContext
Exposes the watch method.

Enums

BezierCircleType
BezierDismissType
DioErrorType
FormResultStatus
IconPosition
direction that icon should place to the text
ListFormat
ListFormat specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name) and the separator for array items.
LoadStatus
footer state
LoadStyle
footer indicator display style
RefreshStatus
header state
RefreshStyle
header indicator display style
ResponseType
ResponseType indicates which transformation should be automatically applied to the response data by Dio.
ResultStatus
TwoLevelDisplayAlignment

Typedefs

BlocBuilderCondition<S> = bool Function(S previous, S current)
Signature for the buildWhen function which takes the previous state and the current state and is responsible for returning a bool which determines whether to rebuild BlocBuilder with the current state.
BlocListenerCondition<S> = bool Function(S previous, S current)
Signature for the listenWhen function which takes the previous state and the current state and is responsible for returning a bool which determines whether or not to call BlocWidgetListener of BlocListener with the current state.
BlocWidgetBuilder<S> = Widget Function(BuildContext context, S state)
Signature for the builder function which takes the BuildContext and state and is responsible for returning a widget which is to be rendered. This is analogous to the builder function in StreamBuilder.
BlocWidgetListener<S> = void Function(BuildContext context, S state)
Signature for the listener function which takes the BuildContext along with the state and is responsible for executing in response to state changes.
BlocWidgetSelector<S, T> = T Function(S state)
Signature for the selector function which is responsible for returning a selected value, T, based on state.
EventHandler<Event, State> = FutureOr<void> Function(Event event, Emitter<State> emit)
An event handler is responsible for reacting to an incoming Event and can emit zero or more states via the Emitter.
EventMapper<Event> = Stream<Event> Function(Event event)
Signature for a function which converts an incoming event into an outbound stream of events. Used when defining custom EventTransformers.
EventTransformer<Event> = Stream<Event> Function(Stream<Event> events, EventMapper<Event> mapper)
Used to change how events are processed. By default events are processed concurrently.
FooterBuilder = Widget Function(BuildContext context, LoadStatus? mode)
custom footer builder,you can use second paramter to know what footerr state is
HeaderBuilder = Widget Function(BuildContext context, RefreshStatus? mode)
custom header builder,you can use second paramter to know what header state is
HeaderForEachCallback = void Function(String name, List<String> values)
IndicatorBuilder = Widget Function()
global default indicator builder
InterceptorErrorCallback = void Function(DioError e, ErrorInterceptorHandler handler)
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
InterceptorSuccessCallback = void Function(Response e, ResponseInterceptorHandler handler)
JsonDecodeCallback = dynamic Function(String)
The default Transformer for Dio. If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the DefaultTransformer by setting the dio.Transformer.
ModeChangeCallBack<T> = void Function(T? mode)
OffsetCallBack = void Function(double offset)
OnTwoLevel = void Function(bool isOpen)
when viewport not full one page, for different state,whether it should follow the content
OuterBuilder = Widget Function(Widget child)
wrap child in outside,mostly use in add background color and padding
ProgressCallback = void Function(int count, int total)
Callback to listen the progress for sending/receiving data.
RefresherBuilder = Widget Function(BuildContext context, RefreshPhysics physics)
a builder for attaching refresh function with the physics
RequestEncoder = List<int> Function(String request, RequestOptions options)
ResponseDecoder = String Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
ShouldFollowContent = bool Function(LoadStatus? status)
when viewport not full one page, for different state,whether it should follow the content
ValidateStatus = bool Function(int? status)
VoidFutureCallBack = Future<void> Function()

Exceptions / Errors

BaseException
Base class for any RestApiClient exception that might happen during http requests/responses
DioError
DioError describes the error info when request failed.
ForbiddenException
Derived exception class that represents any server error
NetworkErrorException
Derived exception class that represents any network related error
ProviderNotFoundException
The error that will be thrown if Provider.of fails to find a Provider as an ancestor of the BuildContext used.
ServerErrorException
Derived exception class that represents any server error
UnauthorizedException
Derived exception class that represents any server error
ValidationException
Derived exception class that represents any validation error