flutter_common library

Classes

AnsiColor
This class handles colorizing of terminal output.
ArcClipper
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 Stream 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 a Stream where each item is a List containing the items from the source sequence. [...]
BufferTestStreamTransformer<T>
Creates a Stream 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
CommonNetwork
CommonNetworkImageView
CommonSlideView
CommonSp
CommonString
CommonSystem
CommonTime
CommonToast
CommonWebView
CompositeSubscription
Acts as a container for multiple subscriptions that can be canceled at once e.g. view subscriptions 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. [...]
ConnectableStream<T>
A ConnectableStream resembles an ordinary Stream, 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. [...]
ConnectableStreamSubscription<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. [...]
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. [...]
DefaultIfEmptyStreamTransformer<S>
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 a listener subscribes to it, and then it creates a Stream with the given factory function. [...]
DelayStreamTransformer<S>
The Delay operator modifies its source Stream by pausing for a particular increment of time (that you specify) before emitting each of the source Stream’s items. This has the effect of shifting the entire sequence of items emitted by the Stream forward in time by that specified increment. [...]
DematerializeStreamTransformer<S>
Converts the onData, onDone, and onError Notification objects from a materialized stream into normal onData, onDone, and onError events. [...]
DevelopmentFilter
Prints all logs with level >= Logger.level while in development mode (eg when asserts are evaluated, Flutter calls this debug mode). [...]
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use. [...]
DioMixin
DistinctUniqueStreamTransformer<S>
Create a Stream which implements a HashSet under the hood, using the provided equals as equality. [...]
DoStreamTransformer<S>
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. [...]
EndWithManyStreamTransformer<S>
Appends a sequence of values to the source Stream. [...]
EndWithStreamTransformer<S>
Appends a value to the source Stream before closing. [...]
ErrorAndStacktrace
An Object which acts as a tuple containing both an error and the corresponding stack trace.
ExhaustMapStreamTransformer<S, T>
Converts events 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. [...]
FlatMapStreamTransformer<S, T>
Converts each emitted item into a new Stream using the given mapper function. The newly created Stream will be listened to and begin emitting items downstream. [...]
ForkJoinStream<T, R>
This operator is best used when you have a group of streams 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.
GroupByStream<T, S>
The Stream used by GroupByStreamTransformer, it contains events that are grouped by a key value.
GroupByStreamTransformer<S, T>
The GroupBy operator divides a Stream that emits items into a Stream that emits GroupByStream, each one of which emits some subset of the items from the original source Stream. [...]
Headers
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient. [...]
HybridPrinter
A decorator for a LogPrinter that allows for the composition of different printers to handle different log messages. Provide it's constructor with a base printer, but include named parameters for any levels that have a different printer: [...]
IgnoreElementsStreamTransformer<S>
Creates a Stream 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<S>
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. [...]
LogfmtPrinter
Outputs a logfmt message: [...]
Logger
Use instances of logger to send log messages to the LogPrinter.
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.
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 Stream every time the source Stream emits a value. [...]
MaterializeStreamTransformer<S>
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 Stream sequence. [...]
MultiOutput
Logs simultaneously to multiple LogOutput outputs.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file. [...]
NeverStream<T>
Returns a non-terminating stream 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.
OnErrorResumeStreamTransformer<S>
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
PrefixPrinter
A decorator for a LogPrinter that allows for the prepending of every line in the log output with a string for the level of that log. For example: [...]
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. [...]
PublishConnectableStream<T>
A ConnectableStream that converts a single-subscription Stream into a broadcast Stream.
PublishSubject<T>
Exactly like a normal broadcast StreamController with one exception: this class is both a Stream and Sink. [...]
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. [...]
RedirectRecord
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. [...]
ReplayConnectableStream<T>
A ConnectableStream 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.
ReplayStream<T>
An Stream 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. [...]
Rx
A utility class that provides static methods to create the various Streams provided by RxDart. [...]
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<S, T>
Applies an accumulator function over an stream sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. [...]
SequenceEqualStream<S, T>
Determine whether two Streams emit the same sequence of items. You can provide an optional equals handler to determine equality. [...]
SimplePrinter
Outputs simple log messages: [...]
SkipUntilStreamTransformer<S, T>
Starts emitting events only after the given stream emits an event. [...]
StartWithManyStreamTransformer<S>
Prepends a sequence of values to the source Stream. [...]
StartWithStreamTransformer<S>
Prepends a value to the source Stream. [...]
StreamOutput
Subject<T>
The base for all Subjects. If you'd like to create a new Subject, extend from this class. [...]
SwitchIfEmptyStreamTransformer<S>
When the original stream emits no items, this operator subscribes to the given fallback stream and emits items from that stream 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<S, T>
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<S, T>
Returns the values from the source stream sequence until the other stream sequence produces a value. [...]
TakeWhileInclusiveStreamTransformer<S>
Emits values emitted by the source Stream so long as each value satisfies the given test. When the test is not satisfied by a value, it will emit this value as a final event and then complete. [...]
ThrottleStreamTransformer<T>
A StreamTransformer that emits only the first item emitted by the source Stream while the window Stream is open. [...]
TimeInterval<T>
A class that represents a snapshot of the current value emitted by a Stream, at a specified interval.
TimeIntervalStreamTransformer<S>
Records the time interval between consecutive values in an stream sequence. [...]
TimerStream<T>
Emits the given value after a specified amount of time. [...]
Timestamped<T>
A class that represents a snapshot of the current value emitted by a Stream, at a specified timestamp.
TimeStampOfDay
TimestampStreamTransformer<S>
Wraps each item emitted by the source Stream 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. [...]
Translations
TranslationsDelegate
TypedProvider<T>
Base mixin for providers.
ValueConnectableStream<T>
A ConnectableStream 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.
ValueStream<T>
An Stream 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 Stream 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 a Stream where each item is a Stream containing the items from the source sequence. [...]
WindowTestStreamTransformer<T>
Creates a Stream where each item is a Stream containing the items from the source sequence, batched whenever test passes. [...]
WithLatestFromStreamTransformer<S, T, R>
A StreamTransformer that emits when the source stream emits, combining the latest values from the two streams using the provided function. [...]
ZipStream<T, R>
Merges the specified streams into one stream sequence using the given zipper Function whenever all of the stream sequences have produced an element at a corresponding index. [...]

Extensions

AddToCompositeSubscriptionExtension
Extends the StreamSubscription class with the ability to be added to CompositeSubscription container.
BufferExtensions
Extends the Stream class with the ability to buffer events in various ways
ConcatExtensions
Extends the Stream class with the ability to concatenate one stream with another.
ConnectableStreamExtensions
Extends the Stream class with the ability to transform a single-subscription Stream into a ConnectableStream.
DebounceExtensions
Extends the Stream class with the ability to debounce events in various ways
DefaultIfEmptyExtension
DelayExtension
Extends the Stream class with the ability to delay events being emitted
DematerializeExtension
Converts the onData, onDone, and onError Notifications from a materialized stream into normal onData, onDone, and onError events.
DistinctUniqueExtension
Extends the Stream class with the ability to skip items that have previously been emitted.
DoExtensions
Extends the Stream class with the ability to execute a callback function at different points in the Stream's lifecycle.
EndWithExtension
Extends the Stream class with the ability to emit the given value as the final item before closing.
EndWithManyExtension
Extends the Stream class with the ability to emit the given value as the final item before closing.
ExhaustMapExtension
Extends the Stream class with the ability to transform the Stream into a new Stream. The new Stream emits items and ignores events from the source Stream until the new Stream completes.
FlatMapExtension
Extends the Stream class with the ability to convert the source Stream into a new Stream each time the source emits an item.
GroupByExtension
Extends the Stream class with the ability to convert events into Streams of events that are united by a key.
IgnoreElementsExtension
Extends the Stream class with the ability to skip, or ignore, data events.
IntervalExtension
Extends the Stream class with the ability to emit each item after a given duration.
MapToExtension
Extends the Stream class with the ability to convert each item to the same value.
MaterializeExtension
Extends the Stream class with the ability to convert the onData, on Done, and onError events into Notifications that are passed into the downstream onData listener.
MaxExtension
Extends the Stream class with the ability to transform into a Future that completes with the largest item emitted by the Stream.
MergeExtension
Extends the Stream class with the ability to merge one stream with another.
MinExtension
Extends the Stream class with the ability to transform into a Future that completes with the smallest item emitted by the Stream.
OnErrorExtensions
Extends the Stream class with the ability to recover from errors in various ways
PairwiseExtension
Extends the Stream class with the ability to emit the nth and n-1th events as a pair
SampleExtensions
Extends the Stream class with the ability to sample events from the Stream
ScanExtension
Extends
SkipUntilExtension
Extends the Stream class with the ability to skip events until another Stream emits an item.
StartWithExtension
Extends the Stream class with the ability to emit the given value as the first item.
StartWithManyExtension
Extends the Stream class with the ability to emit the given values as the first items.
SwitchIfEmptyExtension
Extend the Stream class with the ability to return an alternative Stream if the initial Stream completes with no items.
SwitchMapExtension
Extends the Stream with the ability to convert one stream into a new Stream whenever the source emits an item. Every time a new Stream is created, the previous Stream is discarded.
TakeUntilExtension
Extends the Stream class with the ability receive events from the source Stream until another Stream produces a value.
TakeWhileInclusiveExtension
Extends the Stream class with the ability to take events while they pass the condition given and include last event that doesn't pass the condition.
ThrottleExtensions
Extends the Stream class with the ability to throttle events in various ways
TimeIntervalExtension
Extends the Stream class with the ability to record the time interval between consecutive values in an stream
TimeStampExtension
Extends the Stream class with the ability to wrap each item emitted by the source Stream in a Timestamped object that includes the emitted item and the time when the item was emitted.
WhereTypeExtension
Extends the Stream class with the ability to filter down events to only those of a specific type.
WindowExtensions
Extends the Stream class with the ability to window
WithLatestFromExtensions
Extends the Stream class with the ability to merge the source Stream with the last emitted item from another Stream.
ZipWithExtension
Extends the Stream class with the ability to zip one Stream with another.

Functions

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

Enums

CommonLoadMoreState
DioErrorType
Kind
The type of event used in Notification
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
EnqueueCallback() FutureOr
HeaderForEachCallback(String name, List<String> values) → void
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
@Deprecated('Use a custom LogFilter instead')
MultiValueBuilder(BuildContext context, Widget child, ProvidedValues values) Widget
Builds a child for a ProvideMulti widget.
OutputCallback(OutputEvent event) → void
@Deprecated('Use a custom LogOutput instead')
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
An Error which can be thrown by a retry Stream.