ContextX extension

Convenience extensions on BuildContext.

on

Properties

colorScheme → ColorScheme

Available on BuildContext, provided by the ContextX extension

Shortcut for Theme.of(this).colorScheme.
no setter
focusScope → FocusScopeNode

Available on BuildContext, provided by the ContextX extension

Current focus scope.
no setter
height → double

Available on BuildContext, provided by the ContextX extension

Screen height.
no setter
isDark → bool

Available on BuildContext, provided by the ContextX extension

Whether the current theme is dark.
no setter
isLight → bool

Available on BuildContext, provided by the ContextX extension

Whether the current theme is light.
no setter
isMounted → bool

Available on BuildContext, provided by the ContextX extension

Whether the widget mounted at this context is still active.
no setter
mediaQuery → MediaQueryData

Available on BuildContext, provided by the ContextX extension

Current MediaQueryData.
no setter
messenger → ScaffoldMessengerState

Available on BuildContext, provided by the ContextX extension

Current ScaffoldMessenger (asserts it exists).
no setter

Available on BuildContext, provided by the ContextX extension

Current Navigator.
no setter
overlay → OverlayState?

Available on BuildContext, provided by the ContextX extension

Current overlay, if available.
no setter
primaryColor → Color

Available on BuildContext, provided by the ContextX extension

Primary color shortcut.
no setter
size → Size

Available on BuildContext, provided by the ContextX extension

Screen size.
no setter
surfaceColor → Color

Available on BuildContext, provided by the ContextX extension

Surface color shortcut.
no setter
textTheme → TextTheme

Available on BuildContext, provided by the ContextX extension

Shortcut for Theme.of(this).textTheme.
no setter
theme → ThemeData

Available on BuildContext, provided by the ContextX extension

Shortcut for Theme.of(this).
no setter
viewPadding → EdgeInsets

Available on BuildContext, provided by the ContextX extension

Safe area padding.
no setter
width → double

Available on BuildContext, provided by the ContextX extension

Screen width.
no setter

Methods

arguments<T>() → T?

Available on BuildContext, provided by the ContextX extension

Retrieves the typed route arguments or null.
popToRoot() → void

Available on BuildContext, provided by the ContextX extension

Pops all routes until the root route is reached.
showErrorSnack(String message, {Duration? duration}) → void

Available on BuildContext, provided by the ContextX extension

Shows a styled error SnackBar.
showInfoSnack(String message, {Duration? duration}) → void

Available on BuildContext, provided by the ContextX extension

Shows a styled informational SnackBar.
showSnack(String message, {Duration? duration}) → void

Available on BuildContext, provided by the ContextX extension

Shows a standard SnackBar on the closest ScaffoldMessenger.
showSuccessSnack(String message, {Duration? duration}) → void

Available on BuildContext, provided by the ContextX extension

Shows a styled success SnackBar.
showWarningSnack(String message, {Duration? duration}) → void

Available on BuildContext, provided by the ContextX extension

Shows a styled warning SnackBar.