Skip to content

Commit

Permalink
fix: find scrollable instead of scrollView
Browse files Browse the repository at this point in the history
  • Loading branch information
lcdsmao committed Oct 14, 2021
1 parent ee3fad3 commit 75cc166
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions playbook_snapshot/lib/src/snapshot_support.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 75cc166

Please sign in to comment.