mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 23:08:59 +00:00
Avoid allocation of large canvases on the web (#1557)
This commit is contained in:
@@ -252,11 +252,13 @@ class ColorGroup extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
return RepaintBoundary(
|
||||
child: Card(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
children: children,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1910,7 +1910,8 @@ class ComponentDecoration extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
return RepaintBoundary(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -1927,7 +1928,8 @@ class ComponentDecoration extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints.tightFor(width: widthConstraint),
|
||||
constraints:
|
||||
const BoxConstraints.tightFor(width: widthConstraint),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -1944,6 +1946,7 @@ class ComponentDecoration extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user