build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Builds the adaptive inherited scope, optionally with dynamic color.

Implementation

@override
/// Builds the adaptive inherited scope, optionally with dynamic color.
Widget build(BuildContext context) {
  if (dynamicColoring) {
    return M3EDynamicColorHost(
      builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
        return ListenableBuilder(
          listenable: widget.controller,
          builder: (BuildContext context, Widget? _) {
            return _buildInheritedScope(
              context,
              lightDynamic: lightDynamic,
              darkDynamic: darkDynamic,
            );
          },
        );
      },
    );
  }

  return ListenableBuilder(
    listenable: widget.controller,
    builder: (BuildContext context, Widget? _) {
      return _buildInheritedScope(context);
    },
  );
}