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,11 +252,13 @@ class ColorGroup extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Card( return RepaintBoundary(
child: Card(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Column( child: Column(
children: children, children: children,
), ),
),
); );
} }
} }

@ -1910,7 +1910,8 @@ class ComponentDecoration extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return RepaintBoundary(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0), padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Column( child: Column(
children: [ children: [
@ -1927,7 +1928,8 @@ class ComponentDecoration extends StatelessWidget {
], ],
), ),
ConstrainedBox( ConstrainedBox(
constraints: const BoxConstraints.tightFor(width: widthConstraint), constraints:
const BoxConstraints.tightFor(width: widthConstraint),
child: Card( child: Card(
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -1944,6 +1946,7 @@ class ComponentDecoration extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

Loading…
Cancel
Save