flutterx_application library

Flutterx Application

Classes

ActivityRoute<T>
Application
Application root widget
ApplicationState
AppPage<T>
AppRoute<T>
A route to a navigation UI component.
AppRouteInformationParser
AppRouteInformationProvider
AppRouterDelegate
BottomSheetRoute<T>
DialogRoute<T>
Fragment
FragmentEntry
FragmentHost
FragmentHostKey
FragmentHostState
FragmentKey<T extends FragmentState<Fragment>>
FragmentManager
FragmentStack
Represents current fragments stack which can be
FragmentState<T extends Fragment>
FragmentWillPopScope
FullPathUrlStrategy
LabelInterface
Interface for localizing your application in a efficient way:
LabelInterfaceDelegate<T extends LabelInterface>
Used internally by Application you may not interact with this class directly
LocaleData<T extends LabelInterface>
Define locale interface like this:
NoFocusNode
FocusNode but cannot have focus
NoOverScrollPhysics
ClampingScrollPhysics but without overscroll
RouteAccess<T>
ScreenLayout
Follow Material Guidelines to understand how to use this data class https://material.io/design/layout/responsive-layout-grid.html https://material.io/archive/guidelines/layout/responsive-ui.html
TaskWrapper
TokenHandler<T extends Object>
ViewModel
The ViewModel class is designed to store and manage data in a lifecycle conscious way. ViewModel is a class that is responsible for preparing and managing the data for a Widget tree. It also handles the communication of the Widgets with the rest of the application (e.g. calling the business logic classes). A ViewModel is always created in association with a scope (defined with the use of the related ViewModelScope widget) and will be retained as long as the scope is alive (until unmount). The purpose of the ViewModel is to acquire and keep the information that is necessary for your widgets. This widgets should be able to observe changes in the ViewModel. ViewModels usually expose this information via LiveData. ViewModel's only responsibility is to manage the data for the UI. It should never access your view hierarchy or hold a reference back to the widgets tree.
ViewModelProvider
The provider interface provides you the ViewModel
ViewModelScope
Define a ViewModel scope. All descendants of this widget will have access to the ViewModelProvider of this scope through it's context Use cases of scoped viewModels MyViewModel.of(context) // scope:

Enums

LayoutMode

Extensions

FutureExt on Future<T>
LocaleDataExt on BuildContext
You can call useLabels in your build method to ensure labels used in your StatefulWidget will be updated on locale change
LocaleExt on Locale
Get flag emoji of Locale

Functions

defaultSystemUiStyle(BuildContext context) SystemUiOverlayStyle
Default overlay style from appBarTheme and scaffoldBackgroundColor
runApplication({required String name, UrlStrategy? urlStrategy, InitializeApp? initialize, required Set<ActivityRoute> routes, OnUnknownRoute onUnknownRoute = _defaultOnUnknownRoute, required ThemeData theme, ValueGetter<LocaleData<LabelInterface>> locale = LocaleData.only, AppFactory appFactory = _defaultAppFactory}) Future<void>
Run application

Typedefs

AppFactory = Widget Function({required TransitionBuilder builder, required Locale? locale, required Iterable<LocalizationsDelegate>? localizationsDelegates, required GenerateAppTitle onGenerateTitle, required AppRouteInformationParser routeInformationParser, required AppRouteInformationProvider routeInformationProvider, required AppRouterDelegate routerDelegate, required Iterable<Locale> supportedLocales, required ThemeData theme})
The returned widget must be or contains in its tree WidgetsApp Use MaterialApp.router constructor and pass to it each of the provided parameters
FragmentWrapper = Widget Function(Fragment fragment)
InitializeApp = FutureOr<ActivityRoute> Function(BuildContext context)
Initialize application and return fist route Errors here are unhandled
OnUnknownRoute = RouteInformation? Function(RouteInformation routeInformation)
RefreshToken<T extends Object> = FutureOr<T> Function(T token)
RouteAccessControl<T> = RouteAccess<T> Function(BuildContext context, RouteArgs args)
Condition for accessing route
RouteArgs = Map<String, dynamic>
Arguments that can be passed to a route
RouteKeyBuilder = LocalKey? Function(RouteArgs args)
Builder of a page key
RouteTitleBuilder = String Function(RouteArgs args)
Builder of a page title
RouteWidgetBuilder = Widget Function(BuildContext context, RouteArgs args)
Builder of a route
SystemUiStyleBuilder = SystemUiOverlayStyle Function(BuildContext context)
Factory for SystemUiOverlayStyle used by routes to define overlay style per page
TokenAuthorize<T extends Object> = FutureOr<String> Function(T token)
TokenValidPredicate<T extends Object> = bool Function(T token)
UnknownEntryStrategy = FragmentEntry? Function(FragmentManager manager, FragmentEntry entry)
ViewModelFactory<T extends ViewModel> = T Function(ViewModelProvider provider)
Factory used to instantiate your ViewModel. The best practice is defining the ViewModel constructor as private and exposing a static parameterless method that returns the newly constructed instance of your ViewModel. You should pass only that method as ViewModelFactory parameter