kappa library

Classes

Allow
Allows the navigation to proceed.
AuthMiddleware
Protects routes that require a logged-in user.
BackgroundTransformer
The default Transformer for Dio.
BaseDataSource
Marker interface for all Data Sources. Data Sources are responsible for interacting with external systems (API, DB, etc.).
BaseHydratedBloc<E, S extends Equatable>
A base class for persistent BLoCs. It automatically saves and restores the state from local storage.
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.
BaseRepository
Marker interface for all Repositories. Repositories are responsible for abstracting data access from the Domain Layer.
BaseUseCase<Type, Params>
The contract for all Use Cases in the application.
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.
Block
Blocks the navigation from proceeding.
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.
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.
BouncingScrollBehavior
BouncingScrollWrapper
Breakpoint
BusinessFailure
A standard Business Logic Failure (e.g., invalid data, constraint violation).
CacheFailure
A standard Cache Failure (e.g., local storage read/write error).
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.
ClampingScrollBehavior
ClampingScrollWrapper
Closable
An object that must be closed when no longer in use.
Condition<T>
A conditional value provider.
Cubit<State>
A Cubit is similar to Bloc but has no notion of events and relies on methods to emit new states.
CustomParameterCodec
annotation to define a custom parameter decoder/encoder this is useful when the is encoded/decoded in a non-standard way like base64Url this must be used as an annotation on a field
CustomTransitionPage<T>
Page with custom transition functionality.
Dio
Dio enables you to make HTTP requests easily.
DioMixin
Disposable
If objects that are registered inside GetIt implements Disposable the onDispose method will be called whenever that Object is unregistered, reset or its enclosing Scope is popped
Either<L, R>
Represents a value of one of two possible types, Left or Right.
Emittable<State extends Object?>
An object that can emit new states.
EmittableStateStreamableSource<State>
A StateStreamableSource that can emit new states.
Emitter<State>
An Emitter is a class which is capable of emitting new states.
Eq<T>
A type class used to determine equality between 2 instances of the same type T. Any 2 instances x and y are equal if eqv(x, y) is true.
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
ErrorSink
A generic destination for errors.
Failure
Base class for all failures in the application. Use this class to standardize error handling in the Domain Layer.
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
GetIt
Very simple and easy to use service locator You register your object creation factory or an instance of an object with registerFactory, registerSingleton or registerLazySingleton And retrieve the desired object using get or call your locator as function as its a callable class Additionally GetIt offers asynchronous creation functions as well as functions to synchronize the async initialization of multiple Singletons
GoRoute Get started Configuration Redirection Transition animations Named routes
A route that is displayed visually above the matching parent route using the Navigator.
GoRouteData Type-safe routes
A class to represent a GoRoute in Type-safe routing.
GoRouteInformationParser
Converts between incoming URLs and a RouteMatchList using RouteMatcher.
GoRouteInformationProvider
The RouteInformationProvider created by go_router.
GoRouter Get started Upgrading Configuration Navigation Redirection Web Deep linking Named routes Error handling State restoration
The route configuration for the app.
GoRouterDelegate
GoRouter implementation of RouterDelegate.
GoRouterState
The route state during routing.
GuestMiddleware
Protects routes that should only be accessible to guests (e.g., Login, Register).
Hash<T>
A type class used to represent a hashing scheme for objects of a given type.
Headers
The headers class for requests and responses.
HKT<G, A>
https://marcosh.github.io/post/2020/04/15/higher-kinded-types-php-solution.html https://medium.com/@gcanti/higher-kinded-types-in-flow-275b657992b7
HKT2<G1, G2, A>
HKT3<G1, G2, G3, A>
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
HydratedAesCipher
Default encryption algorithm. Uses AES256 CBC with PKCS7 padding.
HydratedBloc<Event, State>
Specialized Bloc which handles initializing the Bloc state based on the persisted state. This allows state to be persisted across hot restarts as well as complete app restarts.
HydratedCipher
Abstract cipher can be implemented to customize encryption.
HydratedCubit<State>
Specialized Cubit which handles initializing the Cubit state based on the persisted state. This allows state to be persisted across application restarts.
HydratedStorage
Implementation of Storage which uses package:hive_ce to persist and retrieve state changes from the local device.
HydratedStorageDirectory
A platform-agnostic storage directory representation.
ImperativeRouteMatch
The route match that represent route pushed through GoRouter.push.
InheritedGoRouter
GoRouter implementation of InheritedWidget.
InheritedResponsiveBreakpoints
Creates an immutable widget that exposes ResponsiveBreakpointsData to child widgets.
InitDependency
Data structure used to identify a dependency by type and instanceName
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.
IO<A>
IO<A> represents a non-deterministic synchronous computation that can cause side effects, yields a value of type A and never fails.
IOEither<L, R>
IOEither<L, R> represents a non-deterministic synchronous computation that can cause side effects, yields a value of type R or can fail by returning a value of type L.
IOOption<R>
IOOption<R> represents an synchronous computation that may fails yielding a None or returns a Some(R) when successful.
IORef<T>
Mutable reference in the IO monad.
KappaAnimatedView
A declarative wrapper for adding animations to any widget.
KappaAnimationConstants
Standard durations and curves for Kappa animations.
KappaApp
The main entry point for a Kappa application.
KappaAppBar
KappaBlocObserver
Monitors all BLoCs globally for state changes and errors.
KappaBottomNavigationBar
KappaButton
A smart button that adapts to the current platform (Android/iOS).
KappaCard
A smart container that adapts to the current platform.
KappaDesignTokens
Design Tokens for consistent spacing and styling.
KappaDialog
A utility for showing adaptive dialogs.
KappaDio
A standardized Networking Client for Kappa with Offline-First support.
KappaEnv
A container for environment-specific configuration.
KappaEvent
Base class for all events in the Kappa framework. Extend this class to create custom events (e.g., UserLoggedInEvent).
KappaEventBus
A simple, reactive Event Bus for inter-module communication. Modules publish events here, and other modules subscribe to react.
KappaGrid
Professional 12-column grid system for responsive layouts.
KappaListTile
A smart list item that adapts to the current platform.
KappaLoading
Controller to manage global loading state. Use KappaLoading.show() and KappaLoading.hide() to control the overlay.
KappaLoadingIndicator
KappaLoadingOverlay
A widget that overlays a loading indicator over its child based on global state.
KappaMiddleware
The contract for all middlewares in Kappa. A middleware can intercept a navigation and decide to redirect or allow it.
KappaModule
The contract that every feature module in a Kappa application must implement.
KappaPageTransition
A helper class to create professional page transitions for GoRouter.
KappaServiceRegistry
A central registry for public module services. Use this to expose and look up shared services (Request-Response).
KappaSlider
KappaSwitch
KappaTextField
A smart text field that adapts to the current platform.
KappaThemeExtension
Extends the Material Theme with Kappa specific tokens.
Left<L, R>
ListParam<T>
Indicates a param being used as queries or form data, and how does it gets formatted.
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.
MaxWidthBox
MultiBlocListener
Merges multiple BlocListener widgets into one widget tree.
MultiBlocObserver
A BlocObserver which supports registering multiple BlocObserver instances. This is useful when maintaining multiple BlocObserver instances for different functions e.g. LoggingBlocObserver, ErrorReportingBlocObserver.
MultiBlocProvider
Merges multiple BlocProvider widgets into one widget tree.
MultipartFile
An upload content that is a part of MultipartRequest. This doesn't need to correspond to a physical file.
MultiRepositoryProvider
Merges multiple RepositoryProvider widgets into one widget tree.
None
NoParams
A special parameter class for use cases that don't require any arguments.
NoScrollbarBehavior
NoScrollbarWrapper
NoTransitionPage<T>
Custom transition page with no transition.
ObjectRegistration<T extends Object>
OnEnterResult
The result of an onEnter callback.
Option<T>
A type that can contain a value of type T in a Some or no value with None.
Options
The configuration for a single request. BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
Order<T>
The Order type class is used to define a total ordering on some type A.
PartialOrder<T>
The PartialOrder type class is used to define a partial ordering on some type A.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create QueuedInterceptor in ease.
Reader<R, A>
Reader<R, A> allows to read values A from a dependency/context R without explicitly passing the dependency between multiple nested function calls.
ReaderHKT
Tag the HKT2 interface for the actual Reader.
ReaderTask<E, A>
ReaderTask represents an asynchronous computation that yields a value of type A from a context of type E and never fails.
ReaderTaskEither<E, L, R>
ReaderTaskEither<E, L, R> represents an asynchronous computation (Task) that either yields a value of type R or fails yielding an error of type L (Either), that allows to read values from a dependency/context E (Reader).
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
RelativeGoRouteData Type-safe routes
A class to represent a relative GoRoute in Type-safe routing.
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.
ResponsiveBreakpoints
ResponsiveBreakpointsData
Responsive data about the current screen.
ResponsiveBreakpointsState
ResponsiveConstraints
ResponsiveGridDelegate
A SliverGridDelegate with item sizing control.
ResponsiveGridView
A GridView with responsive capabilities.
ResponsiveRowColumn
A convenience wrapper that use Flex for responsive horizontal and vertical layout switching with padding and spacing.
ResponsiveRowColumnItem
A wrapper for ResponsiveRowColumn children with responsiveness.
ResponsiveScaledBox
ResponsiveUtils
Util functions for the Responsive Framework.
ResponsiveValue<T>
Conditional values based on the active breakpoint.
ResponsiveVisibility
A convenience wrapper for responsive Visibility.
RouteBase
The base class for GoRoute and ShellRoute.
RouteBuilder
Builds the top-level Navigator for GoRouter.
RouteConfiguration
The route configuration for GoRouter configured by the app.
RouteData
Baseclass for supporting Type-safe routing.
RouteInformationState<T>
The data class to be stored in RouteInformation.state to be used by GoRouteInformationParser.
RouteMatch
An matched result by matching a GoRoute against a location.
RouteMatchBase
The base class for various route matches.
RouteMatchList
The list of RouteMatchBase objects.
RoutingConfig Configuration
A set of parameters that defines routing in GoRouter.
ServerFailure
A standard Server Failure (e.g., 500 error, timeout).
ShadowChangeHandlers
If an object implements the ShadowChangeHandler if will get notified if an Object with the same registration type and name is registered on a higher scope which will shadow it. It also will get notified if the shadowing object is removed from GetIt
ShellRoute Configuration
A route that displays a UI shell around the matching child route.
ShellRouteBase
Base class for classes that act as shells for sub-routes, such as ShellRoute and StatefulShellRoute.
ShellRouteContext
Context object used when building the shell and Navigator for a shell route.
ShellRouteData
A class to represent a ShellRoute in Type-safe routing.
ShellRouteMatch
An matched result by matching a ShellRoute against a location.
Some<T>
State<S, A>
State<S, A> is used to store, update, and extract state in a functional way.
StateAsync<S, A>
StateAsync<S, A> is used to store, update, and extract async state in a functional way.
StatefulNavigationShell
Widget for managing the state of a StatefulShellRoute.
StatefulNavigationShellState
State for StatefulNavigationShell.
StatefulShellBranch
Representation of a separate branch in a stateful navigation tree, used to configure StatefulShellRoute.
StatefulShellBranchData
Base class for supporting StatefulShellRoute
StatefulShellRoute Configuration
A route that displays a UI shell with separate Navigators for its sub-routes.
StatefulShellRouteData
Base class for supporting StatefulShellRoute
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.
Storage
Interface which is used to persist and retrieve state changes.
Streamable<State extends Object?>
An object that provides access to a stream of states over time.
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.
Task<A>
Task represents an asynchronous computation that yields a value of type A and never fails.
TaskEither<L, R>
TaskEither<L, R> represents an asynchronous computation that either yields a value of type R or fails yielding an error of type L.
TaskOption<R>
TaskOption<R> represents an asynchronous computation that may fails yielding a None or returns a Some(R) when successful.
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.
TypedGoRoute<T extends GoRouteData>
A superclass for each typed go route descendant
TypedQueryParameter<T>
Annotation to override the URI name for a route parameter.
TypedRelativeGoRoute<T extends RelativeGoRouteData>
A superclass for each typed relative go route descendant
TypedRoute<T extends RouteData>
A superclass for each typed route descendant
TypedShellRoute<T extends ShellRouteData>
A superclass for each typed shell route descendant
TypedStatefulShellBranch<T extends StatefulShellBranchData>
A superclass for each typed shell route descendant
TypedStatefulShellRoute<T extends StatefulShellRouteData>
A superclass for each typed shell route descendant
Unit
Used instead of void as a return statement for a function when no value is to be returned.
WillSignalReady
If your singleton that you register wants to use the manually signalling of its ready state, it can implement this interface class instead of using the signalsReady parameter of the registration functions (you don't really have to implement much ;-) )

Enums

Conditional
Internal equality comparators.
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.
HydrationErrorBehavior
Describes the various caching behaviors when a hydration error occurs.
KappaAnimationType
Common animation types supported by Kappa.
KappaFlavor
Supported environment flavors for the application.
ListFormat
Specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name). and the separator for array items.
The type of the navigation.
ObjectRegistrationType
You will see a rather esoteric looking test (const Object() is! T) at several places. It tests if T is a real type and not Object or dynamic. For each registered factory/singleton an ObjectRegistration<T> is created it holds either the instance of a Singleton or/and the creation functions for creating an instance when get is called
ResponseType
Indicates which transformation should be applied to the response data.
ResponsiveRowColumnType
ResponsiveTargetPlatform
A superset of TargetPlatform that includes web as an enum option. Flutter's TargetPlatform does not include web as a platform option.

Mixins

Alt<KT, A>
Alt type class identifies an associative operation on a type constructor.
Alt2<KT, A, B>
Alt3<KT, P1, P2, P3>
Applicative<G, A>
Applicative2<G, A, B>
Applicative3<G, A, B, C>
Band<T>
Bands are semigroups whose operation (i.e. combine) is also idempotent (an operation that can be applied multiple times without changing the result beyond the initial application).
BoundedSemilattice<T>
A semilattice in which:
CommutativeGroup<T>
An commutative group (also known as an abelian group) is a group whose combine operation is commutative.
CommutativeMonoid<T>
CommutativeMonoid represents a commutative monoid.
CommutativeSemigroup<T>
CommutativeSemigroup represents a commutative semigroup.
Extend<KT, A>
Extend2<KT, A, B>
Filterable<KT, A>
Foldable<G, A>
Foldable2<G, A, B>
Functor<G, A>
Functor<G, A> extends HKT<G, A> to express the fact that the classes implementing the Functor interface will need to be higher kinded types.
Functor2<G, A, B>
Functor3<G, A, B, C>
Group<T>
A group is a monoid where each element has an inverse.
HydratedMixin<State>
A mixin which enables automatic state persistence for Bloc and Cubit classes.
KappaResponsive
Provides standardized layout and theming helpers for responsive designs.
KappaSpacing
Provides standardized spacing constants for consistent layout. Use this mixin in your Widgets or UI classes.
Monad<KT, A>
Monad2<KT, A, B>
Monad3<KT, P1, P2, P3>
Monoid<T>
A monoid is a semigroup with an identity (empty).
OptionsMixin
The mixin class for options that provides common attributes.
Semigroup<T>
A semigroup is any set A with an associative operation (combine).
Semilattice<T>
Semilattices are commutative semigroups whose operation (i.e. combine) is also idempotent.

Extensions

CompositionEitherExtension on Task<Either<L, R>>
CompositionOptionExtension on Task<Option<T>>
CurryExtension2 on Output Function(Input1, Input2)
Extract first parameter from this function to allow curring.
CurryExtension3 on Output Function(Input1, Input2, Input3)
CurryExtension4 on Output Function(Input1, Input2, Input3, Input4)
CurryExtension5 on Output Function(Input1, Input2, Input3, Input4, Input5)
FpdartOnDateTime on DateTime
fpdart extension methods on DateTime
FpdartOnIterable on Iterable<T>
Get the first element of the Iterable. If the Iterable is empty, return None. Functional programming functions on a mutable dart Iterable using fpdart.
FpdartOnIterableOfIterable on Iterable<Iterable<T>>
Functional programming functions on Iterable<Iterable<T>> using fpdart.
FpdartOnList on List<T>
Functional programming functions on a mutable dart Iterable using fpdart.
FpdartOnMap on Map<K, V>
Functional programming functions on a mutable dart Map using fpdart.
FpdartOnOption on Option<T>
FpdartOnOptionMap on Option<Map<K, dynamic>>
FpdartOnPredicate on bool Function()
FpdartOnPredicate1 on bool Function(P)
FpdartOnString on String
Functional programming functions on dart String using fpdart.
FpdartSequenceIterableEither on Iterable<Either<E, A>>
FpdartSequenceIterableIO on Iterable<IO<T>>
FpdartSequenceIterableIOEither on Iterable<IOEither<E, T>>
FpdartSequenceIterableIOOption on Iterable<IOOption<T>>
FpdartSequenceIterableOption on Iterable<Option<T>>
FpdartSequenceIterableState on Iterable<State<S, A>>
Convert a List<State<S, A>> to a single State<S, List<A>>.
FpdartSequenceIterableTask on Iterable<Task<T>>
FpdartSequenceIterableTaskEither on Iterable<TaskEither<E, T>>
FpdartSequenceIterableTaskOption on Iterable<TaskOption<T>>
FpdartTraversableIterable on Iterable<T>
GoRouterHelper on BuildContext
Dart extension to add navigation function to a BuildContext object, e.g. context.go('/');
ReadContext on BuildContext
Exposes the read method.
SelectContext on BuildContext
Adds a select method on BuildContext.
TargetPlatformExtension on TargetPlatform
A helper extension to convert TargetPlatform to ResponsiveTargetPlatform.
UncurryExtension2 on Output Function(Input2) Function(Input1)
UncurryExtension3 on Output Function(Input3) Function(Input2) Function(Input1)
UncurryExtension4 on Output Function(Input4) Function(Input3) Function(Input2) Function(Input1)
UncurryExtension5 on Output Function(Input5) Function(Input4) Function(Input3) Function(Input2) Function(Input1)
WatchContext on BuildContext
Exposes the watch method.

Constants

DESKTOP → const String
MOBILE → const String
PHONE → const String
TABLET → const String
unit → const Unit
Used instead of void as a return statement for a function when no value is to be returned.

Properties

dateNow → IO<DateTime>
Constructs a DateTime instance with current date and time in the local time zone.
no setter
ioRefEq → Eq<IORef<Object?>>
Eq instance to compare IORefs using pointer equality
final
now → IO<int>
The number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setter
random → IO<double>
Generates a non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.
no setter
randomBool → IO<bool>
Generates a random boolean value.
no setter

Functions

boolAndMonoid() → Monoid<bool>
boolOrMonoid() → Monoid<bool>
constF<A>(A a) → A Function(dynamic b)
constf a is a unary function which evaluates to a for all inputs.
defaultDioExceptionReadableStringBuilder(DioException e) → String
The default implementation of building a readable string of DioException.
defaultOnHydrationError(Object error, StackTrace stackTrace) → HydrationErrorBehavior
The default hydration onError implementation. Returns HydrationErrorBehavior.overwrite.
dualEndoMonoid<A>() → Monoid<Endo<A>>
endoMonoid<A>() → Monoid<Endo<A>>
identity<T>(T a) → T
Returns the given a.
identityFuture<T>(T a) → Future<T>
Returns the given a, wrapped in Future.value.
left<L, R>(L l) → Either<L, R>
Return a Left(l).
modifyIORef<T>(Endo<T> update, IORef<T> ref) → IO<Unit>
Works almost identical to the write method, but instead of taking a value that needs to be written, takes an Endo function, applies the IORef's current value to it and writes the result to the IORef.
modifyIORefC<T>(Endo<T> update) → IO<Unit> Function(IORef<T> ref)
A curried version of the modifyIORef
newIORef<T>(T initial) → IO<IORef<T>>
Creates a new IORef inside an IO monad with a given initial value.
none<T>() → Option<T>
Return a None.
option<T>(T value, bool predicate(T)) → Option<T>
Return Some of value when predicate applied to value returns true, None otherwise.
optionOf<T>(T? t) → Option<T>
Return None if t is null, Some otherwise.
randomInt(int min, int max) → IO<int>
Generates a non-negative random integer uniformly distributed in the range from min, inclusive, to max, exclusive.
readIORef<T>(IORef<T> ref) → IO<T>
Extracts a current value of the IORef and returns it inside the IO monad.
Return a Right(r).
some<T>(T t) → Option<T>
Return a Some(t).
throwIf(bool condition, Object error) → void
Two handy functions that help me to express my intention clearer and shorter to check for runtime errors
throwIfNot(bool condition, Object error) → void
toBoolEither<L>(String str, L onLeft()) → Either<L, bool>
Convert this String to bool, returns the result of onLeft for invalid inputs.
toBoolOption(String str) → Option<bool>
Convert this String to bool, returns None for invalid inputs.
toDoubleEither<L>(L onLeft()) → Either<L, double> Function(String)
Convert this String to double, returns the result of onLeft for invalid inputs.
toDoubleOption(String str) → Option<double>
Convert this String to double, returns None for invalid inputs.
toIntEither<L>(L onLeft()) → Either<L, int> Function(String)
Convert this String to int, returns the result of onLeft for invalid inputs.
toIntOption(String str) → Option<int>
Convert this String to int, returns None for invalid inputs.
toNumEither<L>(L onLeft()) → Either<L, num> Function(String)
Convert this String to num, returns the result of onLeft for invalid inputs.
toNumOption(String str) → Option<num>
Convert this String to num, returns None for invalid inputs.
writeIORef<T>(T value, IORef<T> ref) → IO<Unit>
Writes the given value to the IORef and returns a Unit inside the IO monad.
writeIORefC<T>(T value) → IO<Unit> Function(IORef<T> ref)
A curried version of the writeIORef

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.
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.
DisposingFunc<T> = FutureOr Function(T param)
Signature for disposing function because closures like (x){} have a return type of Null we don't use FutureOr<void>
DoAdapterEither<L> = R Function<R>(Either<L, R>)
DoAdapterIO = A Function<A>(IO<A>)
DoAdapterIOEither<E> = A Function<A>(IOEither<E, A>)
DoAdapterIOOption = A Function<A>(IOOption<A>)
DoAdapterOption = A Function<A>(Option<A>)
DoAdapterReaderTask<E> = Future<A> Function<A>(ReaderTask<E, A>)
DoAdapterReaderTaskEither<E, L> = Future<A> Function<A>(ReaderTaskEither<E, L, A>)
DoAdapterTask = Future<A> Function<A>(Task<A>)
DoAdapterTaskEither<E> = Future<A> Function<A>(TaskEither<E, A>)
DoAdapterTaskOption = Future<A> Function<A>(TaskOption<A>)
DoFunctionEither<L, R> = R Function(DoAdapterEither<L> $)
DoFunctionIO<A> = A Function(DoAdapterIO $)
DoFunctionIOEither<L, A> = A Function(DoAdapterIOEither<L> $)
DoFunctionIOOption<A> = A Function(DoAdapterIOOption $)
DoFunctionOption<A> = A Function(DoAdapterOption $)
DoFunctionReaderTask<E, A> = Future<A> Function(DoAdapterReaderTask<E> $)
DoFunctionReaderTaskEither<E, L, A> = Future<A> Function(DoAdapterReaderTaskEither<E, L> $)
DoFunctionTask<A> = Future<A> Function(DoAdapterTask $)
DoFunctionTaskEither<L, A> = Future<A> Function(DoAdapterTaskEither<L> $)
DoFunctionTaskOption<A> = Future<A> Function(DoAdapterTaskOption $)
Endo<A> = A Function(A a)
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.
ExitCallback = FutureOr<bool> Function(BuildContext context, GoRouterState state)
Signature for function used in RouteBase.onExit.
FactoryFunc<T> = T Function()
Signature of the factory function used by non async factories
FactoryFuncAsync<T> = Future<T> Function()
Signature of the factory function used by async factories
FactoryFuncParam<T, P1, P2> = T Function(P1 param1, P2 param2)
For Factories that expect up to two parameters if you need only one use void for the one you don't use
FactoryFuncParamAsync<T, P1, P2> = Future<T> Function(P1 param1, P2 param2)
For async Factories that expect up to two parameters if you need only one use void for the one you don't use
GoExceptionHandler = void Function(BuildContext context, GoRouterState state, GoRouter router)
The function signature of GoRouter.onException.
GoRouterBuilderWithNav = Widget Function(BuildContext context, Widget child)
Signature of a go router builder function with navigator.
GoRouterPageBuilder = Page Function(BuildContext context, GoRouterState state)
The page builder for GoRoute.
GoRouterRedirect = FutureOr<String?> Function(BuildContext context, GoRouterState state)
The signature of the redirect callback.
GoRouterWidgetBuilder = Widget Function(BuildContext context, GoRouterState state)
The widget builder for GoRoute.
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.
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.
The function signature for navigation callbacks in _OnEnterHandler.
Signature for functions used to build Navigators
OnEnter = FutureOr<OnEnterResult> Function(BuildContext context, GoRouterState currentState, GoRouterState nextState, GoRouter goRouter)
The signature for the top-level onEnter callback.
OnEnterThenCallback = FutureOr<void> Function()
Signature for callbacks invoked after an OnEnterResult is resolved.
OnHydrationError = HydrationErrorBehavior Function(Object error, StackTrace stackTrace)
Signature of the onError callback during hydrate.
ParserExceptionHandler = RouteMatchList Function(BuildContext context, RouteMatchList routeMatchList)
The function signature of GoRouteInformationParser.onParserException.
PopPageWithRouteMatchCallback = bool Function(Route route, dynamic result, RouteMatchBase match)
Signature for a function that takes in a route to be popped with the result and returns a boolean decision on whether the pop is successful.
ProgressCallback = void Function(int count, int total)
The type of a progress listening callback when sending or receiving data.
QueryParameterDecoder<T> = T Function(String value)
Signature for custom query parameter decoding functions.
QueryParameterEncoder<T> = String Function(T value)
Signature of custom query parameter encoding.
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.
RouteInfoState = RouteInformationState
Type alias for route information state with dynamic type parameter.
RouteMatchVisitor = bool Function(RouteMatchBase)
The function signature for RouteMatchList.visitRouteMatches
ScopeDisposeFunc = FutureOr Function()
Signature for disposing function on scope level
Separated<KT, A, B> = (HKT<KT, A>, HKT<KT, B>)
ShellNavigationContainerBuilder = Widget Function(BuildContext context, StatefulNavigationShell navigationShell, List<Widget> children)
Builder for a custom container for the branch Navigators of a StatefulShellRoute.
ShellRouteBuilder = Widget Function(BuildContext context, GoRouterState state, Widget child)
The widget builder for ShellRoute.
ShellRoutePageBuilder = Page Function(BuildContext context, GoRouterState state, Widget child)
The page builder for ShellRoute.
StatefulShellRouteBuilder = Widget Function(BuildContext context, GoRouterState state, StatefulNavigationShell navigationShell)
The widget builder for StatefulShellRoute.
StatefulShellRoutePageBuilder = Page Function(BuildContext context, GoRouterState state, StatefulNavigationShell navigationShell)
The page builder for StatefulShellRoute.
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

BlockedInitialNavigationException
Raised when Block is returned from onEnter but there is no prior route configuration to restore (e.g., an initial deep link was blocked).
DioException
DioException describes the exception info when a request failed.
GoError
Thrown when GoRouter is used incorrectly.
GoException
Thrown when GoRouter can not handle a user request.
HydratedCyclicError
Reports that an object could not be serialized due to cyclic references. When the cycle is detected, a HydratedCyclicError is thrown.
HydratedUnsupportedError
Reports that an object could not be serialized. The unsupportedObject field holds object that failed to be serialized.
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.
StorageNotFound
Exception thrown if there was no HydratedStorage specified. This is most likely due to forgetting to setup the HydratedStorage:
WaitingTimeOutException