2

I have to implement flutter webview in the following manner:

ListView
    Widget
    Widget
    Webview
    Widget

The webview is auto scalling up to the height of the device (the content can be longer) and scrollable. I have used this answer to make it scroll properly: Scrolling priority when combining horizontal scrolling with WebView

The thing is, I want it to switch to the main ListView scroll once it's reaches the bottom or top of the Webview content. It should look like a widget implemented natively on the widget tree.

The easy solution would have been to make the Webview as high as the content, but the devices crashes above a certain Webview height (3000).

Would be happy to hear any solution.

Thanks.

Amit Aisikowitz
  • 113
  • 2
  • 9

1 Answers1

0

Since the screen has multiple scrollable widgets, you need to use NestedScrollView. Wrap the ListView with this widget.

var _scrollController = ScrollController();

...

NestedScrollView(
  controller: _scrollController,
  headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
    return ListView(
      // Add widgets and WebView here
    );
  }
)
Omatt
  • 8,564
  • 2
  • 42
  • 144