Unverified Commit 0e70a97e authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Refactor Animated[List, Grid, SliverList, SliverGrid] to share common code (#113793)

parent 1cfdac4b
...@@ -462,9 +462,9 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate { ...@@ -462,9 +462,9 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate {
SliverGridLayout getLayout(SliverConstraints constraints) { SliverGridLayout getLayout(SliverConstraints constraints) {
assert(_debugAssertIsValid(constraints.crossAxisExtent)); assert(_debugAssertIsValid(constraints.crossAxisExtent));
int crossAxisCount = (constraints.crossAxisExtent / (maxCrossAxisExtent + crossAxisSpacing)).ceil(); int crossAxisCount = (constraints.crossAxisExtent / (maxCrossAxisExtent + crossAxisSpacing)).ceil();
// TODO(gspencergoog): Figure out why we need this in release mode (and only // Ensure a minimum count of 1, can be zero and result in an infinite extent
// in release mode). https://github.com/flutter/flutter/issues/113109 // below when the window size is 0.
crossAxisCount = crossAxisCount < 1 ? 1 : crossAxisCount; crossAxisCount = math.max(1, crossAxisCount);
final double usableCrossAxisExtent = math.max( final double usableCrossAxisExtent = math.max(
0.0, 0.0,
constraints.crossAxisExtent - crossAxisSpacing * (crossAxisCount - 1), constraints.crossAxisExtent - crossAxisSpacing * (crossAxisCount - 1),
......
This diff is collapsed.
...@@ -19,8 +19,7 @@ export 'foundation.dart' show UniqueKey; ...@@ -19,8 +19,7 @@ export 'foundation.dart' show UniqueKey;
export 'rendering.dart' show TextSelectionHandleType; export 'rendering.dart' show TextSelectionHandleType;
export 'src/widgets/actions.dart'; export 'src/widgets/actions.dart';
export 'src/widgets/animated_cross_fade.dart'; export 'src/widgets/animated_cross_fade.dart';
export 'src/widgets/animated_grid.dart'; export 'src/widgets/animated_scroll_view.dart';
export 'src/widgets/animated_list.dart';
export 'src/widgets/animated_size.dart'; export 'src/widgets/animated_size.dart';
export 'src/widgets/animated_switcher.dart'; export 'src/widgets/animated_switcher.dart';
export 'src/widgets/annotated_region.dart'; export 'src/widgets/annotated_region.dart';
......
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