abstract_bloc library

Classes

AbstractConfiguration
AbstractFormBaseState
AbstractFormBasicState<TModel>
AbstractFormBloc<S extends AbstractFormBaseState>
AbstractFormBuilder<B extends StateStreamableSource<S>, S extends AbstractFormBaseState>
AbstractFormCubit<S extends AbstractFormBaseState>
AbstractFormErrorContainer
AbstractFormEvent
AbstractFormInitEvent
AbstractFormNoDataContainer
AbstractFormState<TModel, TModelValidator extends ModelValidator>
AbstractFormSubmitEvent<TModel>
AbstractFormUpdateEvent<TModel>
AbstractItemBloc<S extends AbstractItemState>
AbstractItemBuilder<B extends StateStreamableSource<S>, S extends AbstractItemState>
AbstractItemCubit<S extends AbstractItemState>
AbstractItemErrorContainer
AbstractItemEvent
AbstractItemFilterableState<TSearchModel, TItem>
AbstractItemLoadEvent<TSearchModel>
AbstractItemNoDataContainer
AbstractItemState<TItem>
AbstractLisErrorContainer
AbstractListBloc<S extends AbstractListState>
AbstractListBuilder<B extends StateStreamableSource<S>, S extends AbstractListState>
AbstractListCubit<S extends AbstractListState>
AbstractListEvent
AbstractListFilterablePaginatedState<TSearchModel extends Pagination, TListItem>
AbstractListFilterableState<TSearchModel, TListItem>
AbstractListLoadEvent<TSearchModel>
AbstractListLoadMoreEvent
AbstractListNoDataContainer
AbstractListRefreshEvent
AbstractListState<TListItem>
AbstractTranslations
AuthHandler
AuthOptions
BackgroundTransformer
The default Transformer for Dio.
BaseOptions
The base config for the Dio instance, used by Dio.options.
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.
CacheHandler
CacheModel
CacheOptions
CacheResult<T>
CancelToken
Controls cancellation of Dio's requests.
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.
CopyWith
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
DeRefreshString
German
Dio
Dio enables you to make HTTP requests easily.
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
The handler for interceptors to handle error occurred during the request.
ErrorResult<T>
ErrorSink
A generic destination for errors.
EsRefreshString
Spanish
ExceptionHandler
ExceptionOptions
This class is part of exception handling mechanism implemented in RestApiClient
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>
GridResultJsonConfiguration
Headers
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
InfoDialog
Interceptor
Interceptor helps to deal with RequestOptions, Response, and DioException during the lifecycle of a request before it reaches users.
Interceptors
A Queue-Model list for Interceptors.
InterceptorsWrapper
A helper class to create interceptors in ease.
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>
Indicates a param being used as queries or form data, and how does it gets formatted.
LoadIndicator
a widget implements pull up load
LoadIndicatorState<T extends LoadIndicator>
LoadingProcessor
footer Indicator exposure interface
LocalErrorResult<T>
LocalSuccessResult<T>
LoggingOptions
Options to customize logging of http requests/responses
LogInterceptor
LogInterceptor is used to print logs during network requests. It should be the last interceptor added, otherwise modifications by following interceptors will not be logged. 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
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create queued-interceptors in ease.
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
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
RefreshTokenInterceptor
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
The handler for interceptors to handle before the request has been sent.
RequestOptions
The internal request option class that is the eventual result after BaseOptions and Options are composed.
Response<T>
The Response class contains the payload (could be transformed) that respond from the request, and other information of the response.
ResponseBody
The response wrapper class for adapters.
ResponseInterceptorHandler
The handler for interceptors to handle after respond.
RestApiClient
RestApiClientHeaders
RestApiClientImpl
RestApiClientKeys
Constant values used by RestApiClient
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
SyncTransformer
If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the transformer by setting the Dio.transformer.
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

Enums

AbstractScrollBehaviour
BezierCircleType
BezierDismissType
DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
FormResultStatus
IconPosition
direction that icon should place to the text
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
Indicates which transformation should be applied to the response data.
ResultStatus
TwoLevelDisplayAlignment

Mixins

IndicatorStateMixin<T extends StatefulWidget, V>
mixin in IndicatorState,it will get position and remove when dispose,init mode state
OptionsMixin
The mixin class for options that provides common attributes.

Extensions

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

Functions

dateTimeFromJson(String? json) DateTime?

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.
DefaultTransformer = SyncTransformer
DioError = DioException
DioError describes the exception info when a request failed.
DioErrorType = DioExceptionType
Deprecated in favor of DioExceptionType and will be removed in future major versions.
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)
The signature that iterates header fields.
IndicatorBuilder = Widget Function()
global default indicator builder
InterceptorErrorCallback = void Function(DioException error, ErrorInterceptorHandler handler)
The signature of Interceptor.onError.
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
The signature of Interceptor.onRequest.
InterceptorSuccessCallback = void Function(Response response, ResponseInterceptorHandler handler)
The signature of Interceptor.onResponse.
JsonDecodeCallback = FutureOr Function(String)
The callback definition for decoding a JSON string.
JsonEncodeCallback = FutureOr<String> Function(Object)
The callback definition for encoding a JSON object.
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)
The type of a progress listening callback when sending or receiving data.
RefresherBuilder = Widget Function(BuildContext context, RefreshPhysics physics)
a builder for attaching refresh function with the physics
RequestEncoder = FutureOr<List<int>> Function(String request, RequestOptions options)
The type of a request encoding callback.
ResponseDecoder = FutureOr<String?> Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
The type of a response decoding callback.
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)
The type of a response status code validate callback.
VoidFutureCallBack = Future<void> Function()

Exceptions / Errors

BaseException
Base class for any RestApiClient exception that might happen during http requests/responses
DioException
DioException describes the exception info when a request failed.
ForbiddenException
Derived exception class that represents any server error
NetworkErrorException
Derived exception class that represents any network related error
NotNullableError<T>
A TypeError thrown by _checkNotNullable.
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