From 75cc166feed5effc8f3e3c640c15eb23a970ff41 Mon Sep 17 00:00:00 2001 From: Mao Yufeng Date: Thu, 14 Oct 2021 16:43:51 +0900 Subject: [PATCH] fix: find scrollable instead of scrollView --- playbook_snapshot/lib/src/snapshot_support.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/playbook_snapshot/lib/src/snapshot_support.dart b/playbook_snapshot/lib/src/snapshot_support.dart index 2829ed1..deab782 100644 --- a/playbook_snapshot/lib/src/snapshot_support.dart +++ b/playbook_snapshot/lib/src/snapshot_support.dart @@ -50,16 +50,16 @@ class SnapshotSupport { ); var resize = 0; while (true) { - final scrollViews = find - .byWidgetPredicate((widget) => widget is ScrollView) + final scrollables = find + .byWidgetPredicate((widget) => widget is Scrollable) .evaluate() - .map((e) => e.widget as ScrollView); - if (scrollViews.isEmpty) break; + .map((e) => e.widget as Scrollable); + if (scrollables.isEmpty) break; var extendedSize = device.size; - for (final scrollView in scrollViews) { + for (final scrollable in scrollables) { extendedSize = _extendScrollableSnapshotSize( - scrollView: scrollView, + scrollable: scrollable, currentExtendedSize: extendedSize, originSize: lastExtendedSize, resizingTarget: scenario.layout.compressedResizingTarget, @@ -102,12 +102,12 @@ class SnapshotSupport { } static Size _extendScrollableSnapshotSize({ - required ScrollView scrollView, + required Scrollable scrollable, required Size currentExtendedSize, required Size originSize, required _CompressedResizingTarget resizingTarget, }) { - final controller = scrollView.controller; + final controller = scrollable.controller; if (controller == null) { return Size( resizingTarget.needResizingWidth