dust_flutter library

Unified Flutter runtime and annotations for Dust code generation.

Classes

AppRoute
Marks a widget class as a typed route.
AppRouter
Marks the single router entrypoint for a Flutter application.
AsyncData<T>
Async data loaded successfully.
AsyncFailure<T>
Async load failed.
AsyncInitial<T>
No async load has started yet.
AsyncLoading<T>
Async data is loading.
AsyncRouteGuard<T extends Object>
Asynchronous route-specific guard contract.
AsyncState<T>
Lifecycle state for generated async ViewModels.
AsyncViewModelBase<TData, TArgs extends ViewModelArgs>
Base class used by generated async Dust view model bases.
BottomToTopPageTransitionsBuilder
Bottom-to-top page transition for fullscreen dialog routes.
BuildContext
A handle to the location of a widget in the widget tree.
ErrorDescription
An explanation of the problem and its cause, any information that may help track down the problem, background information, etc.
FlutterErrorDetails
Class for information provided to FlutterExceptionHandler callbacks.
Future<T>
The result of an asynchronous computation.
GeneratedNoTransitionBuilder
Page transition builder used by generated no-transition routes.
GeneratedRoute
Generated route tree metadata.
GeneratedRouteInformationParser<T extends Object>
Navigator 2.0 route information parser for generated routes.
GeneratedRouterDelegate<T extends Object>
Navigator 2.0 delegate used by generated routers.
GeneratedRouteUriExtras
URI query and fragment values preserved from an incoming route.
I18nArbParser
Parser for the ARB subset used by the runtime loader.
I18nBundle
One loaded namespace of messages for one locale.
I18nConfig
Runtime i18n configuration.
I18nController
Coordinates locale, bundles, overrides, and translation lookup.
I18nScope
Provides an I18nController to a widget subtree.
InheritedWidget
Base class for widgets that efficiently propagate information down the tree.
LoggingStateObserver
Debug observer that logs state transitions and effects.
RouteDebugInfo
Human-readable route facts used by diagnostics.
RouteGuard<T extends Object>
Synchronous route-specific guard contract.
RouteGuardBase<T extends Object>
Common supertype for every route guard accepted by generated routers.
RouteGuardChain<T extends Object>
Runs route guards in generated declaration order.
RouterBase<T extends Object>
Base class for user-owned generated routers.
RouterController<T extends Object>
Imperative navigation controller exposed through generated extensions.
RouterRuntimeConfig<T extends Object>
Runtime configuration generated for one router.
RouterScope
Inherited scope used by generated BuildContext extensions.
SilentStateObserver
No-op observer for tests and production apps that do not want logging.
State<T extends StatefulWidget>
The logic and internal state for a StatefulWidget.
StateEffect
Deprecated compatibility wrapper for one-shot effects.
StatefulWidget
A widget that has mutable state.
StatelessWidget
A widget that does not require mutable state.
StateObserver
Receives state transitions and one-shot effects from view models.
StreamSubscription<T>
A subscription on events from a Stream.
TranslatedText
Text widget that resolves an i18n key at build time.
ViewModel
Marks a class as a Dust view model generation target.
ViewModelActionToken
Token used by view models to ignore stale async results.
ViewModelArgs
Shared dependency bundle base for generated view models.
ViewModelBase<TState, TArgs extends ViewModelArgs>
Base class used by generated Dust view model bases.
ViewModelScopes
Groups generated ViewModel scopes without manual nesting.
Widget
Describes the configuration for an Element.

Enums

Internal navigation action mode.
ViewModelMode
Selects the generated ViewModel API.

Extensions

I18nAssetLoading on I18nController
Adds ARB asset loading helpers to I18nController.
I18nBuildContext on BuildContext
Translation helpers for BuildContext.

Constants

defaultI18nAssetPattern → const String
Default ARB asset pattern used by generated i18n bootstrap code.
maxRedirects → const int
Maximum redirect hops before the router reports a debug-cycle assertion.

Functions

generatedPage<R>({required LocalKey key, required String location, required String name, required Widget child, PopInvokedWithResultCallback<Object?>? onPopInvoked, PageTransitionsBuilder? transition, bool fullscreenDialog = false, bool maintainState = true}) Page<R>
Builds a generated Flutter page for one typed route.
generatedRouteListEquals<T>(List<T> left, List<T> right) bool
Compares generated route list defaults without relying on identity.
generatedRouteParseBool(String? value) bool?
Parses the URL bool spelling supported by generated route parameters.
generatedRouteParseEnum<T extends Enum>(Iterable<T> values, String? value) → T?
Parses a URL enum value by Dart enum name.
generatedRouteParseIntList(List<String>? values) List<int>?
Parses repeated URL query values as integers.
generatedRoutePath(List<String> segments, {Map<String, dynamic>? queryParameters, GeneratedRouteUriExtras? uriExtras}) String
Builds a generated route location from path segments, query, and extras.
generatedRouteShellsMatch(List<GeneratedRoute> routes, Map<Type, Type?> appliedShellsByPage) bool
Checks that generated page wrapping matches generated route metadata.
generatedRouteUriExtrasOf(Object route) GeneratedRouteUriExtras?
Returns preserved URI extras for a generated route instance.
scheduleMicrotask(void callback()) → void
Runs a function asynchronously.
withGeneratedRouteUriExtras<T extends Object>(T route, Uri uri, Set<String> knownQueryParameters) → T
Stores unknown query parameters and fragments on a parsed generated route.

Typedefs

RouteBranch<T extends Object> = String? Function(T route)
Returns the stateful navigation branch for a route, if any.
RouteDebugInfoResolver<T extends Object> = RouteDebugInfo Function(T route)
Returns debug metadata for a typed route.
RouteGuardResolver<T extends Object> = List<RouteGuardBase<T>> Function(T route)
Resolves route-level guards for one typed route object.
RouteLocation<T extends Object> = String Function(T route)
Converts a typed route object back into a URL location.
RoutePageBuilder<T extends Object> = Page Function(T route, LocalKey key, PopInvokedWithResultCallback<Object?> onPopInvoked)
Builds a Flutter page for one typed route object and stack entry key.
RouteParser<T extends Object> = T Function(Uri uri)
Converts an incoming browser or platform URI into a typed route object.
RouteRequiresAuth<T extends Object> = bool Function(T route)
Returns whether a route participates in auth checks.
RouteStack<T extends Object> = List<T>
Mutable route stack maintained by the generated router delegate.
RouteStackRestorer<T extends Object> = RouteStack<T> Function(T route)
Restores the Navigator page stack for a browser/deep-link route.
ViewModelScopeBuilder = Widget Function(Widget child)
Builds one ViewModel scope around child.

Exceptions / Errors

FlutterError
Error class used to report Flutter-specific assertion failures and contract violations.