supper_app library

Classes

Alice
AppCubit
AppLauncher
AppLauncherProps
AppState<T extends Pair<AppTheme, ThemeData>, V extends AppLanguage>
Argument
Auth<T extends User>
BaseModule
BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
BaseResponse<T>
Bloc<Event, State>
Takes a Stream of Events as input and transforms them into a Stream of States as output.
BlocBase<State>
An interface for the core functionality implemented by both Bloc and Cubit.
BlocBuilder<B extends StateStreamable<S>, S>
BlocBuilder handles building a widget in response to new states. BlocBuilder is analogous to StreamBuilder but has simplified API to reduce the amount of boilerplate code needed as well as bloc-specific performance improvements. Please refer to BlocListener if you want to "do" anything in response to state changes such as navigation, showing a dialog, etc...
BlocBuilderBase<B extends StateStreamable<S>, S>
Base class for widgets that build themselves based on interaction with a specified bloc.
BlocConsumer<B extends StateStreamable<S>, S>
BlocConsumer exposes a builder and listener in order react to new states. BlocConsumer is analogous to a nested BlocListener and BlocBuilder but reduces the amount of boilerplate needed. BlocConsumer should only be used when it is necessary to both rebuild UI and execute other reactions to state changes in the bloc.
BlocEventSink<Event extends Object?>
An ErrorSink that supports adding events.
BlocListener<B extends StateStreamable<S>, S>
Takes a BlocWidgetListener and an optional bloc and invokes the listener in response to state changes in the bloc. It should be used for functionality that needs to occur only in response to a state change such as navigation, showing a SnackBar, showing a Dialog, etc... The listener is guaranteed to only be called once for each state change unlike the builder in BlocBuilder.
BlocListenerBase<B extends StateStreamable<S>, S>
Base class for widgets that listen to state changes in a specified bloc.
BlocObserver
An interface for observing the behavior of Bloc instances.
BlocOverrides
This class facilitates overriding BlocObserver and EventTransformer. It should be extended by another class in client code with overrides that construct a custom implementation. The implementation in this class defaults to the base blocObserver and eventTransformer implementation. For example:
BlocProvider<T extends StateStreamableSource<Object?>>
Takes a Create function that is responsible for creating the Bloc or Cubit and a child which will have access to the instance via BlocProvider.of(context). It is used as a dependency injection (DI) widget so that a single instance of a Bloc or Cubit can be provided to multiple widgets within a subtree.
BlocSelector<B extends StateStreamable<S>, S, T>
BlocSelector is analogous to BlocBuilder but allows developers to filter updates by selecting a new value based on the bloc state. Unnecessary builds are prevented if the selected value does not change.
BusService
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.
Change<State>
A Change represents the change from one State to another. A Change consists of the currentState and nextState.
Closable
An object that must be closed when no longer in use.
Cubit<State>
A Cubit is similar to Bloc but has no notion of events and relies on methods to emit new states.
CurlInterceptor
DefaultRoute
DefaultTransformer
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use.
DioMixin
Disposable
If objects that are registered inside GetIt implements Disposable the onDispose method will be called whenever that Object is unregistered, resetted or its enclosing Scope is popped
DisposeMethod
marks an instance method as a dispose call back to be passed to GetIt
Emittable<State extends Object?>
An object that can emit new states.
Emitter<State>
An Emitter is a class which is capable of emitting new states.
Environment
Used to annotate dependencies which are registered under certain environments
EnvironmentFilter
filter for whether to register for the given set of environments clients can extend this class to maker their own environmentFilters
Equatable
A base class to facilitate operator == and hashCode overrides.
EquatableConfig
The default configurion for all Equatable instances.
ErrorInterceptorHandler
Handler for error interceptor.
ErrorSink
A generic destination for errors.
FactoryMethod
Marks a factory, a named constructor or a static create function as an injectable constructor if not added the default constructor will be used.
FactoryParam
Marks a constructor param as factoryParam so it can be passed to the resolver function
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
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
GetItHelper
a helper class to handle conditional registering
GlobalConfiguration
Headers
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
InitDependency
Data structure used to identify a dependency by type and instanceName
Injectable
Marks a class as an injectable dependency and generates
InjectableInit
Marks a top-level function as an initializer function for configuring Get_it
Interceptor
Dio instance may have interceptor(s) by which you can intercept requests/responses/errors before they are handled by then or catchError. See also:
Interceptors
Interceptors are a queue, and you can add any number of interceptors, All interceptors will be executed in first in first out order.
InterceptorsWrapper
InterceptorsWrapper is a helper class, which is used to conveniently create interceptor(s). See also:
JsonConverter<T, S>
Implement this class to provide custom converters for a specific Type.
JsonEnum
Allows configuration of how enum elements are treated as JSON.
JsonKey
An annotation used to specify how a field is serialized.
JsonLiteral
An annotation used to generate a private field containing the contents of a JSON file.
JsonSerializable
An annotation used to specify a class to generate code for.
JsonValue
An annotation used to specify how a enum value is serialized.
LazySingleton
Classes annotated with @LazySingleton will generate registerLazySingleton func
ListParam<T>
Lock
Add lock/unlock API for interceptors.
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.
Message<T>
MiniApp
Module
marks a class as a register module where all property accessors rerun types are considered factories unless annotated with @singleton/lazySingleton.
ModuleManagement
MultiBlocListener
Merges multiple BlocListener widgets into one widget tree.
MultiBlocProvider
Merges multiple BlocProvider widgets into one widget tree.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.
MultiRepositoryProvider
Merges multiple RepositoryProvider widgets into one widget tree.
Named
Used to register a dependency under a name instead of type also used to annotated named injected dependencies in constructors
NoEnvOrContains
This filter validates dependencies with no environment keys or contain the provided environment
NoEnvOrContainsAll
This filter validates dependencies with no environment keys, or the ones containing all the provided environments
NoEnvOrContainsAny
This filter validates dependencies with no environment keys, or the ones containing one of the provided environments
Options
Every request can pass an Options object which will be merged with Dio.options
Pair<L, R>
PreResolve
Futures annotated with preResolve will be pre-awaited before they're registered inside of GetIt
QueuedInterceptor
Serialize the request/response/error before they enter the interceptor.
QueuedInterceptorsWrapper
QueuedInterceptorsWrapper is a helper class, which is used to conveniently create QueuedInterceptor(s). See also:
RedirectRecord
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
Handler for request interceptor.
RequestOptions
Response<T>
Response describes the http Response info.
ResponseBody
ResponseInterceptorHandler
Handler for response interceptor.
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
SimpleEnvironmentFilter
A simple filter that can be used directly for simple use cases without having to extend the base EnvironmentFilter
Singleton
Classes annotated with @Singleton will generate registerSingleton function
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.
StorageService
Streamable<State extends Object?>
An object that provides access to a stream of states over time.
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.
User
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

AppLanguage
AppTheme
DioErrorType
FieldRename
Values for the automatic field renaming behavior for JsonSerializable.
ListFormat
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
ResponseType indicates which transformation should be automatically applied to the response data by Dio.

Mixins

EquatableMixin
A mixin that helps implement equality without needing to explicitly override operator == and hashCode.
OptionsMixin

Extensions

Convert on String?
DoubleUtils on double?
HexColor on String
IntUtils on int?
Line on String?
ListExtension on List<T>?
NullCheck on T?
ReadContext on BuildContext
Exposes the read method.
SelectContext on BuildContext
Adds a select method on BuildContext.
StringUtils on String?
URLParse on String?
WatchContext on BuildContext
Exposes the watch method.

Constants

dev → const Environment
preset instance of common env name
disposeMethod → const DisposeMethod
const instance of DisposeMethod with default arguments
factoryMethod → const FactoryMethod
const instance of FactoryMethod with default values
factoryParam → const FactoryParam
const instance of FactoryParam with default arguments
injectable → const Injectable
const instance of Injectable with default arguments
injectableInit → const InjectableInit
const instance of InjectableInit with default arguments
kEnvironmentsName → const String
instance name for the Set of environment keys that's registered internally inside of GetItHelper
lazySingleton → const LazySingleton
const instance of LazySingleton with default arguments
module → const Module
const instance of Module with default arguments
named → const Named
const instance of Named with default arguments
preResolve → const PreResolve
const instance of PreResolve with default arguments
prod → const Environment
preset instance of common env name
singleton → const Singleton
const instance of Singleton with default arguments
test → const Environment
preset instance of common env name

Functions

$checkedConvert<T>(Map map, String key, T castFunc(dynamic), {Object? readValue(Map, String)?}) → T
Helper function used in generated code when JsonSerializableGenerator.checked is true.
$checkedCreate<T>(String className, Map map, T constructor(S <S>(String, S (Object?), {Object? readValue(Map, String)?})), {Map<String, String> fieldKeyMap = const {}}) → T
Helper function used in generated code when JsonSerializableGenerator.checked is true.
$checkedNew<T>(String className, Map map, T constructor(), {Map<String, String>? fieldKeyMap}) → T
Helper function used in generated code when JsonSerializableGenerator.checked is true.
$checkKeys(Map map, {List<String>? allowedKeys, List<String>? requiredKeys, List<String>? disallowNullValues}) → void
Helper function used in generated fromJson code when JsonSerializable.disallowUnrecognizedKeys is true for an annotated type or JsonKey.required is true for any annotated fields.
$enumDecode<K extends Enum, V>(Map<K, V> enumValues, Object? source, {K? unknownValue}) → K
Returns the key associated with value source from enumValues, if one exists.
$enumDecodeNullable<K extends Enum, V>(Map<K, V> enumValues, Object? source, {Enum? unknownValue}) → K?
Returns the key associated with value source from enumValues, if one exists.
setupDio() Future<Dio>
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

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.
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>
EnvironmentFilterFunc = bool Function(Set<String>)
a simple filter function to be used inside SimpleEnvironmentFilter
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.
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
HeaderForEachCallback = void Function(String name, List<String> values)
InterceptorErrorCallback = void Function(DioError e, ErrorInterceptorHandler handler)
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
InterceptorSuccessCallback = void Function(Response e, ResponseInterceptorHandler handler)
JsonDecodeCallback = dynamic Function(String)
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.
ProgressCallback = void Function(int count, int total)
Callback to listen the progress for sending/receiving data.
RequestEncoder = List<int> Function(String request, RequestOptions options)
ResponseDecoder = String Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
ScopeDisposeFunc = FutureOr Function()
Signature for disposing function on scope level
ValidateStatus = bool Function(int? status)

Exceptions / Errors

BadKeyException
A base class for exceptions thrown when decoding JSON.
CheckedFromJsonException
Exception thrown if there is a runtime exception in fromJson code generated when JsonSerializableGenerator.checked is true
DioError
DioError describes the error info when request failed.
DisallowedNullValueException
Exception thrown if there are keys with disallowed null values in a JSON map that was provided during deserialization.
MissingRequiredKeysException
Exception thrown if there are missing required keys in a JSON map that was provided during deserialization.
ProviderNotFoundException
The error that will be thrown if Provider.of fails to find a Provider as an ancestor of the BuildContext used.
UnrecognizedKeysException
Exception thrown if there are unrecognized keys in a JSON map that was provided during deserialization.
WaitingTimeOutException