variant property

StyleVariant? variant
final

The style variant of Material Design used by IconButton.

Set this to StyleVariant.material3Expressive to opt icon buttons into the Material 3 Expressive style.

If null, the variant is inherited from the closest enclosing IconButtonTheme that specifies one, and then from ThemeData.iconButtonTheme. If none of them specify a variant, IconButton uses StyleVariant.material3. To keep a subtree on Material 3 when an ancestor opts into Material 3 Expressive, set this to StyleVariant.material3.

An enclosing IconButtonTheme takes precedence over ThemeData.iconButtonTheme, even when a closer Theme specifies a different variant. This matches IconButtonTheme.of, which only uses ThemeData.iconButtonTheme when there is no enclosing IconButtonTheme. To change the variant of a subtree, wrap it in an IconButtonTheme.

See also:

Implementation

final StyleVariant? variant;