-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: money (g3)f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Internal: b/292548368
The app at the bottom of this issue adds repaint boundaries by default for the grid view, even though it is not scrollable by itself and is shrink wrapped. This means that some of the entries will be chosen as raster cache entries, but in reality the whole thing could/should be raster cached.
The default behavior of adding repatint boundaries makes sense for grid views that actually scroll. It does not make sense when the grid view is just being used as a static layout mechanism (effectively a set of rows and columns). We should warn developers about this case and encourage them to turn off repaint boundaries for this case.
/cc @flar @jonahwilliams @goderbauer
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
width: 350,
child: ListView(
children: <Widget>[
Container(
color: Colors.red,
height: 45,
width: 350,
child: const Text('Header!'),
),
const Divider(),
Container(
color: Colors.blue,
height: 240,
width: 350,
child: const Text('Foo!'),
),
const Divider(),
GridView.count(
crossAxisCount: 4,
crossAxisSpacing: 20,
mainAxisSpacing: 20,
shrinkWrap: true,
children: const <Widget>[
CircleAvatar(child: Text('AB')),
CircleAvatar(child: Text('CD')),
CircleAvatar(child: Text('EF')),
CircleAvatar(child: Text('GH')),
CircleAvatar(child: Text('BA')),
CircleAvatar(child: Text('DC')),
CircleAvatar(child: Text('FE')),
CircleAvatar(child: Text('HG')),
],
),
const Divider(),
Container(
color: Colors.yellow,
height: 140,
width: 350,
child: const Text('Bar!'),
),
Container(
color: Colors.green,
height: 45,
width: 350,
child: const Text('Footer!'),
),
],
),
),
),
);
}
}Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: money (g3)f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Type
Projects
Status
Todo