Unverified Commit ef42c36a authored by Tom Robinson's avatar Tom Robinson Committed by GitHub

Cleanup widgets/sliver_persistent_header.dart with resolution of dart-lang/sdk#31543 (#35828)

* Remove extra classes.

Now that https://github.com/dart-lang/sdk/issues/31543 is fixed, we
can remove extra classes.

* Add snapConfiguration to parameters for _RenderSliverFloatingPersistentHeaderForWidgets and _RenderSliverFloatingPinnedPersistentHeaderForWidgets constructors.
parent 3122786a
...@@ -284,10 +284,7 @@ class _SliverScrollingPersistentHeader extends _SliverPersistentHeaderRenderObje ...@@ -284,10 +284,7 @@ class _SliverScrollingPersistentHeader extends _SliverPersistentHeaderRenderObje
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/31543 class _RenderSliverScrollingPersistentHeaderForWidgets extends RenderSliverScrollingPersistentHeader
abstract class _RenderSliverScrollingPersistentHeader extends RenderSliverScrollingPersistentHeader { }
class _RenderSliverScrollingPersistentHeaderForWidgets extends _RenderSliverScrollingPersistentHeader
with _RenderSliverPersistentHeaderForWidgetsMixin { } with _RenderSliverPersistentHeaderForWidgetsMixin { }
class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget { class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget {
...@@ -302,10 +299,7 @@ class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectW ...@@ -302,10 +299,7 @@ class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectW
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/31543 class _RenderSliverPinnedPersistentHeaderForWidgets extends RenderSliverPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
abstract class _RenderSliverPinnedPersistentHeader extends RenderSliverPinnedPersistentHeader { }
class _RenderSliverPinnedPersistentHeaderForWidgets extends _RenderSliverPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget { class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget {
const _SliverFloatingPersistentHeader({ const _SliverFloatingPersistentHeader({
...@@ -315,10 +309,7 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec ...@@ -315,10 +309,7 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec
@override @override
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) { _RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
// Not passing this snapConfiguration as a constructor parameter to avoid the return _RenderSliverFloatingPersistentHeaderForWidgets(snapConfiguration: delegate.snapConfiguration);
// additional layers added due to https://github.com/dart-lang/sdk/issues/31543
return _RenderSliverFloatingPersistentHeaderForWidgets()
..snapConfiguration = delegate.snapConfiguration;
} }
@override @override
...@@ -327,10 +318,12 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec ...@@ -327,10 +318,12 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/31543 class _RenderSliverFloatingPinnedPersistentHeaderForWidgets extends RenderSliverFloatingPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin {
abstract class _RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFloatingPinnedPersistentHeader { } _RenderSliverFloatingPinnedPersistentHeaderForWidgets({
RenderBox child,
class _RenderSliverFloatingPinnedPersistentHeaderForWidgets extends _RenderSliverFloatingPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { } FloatingHeaderSnapConfiguration snapConfiguration,
}) : super(child: child, snapConfiguration: snapConfiguration);
}
class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget { class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget {
const _SliverFloatingPinnedPersistentHeader({ const _SliverFloatingPinnedPersistentHeader({
...@@ -340,10 +333,7 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende ...@@ -340,10 +333,7 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende
@override @override
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) { _RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
// Not passing this snapConfiguration as a constructor parameter to avoid the return _RenderSliverFloatingPinnedPersistentHeaderForWidgets(snapConfiguration: delegate.snapConfiguration);
// additional layers added due to https://github.com/dart-lang/sdk/issues/31543
return _RenderSliverFloatingPinnedPersistentHeaderForWidgets()
..snapConfiguration = delegate.snapConfiguration;
} }
@override @override
...@@ -352,7 +342,9 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende ...@@ -352,7 +342,9 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/31543 class _RenderSliverFloatingPersistentHeaderForWidgets extends RenderSliverFloatingPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin {
abstract class _RenderSliverFloatingPersistentHeader extends RenderSliverFloatingPersistentHeader { } _RenderSliverFloatingPersistentHeaderForWidgets({
RenderBox child,
class _RenderSliverFloatingPersistentHeaderForWidgets extends _RenderSliverFloatingPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { } FloatingHeaderSnapConfiguration snapConfiguration,
}) : super(child: child, snapConfiguration: snapConfiguration);
}
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