ContextExtensions extension

Extensions for BuildContext to simplify common UI and navigation tasks.

on

Properties

colorScheme ColorScheme

Available on BuildContext, provided by the ContextExtensions extension

Access the current ColorScheme quickly
no setter
height double

Available on BuildContext, provided by the ContextExtensions extension

Access current screen height
no setter
isDarkMode bool

Available on BuildContext, provided by the ContextExtensions extension

Check if the current theme is dark mode
no setter
isLandscape bool

Available on BuildContext, provided by the ContextExtensions extension

Check if the screen is in landscape mode
no setter
mediaQueryPadding EdgeInsets

Available on BuildContext, provided by the ContextExtensions extension

Access current padding (e.g., safe area)
no setter
orientation Orientation

Available on BuildContext, provided by the ContextExtensions extension

Access current screen orientation
no setter
textTheme TextTheme

Available on BuildContext, provided by the ContextExtensions extension

Access the current TextTheme quickly
no setter
theme ThemeData

Available on BuildContext, provided by the ContextExtensions extension

Access the current ThemeData quickly
no setter
viewInsets EdgeInsets

Available on BuildContext, provided by the ContextExtensions extension

Access current viewInsets (e.g., keyboard height)
no setter
width double

Available on BuildContext, provided by the ContextExtensions extension

Access current screen width
no setter

Methods

pop<T>([T? result]) → void

Available on BuildContext, provided by the ContextExtensions extension

Simplifies Navigator.pop
push<T>(Widget page) Future<T?>

Available on BuildContext, provided by the ContextExtensions extension

Simplifies Navigator.push
pushAndRemoveUntil<T>(Widget page) Future<T?>

Available on BuildContext, provided by the ContextExtensions extension

Simplifies Navigator.pushAndRemoveUntil
pushReplacement<T, TO>(Widget page) Future<T?>

Available on BuildContext, provided by the ContextExtensions extension

Simplifies Navigator.pushReplacement
showSnackBar(String message, {Duration duration = const Duration(seconds: 2)}) → void

Available on BuildContext, provided by the ContextExtensions extension

Show a snackbar quickly