diff --git a/lib/src/common/observer_controller.dart b/lib/src/common/observer_controller.dart index c4a0b7f..4b57bf3 100644 --- a/lib/src/common/observer_controller.dart +++ b/lib/src/common/observer_controller.dart @@ -210,7 +210,11 @@ mixin ObserverControllerForInfo on ObserverController { /// Getting [maxScrollExtent] of viewport double viewportMaxScrollExtent(RenderViewportBase viewport) { - return (viewport.offset as ScrollPositionWithSingleContext).maxScrollExtent; + final offset = viewport.offset; + if (offset is! ScrollPosition) { + return 0; + } + return offset.maxScrollExtent; } }