apply method

  1. @override
Widget apply(
  1. BuildContext context,
  2. Widget child
)
override

Applies this theme to the child widget.

Implementation

@override
Widget apply(BuildContext context, Widget child) {
  final brightness = MediaQuery.platformBrightnessOf(context);
  final theme = brightness == Brightness.light ? light : dark;
  if (theme != null) {
    return Theme(data: theme, child: child);
  }
  return child;
}