Avoid allocation of large canvases on the web (#1557)

pull/1560/head
Mouad Debbar 2 years ago committed by GitHub
parent 6fbc6fef7a
commit 4f059e686e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -252,10 +252,12 @@ class ColorGroup extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
clipBehavior: Clip.antiAlias,
child: Column(
children: children,
return RepaintBoundary(
child: Card(
clipBehavior: Clip.antiAlias,
child: Column(
children: children,
),
),
);
}

@ -1910,39 +1910,42 @@ class ComponentDecoration extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(label, style: Theme.of(context).textTheme.titleSmall),
Tooltip(
message: tooltipMessage,
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 5.0),
child: Icon(Icons.info_outline, size: 16)),
),
],
),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(width: widthConstraint),
child: Card(
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Theme.of(context).colorScheme.outline,
return RepaintBoundary(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(label, style: Theme.of(context).textTheme.titleSmall),
Tooltip(
message: tooltipMessage,
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 5.0),
child: Icon(Icons.info_outline, size: 16)),
),
],
),
ConstrainedBox(
constraints:
const BoxConstraints.tightFor(width: widthConstraint),
child: Card(
elevation: 0,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Theme.of(context).colorScheme.outline,
),
borderRadius: const BorderRadius.all(Radius.circular(12)),
),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: child,
),
borderRadius: const BorderRadius.all(Radius.circular(12)),
),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: child,
),
),
),
],
],
),
),
);
}

Loading…
Cancel
Save