wrap method
child under this look, on a device set to brightness, or in the
appearance chosen: the theme, the scroll behaviour, and a Material so
text takes the theme's style.
Implementation
Widget wrap(
Widget child, {
required Brightness brightness,
Brightness? chosen,
}) {
// Transparent: it paints nothing, and resets the text style Studio's
// own Material set above to the application theme's.
Widget out = Theme(
data: resolve(brightness, chosen: chosen),
child: Material(type: MaterialType.transparency, child: child),
);
final ScrollBehavior? scroll = scrollBehavior;
if (scroll != null) {
out = ScrollConfiguration(behavior: scroll, child: out);
}
return out;
}