defaultStyleOf method Null safety

  1. @protected
ButtonStyle defaultStyleOf(
  1. BuildContext context
)

Returns a non-null ButtonStyle that's based primarily on the Theme's ThemeData.textTheme and ThemeData.colorScheme.

The returned style can be overridden by the style parameter and by the style returned by themeStyleOf. For example the default style of the TextButton subclass can be overridden with its TextButton.style constructor parameter, or with a TextButtonTheme.

Concrete button subclasses should return a ButtonStyle that has no null properties, and where all of the MaterialStateProperty properties resolve to non-null values.

See also:

  • themeStyleOf, Returns the ButtonStyle of this button's component theme.

Implementation

@protected
ButtonStyle defaultStyleOf(BuildContext context);