GetInterface class abstract

The base class/interface that allows other packages (like navigation, state management, etc.) to merge their capabilities into the global Get instance through Dart extensions.

Available extensions

Constructors

GetInterface()

Properties

arguments → dynamic

Available on GetInterface, provided by the GetNavigationExt extension

give current arguments
no setter
context BuildContext?

Available on GetInterface, provided by the GetNavigationExt extension

give access to currentContext
no setter
currentRoute String

Available on GetInterface, provided by the GetNavigationExt extension

give name from current route
no setter
defaultDialogTransitionCurve Curve

Available on GetInterface, provided by the GetNavigationExt extension

no setter
defaultDialogTransitionDuration Duration

Available on GetInterface, provided by the GetNavigationExt extension

no setter
defaultOpaqueRoute bool

Available on GetInterface, provided by the GetNavigationExt extension

no setter
defaultPopGesture bool?

Available on GetInterface, provided by the GetNavigationExt extension

no setter
defaultTransition Transition?

Available on GetInterface, provided by the GetNavigationExt extension

no setter
defaultTransitionCurve Curve

Available on GetInterface, provided by the GetNavigationExt extension

no setter
defaultTransitionDuration Duration

Available on GetInterface, provided by the GetNavigationExt extension

The transition duration applied to routes that don't set their own: the transitionDuration given to GetMaterialApp/GetCupertinoApp, or 300 milliseconds when none was provided.
no setter
deviceLocale Locale?

Available on GetInterface, provided by the GetNavigationExt extension

no setter
engine WidgetsBinding

Available on GetInterface, provided by the GetNavigationExt extension

The current null safe WidgetsBinding
no setter
fallbackLocale Locale?

Available on GetInterface, provided by the LocalesIntl extension

getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isBottomSheetOpen bool?

Available on GetInterface, provided by the GetNavigationExt extension

check if bottomsheet is open, or null if routing is not initialized yet
no setter
isDialogOpen bool?

Available on GetInterface, provided by the GetNavigationExt extension

check if dialog is open, or null if routing is not initialized yet
no setter
isLogEnable bool
Whether logging is enabled. Defaults to kDebugMode.
getter/setter pair
isOpaqueRouteDefault bool

Available on GetInterface, provided by the GetNavigationExt extension

check if default opaque route is enable
no setter
isOverlaysClosed bool

Available on GetInterface, provided by the GetNavigationExt extension

Returns true if there is no Snackbar, Dialog or BottomSheet open
no setter
isOverlaysOpen bool

Available on GetInterface, provided by the GetNavigationExt extension

Returns true if a Snackbar, Dialog or BottomSheet is currently OPEN
no setter
isSnackbarOpen bool

Available on GetInterface, provided by the GetNavigationExt extension

check if snackbar is open, or false if routing is not initialized yet
no setter
key GlobalKey<NavigatorState>

Available on GetInterface, provided by the GetNavigationExt extension

no setter
keys Map<String, GetDelegate>

Available on GetInterface, provided by the GetNavigationExt extension

no setter
locale Locale?

Available on GetInterface, provided by the LocalesIntl extension

getter/setter pair
log LogWriterCallback
Custom callback function used to print log outputs.
getter/setter pair
overlayContext BuildContext?

Available on GetInterface, provided by the GetNavigationExt extension

give access to current Overlay Context
no setter
parameters Map<String, String?>

Available on GetInterface, provided by the GetNavigationExt extension

no setter
pluralResolver PluralResolver?

Available on GetInterface, provided by the LocalesIntl extension

The plural rule used by Trans.trPluralCases and Trans.trPluralCasesParams to map a count to a PluralCase.
getter/setter pair
previousRoute String

Available on GetInterface, provided by the GetNavigationExt extension

give name from previous route
no setter
rawRoute Route?

Available on GetInterface, provided by the GetNavigationExt extension

check a raw current route
no setter
rootController GetRootState

Available on GetInterface, provided by the GetNavigationExt extension

no setter
routing Routing

Available on GetInterface, provided by the GetNavigationExt extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
smartManagement SmartManagement
Defines the dependency disposal behavior of GetX. Defaults to SmartManagement.full.
getter/setter pair
theme ThemeData

Available on GetInterface, provided by the GetNavigationExt extension

give access to Theme.of(context)
no setter
translations Map<String, Map<String, String>>

Available on GetInterface, provided by the LocalesIntl extension

no setter
window PlatformDispatcher

Available on GetInterface, provided by the GetNavigationExt extension

The window to which this binding is bound.
no setter

Methods

addKey(GlobalKey<NavigatorState> newKey) GlobalKey<NavigatorState>?

Available on GetInterface, provided by the GetNavigationExt extension

addTranslations(Map<String, Map<String, String>> tr) → void

Available on GetInterface, provided by the LocalesIntl extension

appendTranslations(Map<String, Map<String, String>> tr) → void

Available on GetInterface, provided by the LocalesIntl extension

appUpdate() → void

Available on GetInterface, provided by the GetNavigationExt extension

args<T>() → T

Available on GetInterface, provided by the GetNavigationExt extension

asap<T>(T computation(), {bool condition()?}) FutureOr<T>

Available on GetInterface, provided by the LoopEventsExt extension

back<T>({T? result, bool canPop = true, int times = 1, String? id}) bool

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.popUntil() shortcut.

backLegacy<T>({T? result, bool closeOverlays = false, bool canPop = true, int times = 1, String? id}) → void

Available on GetInterface, provided by the GetNavigationExt extension

bottomSheet<T>(Widget bottomsheet, {Color? backgroundColor, double? elevation, bool persistent = true, ShapeBorder? shape, Clip? clipBehavior, Color? barrierColor, bool? ignoreSafeArea, bool isScrollControlled = false, bool useRootNavigator = false, bool isDismissible = true, bool enableDrag = true, Object? arguments, String? name, RouteSettings? settings, Duration? enterBottomSheetDuration, Duration? exitBottomSheetDuration, Curve? curve, bool? showDragHandle, Color? dragHandleColor, Size? dragHandleSize, Color? shadowColor, Color? surfaceTintColor}) Future<T?>

Available on GetInterface, provided by the ExtensionBottomSheet extension

Shows a modal bottom sheet containing bottomsheet.
call<T>() → T

Available on GetInterface, provided by the GetInstanceExt extension

A callable shortcut to find/retrieve a registered dependency.
changeTheme(ThemeData theme) → void

Available on GetInterface, provided by the GetNavigationExt extension

changeThemeMode(ThemeMode themeMode) → void

Available on GetInterface, provided by the GetNavigationExt extension

clearTranslations() → void

Available on GetInterface, provided by the LocalesIntl extension

close<T extends Object>({bool closeAll = true, bool closeSnackbar = true, bool closeDialog = true, bool closeBottomSheet = true, String? id, T? result}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Closes the currently open snackbars, dialogs and bottom sheets.
closeAllBottomSheets<T>({String? id, T? result}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Close all currently open bottom sheets, returning a result to each of them, if provided
closeAllDialogs<T>({String? id, T? result}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Close all currently open dialogs, returning a result to each of them, if provided
closeAllDialogsAndBottomSheets(String? id) → void

Available on GetInterface, provided by the GetNavigationExt extension

closeAllOverlays() → void

Available on GetInterface, provided by the GetNavigationExt extension

closeAllSnackbars({bool withAnimations = true}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Closes all queued snackbars.
closeBottomSheet<T>({String? id, T? result}) → void

Available on GetInterface, provided by the GetNavigationExt extension

closeCurrentSnackbar({bool withAnimations = true}) Future<void>

Available on GetInterface, provided by the GetNavigationExt extension

Closes the currently visible snackbar, if any.
closeDialog<T>({String? id, T? result}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Close the currently open dialog, returning a result, if provided
closeOverlay<T>({String? id, T? result}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Close the current overlay (e.g. dialog or bottom sheet) returning the result, if provided.
defaultDialog<T>({String title = "Alert", EdgeInsetsGeometry? titlePadding, TextStyle? titleStyle, Widget? content, String? id, EdgeInsetsGeometry? contentPadding, VoidCallback? onConfirm, VoidCallback? onCancel, VoidCallback? onCustom, Color? cancelTextColor, Color? confirmTextColor, String? textConfirm, String? textCancel, String? textCustom, Widget? confirm, Widget? cancel, Widget? custom, Color? backgroundColor, bool barrierDismissible = true, Color? buttonColor, String middleText = "\n", TextStyle? middleTextStyle, double radius = 20.0, List<Widget>? actions, PopInvokedWithResultCallback<T>? onWillPop, bool canPop = true, GlobalKey<NavigatorState>? navigatorKey, Offset? anchorPoint, TraversalEdgeBehavior? traversalEdgeBehavior, bool scrollable = false}) Future<T?>

Available on GetInterface, provided by the ExtensionDialog extension

Custom UI Dialog.
delegate<TDelegate extends RouterDelegate<TPage>, TPage>() → TDelegate?

Available on GetInterface, provided by the GetNavigationExt extension

Casts the stored router delegate to a desired type
delete<S>({String? tag, String? key, bool force = false}) bool

Available on GetInterface, provided by the GetInstanceExt extension

Delete registered Class Instance S (or tag) and, closes any open controllers DisposableInterface, cleans up the memory
deleteAll({bool force = false}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Deletes all registered instances from memory, invokes their onDelete/close lifecycles, and cleans up resources.
deleteRouteDependency(String key) → void

Available on GetInterface, provided by the GetInstanceExt extension

Deletes the dependency registered under key on behalf of a disposed route, keeping it alive when still-mounted widgets depend on it.
dialog<T>(Widget widget, {bool barrierDismissible = true, Color? barrierColor, bool useSafeArea = true, GlobalKey<NavigatorState>? navigatorKey, Object? arguments, Duration? transitionDuration, Curve? transitionCurve, RouteTransitionsBuilder? transitionBuilder, String? name, RouteSettings? routeSettings, Offset? anchorPoint, TraversalEdgeBehavior? traversalEdgeBehavior, String? id}) Future<T?>

Available on GetInterface, provided by the ExtensionDialog extension

Show a dialog. You can pass a transitionDuration and/or transitionCurve, overriding the defaults when the dialog shows up and closes. When the dialog closes, uses those animations in reverse.
find<S>({String? tag}) → S

Available on GetInterface, provided by the GetInstanceExt extension

Finds the registered type <S> (or tag) In case of using Get.create to register a type <S> or tag, it will create an instance each time you call find. If the registered type <S> (or tag) is a Controller, it will initialize its lifecycle.
findOrNull<S>({String? tag}) → S?

Available on GetInterface, provided by the GetInstanceExt extension

Finds and returns the registered instance of type S if it exists, otherwise returns null.
forceAppUpdate() Future<void>

Available on GetInterface, provided by the GetNavigationExt extension

As a rule, Flutter knows which widget to update, so this command is rarely needed. We can mention situations where you use const so that widgets are not updated with setState, but you want it to be forcefully updated when an event like language change happens. using context to make the widget dirty for performRebuild() is a viable solution. However, in situations where this is not possible, or at least, is not desired by the developer, the only solution for updating widgets that Flutter does not want to update is to use reassemble to forcibly rebuild all widgets. Attention: calling this function will reconstruct the application from the sketch, use this with caution. Your entire application will be rebuilt, and touch events will not work until the end of rendering.
generalDialog<T>({required RoutePageBuilder pageBuilder, bool barrierDismissible = false, String? barrierLabel, Color barrierColor = const Color(0x80000000), Duration transitionDuration = const Duration(milliseconds: 200), RouteTransitionsBuilder? transitionBuilder, GlobalKey<NavigatorState>? navigatorKey, RouteSettings? routeSettings, Offset? anchorPoint, TraversalEdgeBehavior? traversalEdgeBehavior, String? id}) Future<T?>

Available on GetInterface, provided by the ExtensionDialog extension

Api from showGeneralDialog with no context
getInstanceInfo<S>({String? tag}) InstanceInfo

Available on GetInterface, provided by the GetInstanceExt extension

isPrepared<S>({String? tag}) bool

Available on GetInterface, provided by the GetInstanceExt extension

Checks whether a lazy factory callback for type S (and optionally with tag) is registered and ready to be initialized.
isRegistered<S>({String? tag}) bool

Available on GetInterface, provided by the GetInstanceExt extension

Checks whether an instance of type S (and optionally with tag) is registered in memory.
lazyPut<S>(InstanceBuilderCallback<S> builder, {String? tag, bool? fenix, bool permanent = false}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Creates a new Instance lazily from the <S>builder() callback.
lazyReplace<P>(InstanceBuilderCallback<P> builder, {String? tag, bool? fenix}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Replaces an existing registered dependency of type P with a new lazy factory builder.
markAsDirty<S>({String? tag, String? key}) → void

Available on GetInterface, provided by the GetInstanceExt extension

nestedKey(String? key) GetDelegate?

Available on GetInterface, provided by the GetNavigationExt extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off<T>(Widget page(), {bool? opaque, Transition? transition, Curve? curve, bool? popGesture, String? id, String? routeName, Object? arguments, List<BindingsInterface> bindings = const [], bool fullscreenDialog = false, bool preventDuplicates = true, Duration? duration, double gestureWidth(BuildContext context)?, CustomTransition? customTransition}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.pushReplacement() shortcut .

offAll<T>(Widget page(), {bool predicate(GetPage)?, bool? opaque, bool? popGesture, String? id, String? routeName, Object? arguments, List<BindingsInterface> bindings = const [], bool fullscreenDialog = false, Transition? transition, Curve? curve, Duration? duration, double gestureWidth(BuildContext context)?, CustomTransition? customTransition}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Push a page and pop several pages in the stack until predicate returns true. predicate is optional
offAllNamed<T>(String newRouteName, {Object? arguments, String? id, Map<String, String>? parameters}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.pushNamedAndRemoveUntil() shortcut.

offAndToNamed<T>(String page, {Object? arguments, String? id, Object? result, Map<String, String>? parameters}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.popAndPushNamed() shortcut.

offNamed<T>(String page, {Object? arguments, String? id, Map<String, String>? parameters}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.pushReplacementNamed() shortcut.

offNamedUntil<T>(String page, bool predicate(GetPage)?, {String? id, Object? arguments, Map<String, String>? parameters}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.pushNamedAndRemoveUntil() shortcut.

offUntil<T>(Widget page(), bool predicate(GetPage), [Object? arguments, String? id]) Future<T?>

Available on GetInterface, provided by the GetNavigationExt extension

printInfo({String? info, String? title}) → void
Prints structured information to the console if isLogEnable is true.
put<S>(S dependency, {String? tag, bool permanent = false}) → S

Available on GetInterface, provided by the GetInstanceExt extension

Injects a dependency into the dependency manager and immediately initializes it.
putAsync<S>(AsyncInstanceBuilderCallback<S> builder, {String? tag, bool permanent = false}) Future<S>

Available on GetInterface, provided by the GetInstanceExt extension

Injects an instance of S built asynchronously by builder into the dependency manager.
putOrFind<S>(InstanceBuilderCallback<S> dep, {String? tag}) → S

Available on GetInterface, provided by the GetInstanceExt extension

Finds an existing registered instance of type S, or creates and registers a new one using dep if not already registered.
rawSnackbar({String? title, String? message, Widget? titleText, Widget? messageText, Widget? icon, bool instantInit = true, bool shouldIconPulse = true, double? maxWidth, EdgeInsets margin = const EdgeInsets.all(0.0), EdgeInsets padding = const EdgeInsets.all(16), double borderRadius = 0.0, Color? borderColor, double borderWidth = 1.0, Color backgroundColor = const Color(0xFF303030), Color? leftBarIndicatorColor, List<BoxShadow>? boxShadows, Gradient? backgroundGradient, Widget? mainButton, OnTap? onTap, Duration? duration = const Duration(seconds: 3), bool isDismissible = true, DismissDirection? dismissDirection, bool showProgressIndicator = false, AnimationController? progressIndicatorController, Color? progressIndicatorBackgroundColor, Animation<Color>? progressIndicatorValueColor, SnackPosition snackPosition = SnackPosition.bottom, SnackStyle snackStyle = SnackStyle.floating, Curve forwardAnimationCurve = Curves.easeOutCirc, Curve reverseAnimationCurve = Curves.easeOutCirc, Duration animationDuration = const Duration(seconds: 1), SnackbarStatusCallback? snackbarStatus, double barBlur = 0.0, double overlayBlur = 0.0, Color? overlayColor, Form? userInputForm}) SnackbarController

Available on GetInterface, provided by the ExtensionSnackbar extension

reload<S>({String? tag, String? key, bool force = false}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Reloads/restarts a specific registered dependency of type S.
reloadAll({bool force = false}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Reloads all registered instances by clearing their active dependency objects and resetting their initialization states.
removeRoute(String name, {String? id}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.removeRoute() shortcut.

replace<P>(P child, {String? tag}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Replaces an existing registered instance of type P with a new child instance.
reset({bool clearRouteBindings = true}) → void

Available on GetInterface, provided by the GetResetExt extension

Resets all registered instances, translations, and optionally clears route bindings.
resetInstance({bool clearRouteBindings = true}) bool

Available on GetInterface, provided by the ResetInstance extension

Clears all registered instances (and/or tags). Even the persistent ones. This should be used at the end or tearDown of unit tests.
searchDelegate(String? k) GetDelegate

Available on GetInterface, provided by the GetNavigationExt extension

showOverlay<T>({required Future<T> asyncFunction(), Color opacityColor = Colors.black, Widget? loadingWidget, double opacity = .5}) Future<T>

Available on GetInterface, provided by the OverlayExt extension

Shows a translucent barrier with a loadingWidget on top of the current page while asyncFunction runs, then returns its result.
showSnackbar(GetSnackBar snackbar) SnackbarController

Available on GetInterface, provided by the ExtensionSnackbar extension

snackbar(String title, String message, {Color? colorText, Duration? duration = const Duration(seconds: 3), bool instantInit = true, SnackPosition? snackPosition, Widget? titleText, Widget? messageText, Widget? icon, bool? shouldIconPulse, double? maxWidth, EdgeInsets? margin, EdgeInsets? padding, double? borderRadius, Color? borderColor, double? borderWidth, Color? backgroundColor, Color? leftBarIndicatorColor, List<BoxShadow>? boxShadows, Gradient? backgroundGradient, TextButton? mainButton, OnTap? onTap, OnHover? onHover, bool? isDismissible, bool? showProgressIndicator, DismissDirection? dismissDirection, AnimationController? progressIndicatorController, Color? progressIndicatorBackgroundColor, Animation<Color>? progressIndicatorValueColor, SnackStyle? snackStyle, Curve? forwardAnimationCurve, Curve? reverseAnimationCurve, Duration? animationDuration, double? barBlur, double? overlayBlur, SnackbarStatusCallback? snackbarStatus, Color? overlayColor, Form? userInputForm}) SnackbarController

Available on GetInterface, provided by the ExtensionSnackbar extension

spawn<S>(InstanceBuilderCallback<S> builder, {String? tag, bool permanent = true}) → void

Available on GetInterface, provided by the GetInstanceExt extension

Creates a new Class Instance S from the builder callbackS. Every time find() is used, it calls the builder method to generate a new Instance S. It also registers each instance.onClose() with the current Route Get.reference to keep the lifecycle active. Is important to know that the instances created are only stored per Route. So, if you call Get.delete<T>() the "instance factory" used in this method (Get.spawn<T>()) will be removed, but NOT the instances already created by it.
to<T extends Object?>(Widget page(), {bool? opaque, Transition? transition, Curve? curve, Duration? duration, String? id, String? routeName, bool fullscreenDialog = false, Object? arguments, List<BindingsInterface> bindings = const [], bool preventDuplicates = true, bool? popGesture, bool showCupertinoParallax = true, double gestureWidth(BuildContext context)?, CustomTransition? customTransition, bool rebuildStack = true, PreventDuplicateHandlingMode preventDuplicateHandlingMode = PreventDuplicateHandlingMode.reorderRoutes}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.push() shortcut.

toEnd<T>(FutureOr<T> computation()) Future<T>

Available on GetInterface, provided by the LoopEventsExt extension

toNamed<T>(String page, {Object? arguments, String? id, bool preventDuplicates = true, Map<String, String>? parameters}) Future<T?>?

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.pushNamed() shortcut.

toString() String
A string representation of this object.
inherited
until(bool predicate(GetPage), {String? id}) → void

Available on GetInterface, provided by the GetNavigationExt extension

Navigation.popUntil() shortcut.

updateLocale(Locale l) Future<void>

Available on GetInterface, provided by the GetNavigationExt extension

Operators

operator ==(Object other) bool
The equality operator.
inherited