theme property

  1. @useResult
ThemeData get theme

Returns the ThemeData instance for the current context.

Example usage:

void example(BuildContext context) {
  final Color primaryColor = context.theme.primaryColor;
  assert(primaryColor.hashCode != 0);
}

void main() {}

Implementation

@useResult
ThemeData get theme => Theme.of(this);