ContextEx extension
A set of extension methods for the BuildContext class to provide easy access to commonly used theme data, colors, durations, and shapes.
This extension allows for more readable and concise code by providing properties that encapsulate common UI elements and styles.
- on
Properties
- boxShadow → BoxShadow
-
Available on BuildContext, provided by the ContextEx extension
A box shadow with a black color at 24% opacity, a blur radius of 10, and an offset of (0, 4).no setter - fastDuration → Duration
-
Available on BuildContext, provided by the ContextEx extension
A duration for fast animations, set to 200 milliseconds.no setter - mediumDuration → Duration
-
Available on BuildContext, provided by the ContextEx extension
A duration for medium animations, set to 400 milliseconds.no setter - onPrimaryColor → Color
-
Available on BuildContext, provided by the ContextEx extension
The color used for text or icons displayed on primary color backgrounds.no setter - onSurfaceColor → Color
-
Available on BuildContext, provided by the ContextEx extension
The color used for text or icons displayed on surface color backgrounds.no setter - primaryColor → Color
-
Available on BuildContext, provided by the ContextEx extension
The primary color from the current theme's color scheme.no setter - roundedRectangleBorder → ShapeBorder
-
Available on BuildContext, provided by the ContextEx extension
Returns a rounded rectangle border with a circular radius of 100.no setter - slowDuration → Duration
-
Available on BuildContext, provided by the ContextEx extension
A duration for slow animations, set to 600 milliseconds.no setter - squircleBorder → ShapeBorder
-
Available on BuildContext, provided by the ContextEx extension
Returns a squircle border with a circular radius of 24.no setter - surfaceColor → Color
-
Available on BuildContext, provided by the ContextEx extension
The surface color from the current theme's color scheme.no setter - titleStyle → TextStyle?
-
Available on BuildContext, provided by the ContextEx extension
Retrieves the title text style from the current theme's text theme, copying it and applying a color based on the onPrimary color.no setter
Methods
-
roundedBorder(
double radius) → ShapeBorder -
Available on BuildContext, provided by the ContextEx extension
Returns a rectangular border with rounded corners specified by the givenradius
.