Unverified Commit 7982a3a2 authored by xster's avatar xster Committed by GitHub

New gallery performance improvements (#17167)

parent e77cfcf2
......@@ -52,7 +52,10 @@ class _CategoryItem extends StatelessWidget {
final ThemeData theme = Theme.of(context);
final bool isDark = theme.brightness == Brightness.dark;
return new RawMaterialButton(
// This repaint boundary prevents the entire _CategoriesPage from being
// repainted when the button's ink splash animates.
return new RepaintBoundary(
child: new RawMaterialButton(
padding: EdgeInsets.zero,
splashColor: theme.primaryColor.withOpacity(0.12),
highlightColor: Colors.transparent,
......@@ -84,6 +87,7 @@ class _CategoryItem extends StatelessWidget {
),
],
),
),
);
}
}
......@@ -112,7 +116,11 @@ class _CategoriesPage extends StatelessWidget {
final double rowHeight = columnWidth * aspectRatio;
final int rowCount = (categories.length + columnCount - 1) ~/ columnCount;
return new Column(
// This repaint boundary prevents the inner contents of the front layer
// from repainting when the backdrop toggle triggers a repaint on the
// LayoutBuilder.
return new RepaintBoundary(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
......@@ -139,6 +147,7 @@ class _CategoriesPage extends StatelessWidget {
}),
);
}),
),
);
},
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment