ext library

Classes

BackgroundTransformer
The default Transformer for Dio.
BaseOptions
A set of base settings for each Dio(). BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
BoolList
A space-efficient list of boolean values.
BrowserConfiguration
Additional configuration options for LaunchMode.inAppBrowserView
CancelToken
Controls cancellation of Dio's requests.
CanonicalizedMap<C, K, V>
A map whose keys are converted to canonical values of type C.
CarouselIndicator
CaseInsensitiveEquality
String equality that's insensitive to differences in ASCII case.
ChangeNotifierProvider<T extends ChangeNotifier?>
Listens to a ChangeNotifier, expose it to its descendants and rebuilds dependents whenever ChangeNotifier.notifyListeners is called.
ChangeNotifierProxyProvider<T, R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChangeNotifierProxyProvider0<R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChangeNotifierProxyProvider2<T, T2, R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChangeNotifierProxyProvider3<T, T2, T3, R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChangeNotifierProxyProvider4<T, T2, T3, T4, R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChangeNotifierProxyProvider5<T, T2, T3, T4, T5, R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChangeNotifierProxyProvider6<T, T2, T3, T4, T5, T6, R extends ChangeNotifier?>
A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
ChildObstructionExtent
ColorTabIndicator
CombinedIterableView<T>
A view of several iterables combined sequentially into a single iterable.
CombinedListView<T>
A view of several lists combined into a single list.
CombinedMapView<K, V>
Returns a new map that represents maps flattened into a single map.
Consumer<T>
Obtains Provider<T> from its ancestors and passes its value to builder.
Consumer2<A, B>
Obtains Provider<T> from its ancestors and passes its value to builder.
Consumer3<A, B, C>
Obtains Provider<T> from its ancestors and passes its value to builder.
Consumer4<A, B, C, D>
Obtains Provider<T> from its ancestors and passes its value to builder.
Consumer5<A, B, C, D, E>
Obtains Provider<T> from its ancestors and passes its value to builder.
Consumer6<A, B, C, D, E, F>
Obtains Provider<T> from its ancestors and passes its value to builder.
DeepCollectionEquality
Deep equality on collections.
DefaultEquality<E>
Equality of objects that compares only the natural equality of the objects.
DeferredInheritedProvider<T, R>
An InheritedProvider where the object listened is not the object emitted.
DelegatingIterable<E>
An Iterable that delegates all operations to a base iterable.
DelegatingList<E>
A List that delegates all operations to a base list.
DelegatingMap<K, V>
A Map that delegates all operations to a base map.
DelegatingQueue<E>
A Queue that delegates all operations to a base queue.
DelegatingSet<E>
A Set that delegates all operations to a base set.
Dio
Dio enables you to make HTTP requests easily.
DioMixin
DragHoldController
ElLinkedList<N extends ElLinkedNode<N>>
双向链表
ElLinkedNode<N extends ElLinkedNode<N>>
双向链表节点对象,你需要继承此类才能在 ElLinkedList 中使用:
Equality<E>
A generic equality relation on objects.
EqualityBy<E, F>
Equality of objects based on derived values.
EqualityMap<K, V>
A Map whose key equality is determined by an Equality object.
EqualitySet<E>
A Set whose key equality is determined by an Equality object.
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
ExtendedPageView
ExtendedScrollable
Provide a way for contents get hit test when it's scrolling
ExtendedScrollableState
ExtendedTab
ExtendedTabBar
ExtendedTabBarView
ExtendedTabBarViewState
ExtendedUnderlineTabIndicator
Used with TabBar.indicator to draw a horizontal line below the selected tab.
ExtentPrecalculationContext
ExtentPrecalculationPolicy
Subclass of ExtentPrecalculationPolicy can be used to control whether and how many extents of the items in the list should be eagerly precalculated.
ExtentPrecalculationPolicyDelegate
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
FusedTransformer
A Transformer that has a fast path for decoding UTF8-encoded JSON. If the response is utf8-encoded JSON and no custom decoder is specified in the RequestOptions, this transformer is significantly faster than the default SyncTransformer and the BackgroundTransformer. This improvement is achieved by using a fused Utf8Decoder and JsonDecoder to decode the response, which is faster than decoding the utf8-encoded JSON in two separate steps, since Dart uses a special fast decoder for this case. See https://github.com/dart-lang/sdk/blob/5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9/sdk/lib/_internal/vm/lib/convert_patch.dart#L40
FutureProvider<T>
Listens to a Future and exposes its result to child and its descendants.
Gap
A widget that takes a fixed amount of space in the direction of its parent.
GestureStateMixin<T extends StatefulWidget>
Headers
The headers class for requests and responses.
HeapPriorityQueue<E>
Heap based priority queue.
Hook<R>
Hook is similar to a StatelessWidget, but is not associated to an Element.
HookBuilder
A HookWidget that delegates its build to a callback.
HookState<R, T extends Hook<R>>
The logic and internal state for a HookWidget
HookWidget
A Widget that can use a Hook.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
IdentityEquality<E>
Equality of objects that compares only the identity of the objects.
Immutable
Annotation on an immutable class.
InheritedContext<T>
A BuildContext associated to an InheritedProvider.
InheritedProvider<T>
A generic implementation of an InheritedWidget.
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.
IterableEquality<E>
Equality on iterables.
IterableZip<T>
Iterable that iterates over lists of values from other iterables.
LessSpringClampingScrollPhysics
A widget that renders a real link on the web, and uses WebViews in native platforms to open links.
LinkPageController
The LinkPageController to scroll Pages(PageView or TabBarView) when FlexGrid is reach the horizontal boundary
LinkScrollController
The LinkScrollController to sync pixels for all of positions
LinkScrollState<T extends StatefulWidget>
class MyWidget extends StatefulWidget { const MyWidget({Key? key}) : super(key: key);
LinkTarget
Defines where a Link URL should be open.
ListController
Interface to the sliver list.
ListenableProvider<T extends Listenable?>
Listens to a Listenable, expose it to its descendants and rebuilds dependents whenever the listener emits an event.
ListenableProxyProvider<T, R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListenableProxyProvider0<R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListenableProxyProvider2<T, T2, R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListenableProxyProvider3<T, T2, T3, R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListenableProxyProvider4<T, T2, T3, T4, R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListenableProxyProvider5<T, T2, T3, T4, T5, R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListenableProxyProvider6<T, T2, T3, T4, T5, T6, R extends Listenable?>
A variation of ListenableProvider that builds its value from values obtained from other providers.
ListEquality<E>
Equality on lists.
ListParam<T>
Indicates a param being used as queries or form data, and how does it gets formatted.
ListSlice<E>
A list view of a range of another list.
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.
MapEquality<K, V>
Equality on maps.
MapKeySet<E>
An unmodifiable Set view of the keys of a Map.
MapValueSet<K, V>
Creates a modifiable Set view of the values of a Map.
MaxGap
A widget that takes, at most, an amount of space in a Row, Column, or Flex widget.
MultiEquality<E>
Combines several equalities into a single equality.
MultipartFile
An upload content that is a part of MultipartRequest. This doesn't need to correspond to a physical file.
MultiProvider
A provider that merges multiple providers into a single linear widget tree. It is used to improve readability and reduce boilerplate code of having to nest multiple layers of providers.
NeverScrollableClampingScrollPhysics
NonGrowableListMixin<E>
Mixin class that implements a throwing version of all list operations that change the List's length.
NonGrowableListView<E>
A fixed-length list.
ObjectRef<T>
A class that stores a single value.
OffsetToRevealContext
Options
The configuration for a single request. BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
PriorityQueue<E>
A priority queue is a priority based work-list of elements.
Provider<T>
A Provider that manages the lifecycle of the value it provides by delegating to a pair of Create and Dispose.
ProviderBinding
ProxyProvider<T, R>
A provider that builds a value based on other providers.
ProxyProvider0<R>
A provider that builds a value based on other providers.
ProxyProvider2<T, T2, R>
A provider that builds a value based on other providers.
ProxyProvider3<T, T2, T3, R>
A provider that builds a value based on other providers.
ProxyProvider4<T, T2, T3, T4, R>
A provider that builds a value based on other providers.
ProxyProvider5<T, T2, T3, T4, T5, R>
A provider that builds a value based on other providers.
ProxyProvider6<T, T2, T3, T4, T5, T6, R>
A provider that builds a value based on other providers.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create QueuedInterceptor in ease.
QueueList<E>
A class that efficiently implements both Queue and List.
ReassembleHandler
If you need your provider to be notified when 'Hot Reload' occurs, use this class
RecordUse
Annotation on a statically resolved member or class whose usages will be recorded.
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
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.
Required
Annotation on a required named parameter.
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.
Selector<A, S>
An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
Selector0<T>
A base class for custom Selector.
Selector2<A, B, S>
An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
Selector3<A, B, C, S>
An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
Selector4<A, B, C, D, S>
An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
Selector5<A, B, C, D, E, S>
An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
Selector6<A, B, C, D, E, F, S>
An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
SetEquality<E>
Equality of sets.
SliverGap
A sliver that takes a fixed amount of space.
StatefulHookWidget
A StatefulWidget that can use a Hook.
Store<StateT, ActionT>
A store of mutable state that allows mutations by dispatching actions.
StreamProvider<T>
Listens to a Stream and exposes its content to child and descendants.
SuperListView
This is a drop-in replacement Flutter ListView that provides much better performance with large number of children with variable extents. Unlike ListView the performance does not depend on the number of children and the list can easily handle tens or hundreds of thousands of children without having to specify hardcoded extent or prototype child.
SuperRangeMaintainingScrollPhysics
Regular RangeMaintainingScrollPhysics will not keep the scroll position in range when scroll position was corrected during the layout pass. That means removing elements from the list will cause the scroll position to animate when it normally wouldn't. As a workaround add SuperRangeMaintainingScrollPhysics to the physics chain.
SuperSliverList
Drop-in replacement for SliverList that can handle arbitrary large amount of items with variable extent.
SuperSliverListLayoutBudget
A layout budget controls how much of build time can be used for extent precalculation.
SyncScrollController
The SyncScrollController to sync pixels for all of positions
SyncScrollHandler
SyncScrollState<T extends StatefulWidget>
class MyWidget extends StatefulWidget { const MyWidget({Key? key}) : super(key: key);
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.
Target
An annotation used on classes that are intended to be used as annotations to indicate the kinds of declarations and directives for which the annotation is appropriate.
TargetKind
An enumeration of the kinds of targets to which an annotation can be applied.
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
UnionSet<E>
A single set that provides a view of the union over a set of sets.
UnionSetController<E>
A controller that exposes a view of the union of a collection of sets.
UnmodifiableListView<E>
An unmodifiable List view of another List.
UnmodifiableMapMixin<K, V>
Mixin class that implements a throwing version of all map operations that change the Map.
UnmodifiableMapView<K, V>
View of a Map that disallow modifying the map.
UnmodifiableSetMixin<E>
Mixin class that implements a throwing version of all set operations that change the Set.
UnmodifiableSetView<E>
An unmodifiable set.
UnorderedIterableEquality<E>
Equality of the elements of two iterables without considering order.
UseResult
Annotation on function or property whose value must not be ignored.
ValueListenableProvider<T>
Listens to a ValueListenable and exposes its current value.
WebViewConfiguration
Additional configuration options for LaunchMode.inAppWebView.

Enums

DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
FileAccessMode
The file access mode when downloading a file, corresponds to a subset of dart:io::FileMode.
LaunchMode
The desired mode to launch a URL.
ListFormat
Specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name). and the separator for array items.
ResponseType
Indicates which transformation should be applied to the response data.

Mixins

GestureMixin
HookElement
An Element that uses a HookWidget as its configuration.
LessSpringScrollPhysics
reduce animation time
LinkScrollControllerMixin
OptionsMixin
The mixin class for options that provides common attributes.
SyncScrollControllerMixin
The mixin for ScrollController to sync pixels for all of positions

Extensions

ComparatorExtension on Comparator<T>
Extensions on comparator functions.
ElDartDoubleExt on double
ElDartDurationExt on Duration
ElDartFuntionExt on Function
ElDartIntExt on int
ElDartIterableExt on Iterable<E>
ElDartListExt on List<E>
ElDartMapExt on Map<K, V>
ElDartOptionalExt on T?
对可能为 null 元素进行扩展
ElDartSetExt on Set<E>
ElDartStringExtension on String
IterableComparableExtension on Iterable<T>
Extensions that apply to iterables of Comparable elements.
IterableDoubleExtension on Iterable<double>
Extension on iterables of double.
IterableExtension on Iterable<T>
Extensions that apply to all iterables.
IterableIntegerExtension on Iterable<int>
Extension on iterables of integers.
IterableIterableExtension on Iterable<Iterable<T>>
Extensions on iterables whose elements are also iterables.
IterableNullableExtension on Iterable<T?>
Extensions that apply to iterables with a nullable element type.
IterableNumberExtension on Iterable<num>
Extensions that apply to iterables of numbers.
ListComparableExtensions on List<E>
Various extensions on lists of comparable elements.
ListExtensions on List<E>
Various extensions on lists of arbitrary elements.
ReadContext on BuildContext
Exposes the read method.
RenderObjectChildObstuctionExtent on RenderObject
RenderViewportExt on RenderAbstractViewport
SelectContext on BuildContext
Adds a select method on BuildContext.
SliverGeometryChildObstruction on SliverGeometry
WatchContext on BuildContext
Exposes the watch method.

Constants

alwaysThrows → const Object
Annotation marking a function as always throwing.
awaitNotRequired → const Object
Annotation on asynchronous function whose Future can be ignored.
checked → const Object
Annotation that no longer has any effect.
doNotStore → const Object
Annotation on function or property whose value must not be stored.
doNotSubmit → const Object
Annotation marking declaration that should be removed before publishing.
experimental → const Object
Annotation marking declaration as experimental and subject to change.
factory → const Object
Annotation on a function that creates new objects.
immutable → const Immutable
Annotation on an immutable class.
internal → const Object
Annotation on declaration that should not be used outside of its package.
isTest → const Object
Annotation on a test framework function that introduces a single test.
isTestGroup → const Object
Annotation on a test framework function that introduces a group of tests.
literal → const Object
Annotation on constructor that must be invoked with const if possible.
mustBeConst → const Object
Annotation on a parameter whose arguments must be constants.
mustBeOverridden → const Object
Annotation on instance members that must be overridden by subclasses.
mustCallSuper → const Object
Annotation on instance member that overriding members must call.
nonVirtual → const Object
Annotation on instance member that must not be overridden.
optionalTypeArgs → const Object
Annotation on type arguments that can safely be omitted.
protected → const Object
Annotation on instance member that should only be used by subclasses.
redeclare → const Object
Annotation on extension type members which redeclare superinterface members.
reopen → const Object
Annotation on declaration with less access restrictions than superinterface.
required → const Required
Annotation on named parameter that should always have an argument supplied.
sealed → const Object
Annotation on class that must not be subclassed outside of its package.
useResult → const UseResult
Annotation on function or property whose value must not be ignored.
useTextEditingController → const _TextEditingControllerHookCreator
Creates a TextEditingController, either via an initial text or an initial TextEditingValue.
virtual → const Object
Annotation which no longer has any effect.
visibleForOverriding → const Object
Annotation on declaration that should not be used outside of its package.
visibleForTesting → const Object
Annotation on a public declaration that should only be used in tests.

Properties

debugHotReloadHooksEnabled bool
Whether to behave like in release mode or allow hot-reload for hooks.
getter/setter pair

Functions

binarySearch<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns a position of the value in sortedList, if it is there.
canLaunch(String urlString) Future<bool>
Checks whether the specified URL can be handled by some app installed on the device.
canLaunchUrl(Uri url) Future<bool>
Checks whether the specified URL can be handled by some app installed on the device.
closeInAppWebView() Future<void>
Closes the current in-app web view, if one was previously opened by launchUrl.
closeWebView() Future<void>
Closes the current WebView, if one was previously opened via a call to launch.
compareAsciiLowerCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to lower case.
compareAsciiLowerCaseNatural(String a, String b) int
Compares strings a and b according to lower-case natural sort ordering.
compareAsciiUpperCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to upper case.
compareAsciiUpperCaseNatural(String a, String b) int
Compares strings a and b according to upper-case natural sort ordering.
compareNatural(String a, String b) int
Compares strings a and b according to natural sort ordering.
defaultDioExceptionReadableStringBuilder(DioException e) String
The default implementation of building a readable string of DioException.
equalsIgnoreAsciiCase(String a, String b) bool
Checks if strings a and b differ only on the case of ASCII letters.
groupBy<S, T>(Iterable<S> values, T key(S)) Map<T, List<S>>
Groups the elements in values by the value returned by key.
hashIgnoreAsciiCase(String string) int
Hash code for a string which is compatible with equalsIgnoreAsciiCase.
insertionSort<E>(List<E> elements, {int compare(E, E)?, int start = 0, int? end}) → void
Sort a list between start (inclusive) and end (exclusive) using insertion sort.
lastBy<S, T>(Iterable<S> values, T key(S)) Map<T, S>
Associates the elements in values by the value returned by key.
launch(String urlString, {bool? forceSafariVC, bool forceWebView = false, bool enableJavaScript = false, bool enableDomStorage = false, bool universalLinksOnly = false, Map<String, String> headers = const <String, String>{}, Brightness? statusBarBrightness, String? webOnlyWindowName}) Future<bool>
Parses the specified URL string and delegates handling of it to the underlying platform.
launchUrl(Uri url, {LaunchMode mode = LaunchMode.platformDefault, WebViewConfiguration webViewConfiguration = const WebViewConfiguration(), BrowserConfiguration browserConfiguration = const BrowserConfiguration(), String? webOnlyWindowName}) Future<bool>
Passes url to the underlying platform for handling.
lowerBound<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns the first position in sortedList that does not compare less than value.
mapMap<K1, V1, K2, V2>(Map<K1, V1> map, {K2 key(K1, V1)?, V2 value(K1, V1)?}) Map<K2, V2>
Creates a new map from map with new keys and values.
maxBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the maximum value.
mergeMaps<K, V>(Map<K, V> map1, Map<K, V> map2, {V value(V, V)?}) Map<K, V>
Returns a new map with all key/value pairs in both map1 and map2.
mergeSort<E>(List<E> elements, {int start = 0, int? end, int compare(E, E)?}) → void
Sorts a list between start (inclusive) and end (exclusive) using the merge sort algorithm.
minBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the minimum value.
reverse<E>(List<E> elements, [int start = 0, int? end]) → void
Reverses a list, or a part of a list, in-place.
shuffle(List elements, [int start = 0, int? end, Random? random]) → void
Shuffles a list randomly.
stronglyConnectedComponents<T>(Map<T, Iterable<T>> graph) List<Set<T>>
Returns the strongly connected components of graph, in topological order.
supportsCloseForLaunchMode(LaunchMode mode) Future<bool>
Returns true if closeInAppWebView is supported for mode in the current platform implementation.
supportsLaunchMode(LaunchMode mode) Future<bool>
Returns true if mode is supported by the current platform implementation.
transitiveClosure<T>(Map<T, Iterable<T>> graph) Map<T, Set<T>>
Returns the transitive closure of graph.
use<R>(Hook<R> hook) → R
Registers a Hook and returns its value.
useAnimation<T>(Animation<T> animation) → T
Subscribes to an Animation and returns its value.
useAnimationController({Duration? duration, Duration? reverseDuration, String? debugLabel, double initialValue = 0, double lowerBound = 0, double upperBound = 1, TickerProvider? vsync, AnimationBehavior animationBehavior = AnimationBehavior.normal, List<Object?>? keys}) AnimationController
Creates an AnimationController and automatically disposes it when necessary.
useAppLifecycleState() AppLifecycleState?
Returns the current AppLifecycleState value and rebuilds the widget when it changes.
useAutomaticKeepAlive({bool wantKeepAlive = true}) → void
Mark a widget using this hook as needing to stay alive even when it's in a lazy list that would otherwise remove it.
useCallback<T extends Function>(T callback, [List<Object?> keys = const <Object>[]]) → T
Cache a function across rebuilds based on a list of keys.
useCarouselController({int initialItem = 0, List<Object?>? keys}) CarouselController
Creates a CarouselController that will be disposed automatically.
useContext() BuildContext
Obtains the BuildContext of the building HookWidget.
useCupertinoTabController({int initialIndex = 0, List<Object?>? keys}) CupertinoTabController
Creates a CupertinoTabController that will be disposed automatically.
useDebounced<T>(T toDebounce, Duration timeout) → T?
Returns a debounced version of the provided value toDebounce, triggering widget updates accordingly after a specified timeout duration.
useDraggableScrollableController({List<Object?>? keys}) DraggableScrollableController
Creates a DraggableScrollableController that will be disposed automatically.
useEffect(Dispose? effect(), [List<Object?>? keys]) → void
Useful for side-effects and optionally canceling them.
useExpansibleController({List<Object?>? keys}) ExpansibleController
Creates a ExpansibleController that will be disposed automatically.
useExpansionTileController({List<Object?>? keys}) ExpansionTileController
Creates a ExpansionTileController that will be disposed automatically.
useFixedExtentScrollController({int initialItem = 0, ScrollControllerCallback? onAttach, ScrollControllerCallback? onDetach, List<Object?>? keys}) FixedExtentScrollController
Creates FixedExtentScrollController that will be disposed automatically.
useFocusNode({String? debugLabel, FocusOnKeyEventCallback? onKeyEvent, bool skipTraversal = false, bool canRequestFocus = true, bool descendantsAreFocusable = true, bool descendantsAreTraversable = true}) FocusNode
Creates an automatically disposed FocusNode.
useFocusScopeNode({String? debugLabel, FocusOnKeyEventCallback? onKeyEvent, bool skipTraversal = false, bool canRequestFocus = true}) FocusScopeNode
Creates an automatically disposed FocusScopeNode.
useFuture<T>(Future<T>? future, {T? initialData, bool preserveState = true}) AsyncSnapshot<T>
Subscribes to a Future and returns its current state as an AsyncSnapshot.
useIsMounted() IsMounted
Returns an IsMounted object that you can use to check if the State is mounted.
useListenable<T extends Listenable?>(T listenable) → T
Subscribes to a Listenable and marks the widget as needing build whenever the listener is called.
useListenableSelector<R>(Listenable? listenable, R selector()) → R
Rebuild only when there is a change in the selector result.
useMemoized<T>(T valueBuilder(), [List<Object?> keys = const <Object>[]]) → T
Caches the instance of a complex object.
useOnAppLifecycleStateChange(LifecycleCallback? onStateChanged) → void
Listens to the AppLifecycleState.
useOnListenableChange(Listenable? listenable, VoidCallback listener) → void
Adds a given listener to a Listenable and removes it when the hook is disposed.
useOnPlatformBrightnessChange(BrightnessCallback onBrightnessChange) → void
Listens to the platform Brightness.
useOnStreamChange<T>(Stream<T>? stream, {void onData(T event)?, void onError(Object error, StackTrace stackTrace)?, void onDone()?, bool? cancelOnError}) StreamSubscription<T>?
Subscribes to a Stream and calls the Stream.listen to register the onData, onError, and onDone.
useOverlayPortalController({List<Object?>? keys}) OverlayPortalController
Creates a OverlayPortalController that will be disposed automatically.
usePageController({int initialPage = 0, bool keepPage = true, double viewportFraction = 1.0, ScrollControllerCallback? onAttach, ScrollControllerCallback? onDetach, List<Object?>? keys}) PageController
Creates a PageController that will be disposed automatically.
usePlatformBrightness() Brightness
Returns the current platform Brightness value and rebuilds the widget when it changes.
usePrevious<T>(T val) → T?
Returns the previous value passed to usePrevious (from the previous widget build).
useReassemble(VoidCallback callback) → void
Runs the callback on every hot reload, similar to reassemble in the stateful widgets.
useReducer<StateT, ActionT>(Reducer<StateT, ActionT> reducer, {required StateT initialState, required ActionT initialAction}) Store<StateT, ActionT>
An alternative to useState for more complex states.
useRef<T>(T initialValue) ObjectRef<T>
Creates an object that contains a single mutable property.
useScrollController({double initialScrollOffset = 0.0, bool keepScrollOffset = true, String? debugLabel, ScrollControllerCallback? onAttach, ScrollControllerCallback? onDetach, List<Object?>? keys}) ScrollController
Creates ScrollController that will be disposed automatically.
useSearchController({List<Object?>? keys}) SearchController
Creates a SearchController that will be disposed automatically.
useSingleTickerProvider({List<Object?>? keys}) TickerProvider
Creates a single usage TickerProvider.
useSnapshotController({bool allowSnapshotting = false}) SnapshotController
Creates and disposes a SnapshotController.
useState<T>(T initialData) ValueNotifier<T>
Creates a variable and subscribes to it.
useStream<T>(Stream<T>? stream, {T? initialData, bool preserveState = true}) AsyncSnapshot<T>
Subscribes to a Stream and returns its current state as an AsyncSnapshot.
useStreamController<T>({bool sync = false, VoidCallback? onListen, VoidCallback? onCancel, List<Object?>? keys}) StreamController<T>
Creates a StreamController which is automatically disposed when necessary.
useTabController({required int initialLength, Duration? animationDuration = kTabScrollDuration, TickerProvider? vsync, int initialIndex = 0, List<Object?>? keys}) TabController
Creates a TabController that will be disposed automatically.
useTransformationController({Matrix4? initialValue, List<Object?>? keys}) TransformationController
Creates and disposes a TransformationController.
useTreeSliverController() TreeSliverController
Creates a TreeSliverController that will be disposed automatically.
useValueChanged<T, R>(T value, R? valueChange(T oldValue, R? oldResult)) → R?
Watches a value and triggers a callback whenever the value changed.
useValueListenable<T>(ValueListenable<T> valueListenable) → T
Subscribes to a ValueListenable and returns its value.
useValueNotifier<T>(T initialData, [List<Object?>? keys]) ValueNotifier<T>
Creates a ValueNotifier that is automatically disposed.
useWidgetStatesController({Set<WidgetState>? values, List<Object?>? keys}) WidgetStatesController
Creates a WidgetStatesController that will be disposed automatically.

Typedefs

BrightnessCallback = FutureOr<void> Function(Brightness previous, Brightness current)
A callback triggered when the platform brightness changes.
Create<T> = T Function(BuildContext context)
A function that creates an object of type T.
DefaultTransformer = SyncTransformer
DeferredStartListening<T, R> = VoidCallback Function(InheritedContext<R?> context, void setState(R value), T controller, R? value)
A callback used to handle the subscription of controller.
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.
DioExceptionReadableStringBuilder = String Function(DioException e)
The readable string builder's signature of DioException.readableStringBuilder.
DioMediaType = MediaType
The type (alias) for specifying the content-type of the MultipartFile.
Dispose<T> = void Function(BuildContext context, T value)
A function that disposes an object of type T.
ErrorBuilder<T> = T Function(BuildContext context, Object? error)
A callback used to build a valid value from an error.
ExtentController = ListController
ExtentEstimationProvider = double Function(int? index, double crossAxisExtent)
Signature for a function provided by the Link widget that instructs it to follow the link.
HeaderForEachCallback = void Function(String name, List<String> values)
The signature that iterates header fields.
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.
IsMounted = bool Function()
Used by useIsMounted to allow widgets to determine if the Widget is still in the widget tree or not.
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.
LifecycleCallback = FutureOr<void> Function(AppLifecycleState? previous, AppLifecycleState current)
A callback triggered when the app life cycle changes.
LinkWidgetBuilder = Widget Function(BuildContext context, FollowLink? followLink)
Signature for a builder function passed to the Link widget to construct the widget tree under it.
Locator = T Function<T>()
A generic function that can be called to read providers, without having a reference on BuildContext.
ProgressCallback = void Function(int count, int total)
The type of a progress listening callback when sending or receiving data.
ProviderBuilder<R> = Widget Function(BuildContext context, R value, Widget child)
ProxyProviderBuilder<T, R> = R Function(BuildContext context, T value, R? previous)
ProxyProviderBuilder2<T, T2, R> = R Function(BuildContext context, T value, T2 value2, R? previous)
ProxyProviderBuilder3<T, T2, T3, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, R? previous)
ProxyProviderBuilder4<T, T2, T3, T4, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, T4 value4, R? previous)
ProxyProviderBuilder5<T, T2, T3, T4, T5, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, T4 value4, T5 value5, R? previous)
ProxyProviderBuilder6<T, T2, T3, T4, T5, T6, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, R? previous)
Reducer<State, Action> = State Function(State state, Action action)
Composes an Action and a State to create a new State.
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.
ShouldRebuild<T> = bool Function(T previous, T next)
Used by providers to determine whether dependents needs to be updated when the value exposed changes
StartListening<T> = VoidCallback Function(InheritedContext<T?> element, T value)
A callback used to start the listening of an object and return a function that cancels the subscription.
UpdateShouldNotify<T> = bool Function(T previous, T current)
A function that returns true when the update from previous to current should notify listeners, if any.
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

DioException
DioException describes the exception info when a request failed.
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.
ProviderNullException
Called Provider.of<T> instead of Provider.of<T?> but the provider returned null.