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
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
A duration for fast animations, set to 200 milliseconds.
no setter
mediumDuration Duration
A duration for medium animations, set to 400 milliseconds.
no setter
onPrimaryColor Color
The color used for text or icons displayed on primary color backgrounds.
no setter
onSurfaceColor Color
The color used for text or icons displayed on surface color backgrounds.
no setter
primaryColor Color
The primary color from the current theme's color scheme.
no setter
roundedRectangleBorder ShapeBorder
Returns a rounded rectangle border with a circular radius of 100.
no setter
slowDuration Duration
A duration for slow animations, set to 600 milliseconds.
no setter
squircleBorder ShapeBorder
Returns a squircle border with a circular radius of 24.
no setter
surfaceColor Color
The surface color from the current theme's color scheme.
no setter
titleStyle TextStyle?
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
Returns a rectangular border with rounded corners specified by the given radius.