flutter_common library

Classes

ArcClipper
AsObservableFuture<T>
A future that can be converted directly to an Observable using the asObservable method. [...]
BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
BehaviorSubject<T>
A special StreamController that captures the latest item that has been added to the controller, and emits that as the first item to any new listener. [...]
BottomMenu
BufferCountStreamTransformer<T>
Buffers a number of values from the source Observable by count then emits the buffer and clears it, and starts a new buffer each startBufferEvery values. If startBufferEvery is not provided, then new buffers are started immediately at the start of the source and when each buffer closes and is emitted. [...]
BufferStreamTransformer<T>
Creates an Observable where each item is a List containing the items from the source sequence. [...]
BufferTestStreamTransformer<T>
Creates an Observable where each item is a List containing the items from the source sequence, batched whenever test passes. [...]
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.
CombineLatestStream<T, R>
Merges the given Streams into one Stream sequence by using the combiner function whenever any of the source stream sequences emits an item. [...]
CommonApp
CommonArcClip
CommonArcClipOrientation
CommonAspectRatio
CommonBiometrics
CommonBottomMenu
CommonBottomMenuItem
CommonBottomModal
CommonColor
CommonConstant
CommonCrypto
CommonDevice
CommonDialog
CommonFile
CommonFileSelector
CommonHttp
CommonLaunch
CommonListFilter
CommonListMenu
CommonListMenuInfo
CommonLoadingView
CommonLoadMoreView
CommonNavigatorBar
CommonNetworkImageView
CommonSlideView
CommonSp
CommonSystem
CommonTime
CommonToast
CommonWebView
CompositeSubscription
Acts as a container for multiple subscriptions that can be canceled at once e.g. view subcriptions in Flutter that need to be canceled on view disposal [...]
ConcatEagerStream<T>
Concatenates all of the specified stream sequences, as long as the previous stream sequence terminated successfully. [...]
ConcatStream<T>
Concatenates all of the specified stream sequences, as long as the previous stream sequence terminated successfully. [...]
ConnectableObservable<T>
A ConnectableObservable resembles an ordinary Observable, except that it can be listened to multiple times and does not begin emitting items when it is listened to, but only when its connect method is called. [...]
ConnectableObservableStreamSubscription<T>
A special StreamSubscription that not only cancels the connection to the source Stream, but also closes down a subject that drives the Stream.
ConsoleOutput
Default implementation of LogOutput. [...]
CookieManager
DebounceStreamTransformer<T>
Transforms a Stream so that will only emit items from the source sequence if a window has completed, without the source sequence emitting another item. [...]
DebugFilter
Default implementation of LogFilter. [...]
DefaultHttpClientAdapter
The default HttpClientAdapter for Dio is DefaultHttpClientAdapter.
DefaultIfEmptyStreamTransformer<T>
Emit items from the source Stream, or a single default item if the source Stream emits nothing. [...]
DefaultTransformer
DeferStream<T>
The defer factory waits until an observer subscribes to it, and then it creates an Observable with the given factory function. [...]
DelayStreamTransformer<T>
The Delay operator modifies its source Observable by pausing for a particular increment of time (that you specify) before emitting each of the source Observable’s items. This has the effect of shifting the entire sequence of items emitted by the Observable forward in time by that specified increment. [...]
DematerializeStreamTransformer<T>
Converts the onData, onDone, and onError Notification objects from a materialized stream into normal onData, onDone, and onError events. [...]
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use. [...]
DioHttpHeaders
DistinctUniqueStreamTransformer<T>
Create an Observable which implements a HashSet under the hood, using the provided equals as equality. [...]
DoStreamTransformer<T>
Invokes the given callback at the corresponding point the the stream lifecycle. For example, if you pass in an onDone callback, it will be invoked when the stream finishes emitting items. [...]
ErrorAndStacktrace
ErrorStream<T>
Returns an observable sequence that emits an error, then immediately completes. [...]
ExhaustMapStreamTransformer<T, S>
Converts items from the source stream into a new Stream using a given mapper. It ignores all items from the source stream until the new stream completes. [...]
FileOutput
Writes the log output to a file.
FlatMapStreamTransformer<T, S>
Converts each emitted item into a new Stream using the given mapper function. The newly created Stream will be be listened to and begin emitting items downstream. [...]
ForkJoinStream<T, R>
This operator is best used when you have a group of observables and only care about the final emitted value of each. One common use case for this is if you wish to issue multiple requests on page load (or some other event) and only want to take action when a response has been received for all. [...]
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
GroupByObservable<T, S>
GroupByStreamTransformer<T, S>
The GroupBy operator divides an Observable that emits items into an Observable that emits GroupByObservable, each one of which emits some subset of the items from the original source Observable. [...]
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient. [...]
IgnoreElementsStreamTransformer<T>
Creates an Observable where all emitted items are ignored, only the error / completed notifications are passed [...]
Interceptor
Dio instance may have interceptor(s) by which you can intercept requests or responses before they are handled by then or catchError.
Interceptors
InterceptorsWrapper
IntervalStreamTransformer<T>
Creates a Stream that emits each item in the Stream after a given duration. [...]
ListeningBuilder
Widget that rebuilds part of the widget tree whenever the listenable changes. [...]
Lock
Add lock/unlock API for interceptors.
Log
LogEvent
LogFilter
An abstract filter of log messages. [...]
Logger
Use instances of logger to send log messages to the LogPrinter.
LogInterceptor
LogOutput
Log output receives a OutputEvent from LogPrinter and sends it to the desired destination. [...]
LogPrinter
An abstract handler of log events. [...]
MapToStreamTransformer<S, T>
Emits the given constant value on the output Observable every time the source Observable emits a value. [...]
MaterializeStreamTransformer<T>
Converts the onData, on Done, and onError events into Notification objects that are passed into the downstream onData listener. [...]
MemoryOutput
Buffers OutputEvents.
MergeStream<T>
Flattens the items emitted by the given streams into a single Observable sequence. [...]
NeverStream<T>
Returns a non-terminating observable sequence, which can be used to denote an infinite duration. [...]
Notification<T>
A class that encapsulates the Kind of event, value of the event in case of onData, or the Error in the case of onError. A container object that wraps the Kind of event (OnData, OnDone, OnError), and the item or error that was emitted. In the case of onDone, no data is emitted as part of the Notification.
Observable<T>
A wrapper class that extends Stream. It combines all the Streams and StreamTransformers contained in this library into a fluent api. [...]
OfTypeStreamTransformer<T, S>
Filters a sequence so that only events of a given type pass [...]
OnErrorResumeStreamTransformer<T>
Intercepts error events and switches to a recovery stream created by the provided recoveryFn function. [...]
Options
Every request can pass an Options object which will be merged with Dio.options
OutputEvent
PairwiseStreamTransformer<T>
Emits the n-th and n-1th events as a pair.. [...]
PlaceHolderView
PrettyPrinter
Default implementation of LogPrinter. [...]
ProductionFilter
Prints all logs with level >= Logger.level even in production.
Provide<T>
A widget that obtains the given value from the nearest provider and rebuilds using the builder whenever it changes. [...]
ProvidedValues
A container for the values passed to the MultiValueBuilder.
ProvideMulti
Widget that rebuilds on change using multiple values provided by a ProviderNode. [...]
Provider<T>
A Provider provides a value on request. [...]
ProviderNode
ProviderNode makes a set of providers available to any widgets below it in the widget tree. [...]
Providers
Providers are the values passed to the ProviderNodes. [...]
ProviderScope
A ProviderScope provides a separate type-space for a provider, thus allowing more than one provider of the same type. [...]
PublishConnectableObservable<T>
A ConnectableObservable that converts a single-subscription Stream into a broadcast Stream.
PublishSubject<T>
Exactly like a normal broadcast StreamController with one exception: stream returns an Observable instead of a Stream. [...]
RaceStream<T>
Given two or more source streams, emit all of the items from only the first of these streams to emit an item or notification. [...]
RangeStream
Returns a Stream that emits a sequence of Integers within a specified range. [...]
RepeatStream<T>
Creates a Stream that will recreate and re-listen to the source Stream the specified number of times until the Stream terminates successfully. [...]
ReplayConnectableObservable<T>
A ConnectableObservable that converts a single-subscription Stream into a broadcast Stream that replays emitted items to any new listener, and provides synchronous access to the list of emitted values.
ReplayObservable<T>
An Observable that provides synchronous access to the emitted values
ReplaySubject<T>
A special StreamController that captures all of the items that have been added to the controller, and emits those as the first items to any new listener. [...]
RequestOptions
Response<T>
Response describes the http Response info.
ResponseBody
Result<T>
RetryStream<T>
Creates a Stream that will recreate and re-listen to the source Stream the specified number of times until the Stream terminates successfully. [...]
RetryWhenStream<T>
Creates a Stream that will recreate and re-listen to the source Stream when the notifier emits a new value. If the source Stream emits an error or it completes, the Stream terminates. [...]
SampleStreamTransformer<T>
A StreamTransformer that, when the specified window Stream emits an item or completes, emits the most recently emitted item (if any) emitted by the source Stream since the previous emission from the sample Stream. [...]
ScanStreamTransformer<T, S>
Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. [...]
SequenceEqualStream<S, T>
Determine whether two Observables emit the same sequence of items. You can provide an optional equals handler to determine equality. [...]
SimplePrinter
Outputs simple log messages: [...]
SkipUntilStreamTransformer<T, S>
Starts emitting items only after the given stream emits an item. [...]
StartWithManyStreamTransformer<T>
Prepends a sequence of values to the source Stream. [...]
StartWithStreamTransformer<T>
Prepends a value to the source Stream. [...]
StreamMaxFuture<T>
Converts a Stream into a Future that completes with the largest item emitted by the Stream. [...]
StreamMinFuture<T>
Converts a Stream into a Future that completes with the smallest item emitted by the Stream. [...]
Subject<T>
The base for all Subjects. If you'd like to create a new Subject, extend from this class. [...]
SwitchIfEmptyStreamTransformer<T>
When the original observable emits no items, this operator subscribes to the given fallback stream and emits items from that observable instead. [...]
SwitchLatestStream<T>
Convert a Stream that emits Streams (aka a "Higher Order Stream") into a single Stream that emits the items emitted by the most-recently-emitted of those Streams. [...]
SwitchMapStreamTransformer<T, S>
Converts each emitted item into a new Stream using the given mapper function. The newly created Stream will be be listened to and begin emitting items, and any previously created Stream will stop emitting. [...]
TakeUntilStreamTransformer<T, S>
Returns the values from the source observable sequence until the other stream sequence produces a value. [...]
ThrottleStreamTransformer<T>
A StreamTransformer that emits only the first item emitted by the source Stream while the window Stream is open. [...]
TimeInterval<T>
TimeIntervalStreamTransformer<T>
Records the time interval between consecutive values in an observable sequence. [...]
TimerStream<T>
Emits the given value after a specified amount of time. [...]
Timestamped<T>
TimeStampOfDay
TimestampStreamTransformer<T>
Wraps each item emitted by the source Observable in a Timestamped object that includes the emitted item and the time when the item was emitted. [...]
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server. This is only applicable for request methods 'PUT', 'POST', and 'PATCH'. [...]
TypedProvider<T>
Base mixin for providers.
TypeToken<S>
A class that captures the Type to filter down to using ofType or cast. [...]
UploadFileInfo
Describes the info of file to upload.
ValueConnectableObservable<T>
A ConnectableObservable that converts a single-subscription Stream into a broadcast Stream that replays the latest value to any new listener, and provides synchronous access to the latest emitted value.
ValueObservable<T>
An Observable that provides synchronous access to the last emitted item
WhereTypeStreamTransformer<S, T>
This transformer is a shorthand for Stream.where followed by Stream.cast. [...]
WindowCountStreamTransformer<T>
Buffers a number of values from the source Observable by count then emits the buffer as a Stream and clears it, and starts a new buffer each startBufferEvery values. If startBufferEvery is not provided, then new buffers are started immediately at the start of the source and when each buffer closes and is emitted. [...]
WindowStreamTransformer<T>
Creates an Observable where each item is a Stream containing the items from the source sequence. [...]
WindowTestStreamTransformer<T>
Creates an Observable where each item is a Stream containing the items from the source sequence, batched whenever test passes. [...]
WithLatestFromStreamTransformer<T, S, R>
A StreamTransformer that emits when the source stream emits, combining the latest values from the two streams using the provided function. [...]
WrappedFuture<T>
A future that simply wraps another Future. [...]
ZipStream<T, R>
Merges the specified streams into one observable sequence using the given zipper function whenever all of the observable sequences have produced an element at a corresponding index. [...]

Constants

kBool → const TypeToken<bool>
Filter the observable to only Booleans
const TypeToken<bool>()
kDouble → const TypeToken<double>
Filter the observable to only Doubles
const TypeToken<double>()
kInt → const TypeToken<int>
Filter the observable to only Integers
const TypeToken<int>()
kNum → const TypeToken<num>
Filter the observable to only Numbers
const TypeToken<num>()
kString → const TypeToken<String>
Filter the observable to only Strings
const TypeToken<String>()
kSymbol → const TypeToken<Symbol>
Filter the observable to only Symbols
const TypeToken<Symbol>()

Functions

log(dynamic msg) → void
pop<T extends Object>(BuildContext context, [ T result ]) → bool
push(BuildContext context, Widget widget) → Future
pushAndRemove(BuildContext context, Widget widget) → Future

Enums

CommonLoadMoreState
DioErrorType
Kind
The type of event
Level
Levels to control logging output. Logging can be enabled to include all levels above certain Level.
ResponseType
ResponseType indicates which transformation should be automatically applied to the response data by Dio.

Typedefs

CancelWrapper(Future) → Future
InterceptorErrorCallback(DioError e) → dynamic
InterceptorSendCallback(RequestOptions options) → dynamic
InterceptorSuccessCallback(Response e) → dynamic
JsonDecodeCallback(String) → dynamic
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.
LogCallback(LogEvent event) → void
MultiValueBuilder(BuildContext context, Widget child, ProvidedValues values) Widget
Builds a child for a ProvideMulti widget.
OnHttpClientCreate(HttpClient client) → dynamic
OutputCallback(OutputEvent event) → void
ProgressCallback(int count, int total) → void
Callback to listen the progress for sending/receiving data. [...]
ProviderFunction<T>(BuildContext context) → T
Function that returns an instance of T when called.
RequestEncoder(String request, RequestOptions options) → List<int>
ResponseDecoder(List<int> responseBytes, RequestOptions options, ResponseBody responseBody) → String
RetryWhenStreamFactory(dynamic error, StackTrace stack) → Stream<void>
ValidateStatus(int status) → bool
ValueBuilder<T>(BuildContext context, Widget child, T value) Widget
Builds a child for a Provide widget.
VoidCallback() → dynamic

Exceptions / Errors

DioError
DioError describes the error info when request failed.
RetryError