ShadMaterial constructor

const ShadMaterial({
  1. Key? key,
  2. required Widget child,
  3. ThemeData themeBuilder(
    1. BuildContext context,
    2. ThemeData theme
    )?,
})

Lets Material and Cupertino widgets in child follow the nearest shad theme.

It installs the Material Theme that shadMaterialThemeFrom derives (Cupertino widgets take their theme from it) and a transparent Material, and adds the Material and Cupertino localizations when no ancestor provides them. Widgets such as TextField, Slider and InkWell need all three.

Put one around the whole app through ShadApp.builder, or around a subtree. Inside a ShadThemeScope it follows that scope's theme.

Implementation

const ShadMaterial({super.key, required this.child, this.themeBuilder});