we have a page where I want to have a Image
on the top and a WebView
below it. This worked somewhat if I wrap the WebView
with a Flexible
. But the problem with this solution was that only the WebView
scrolled but the Image
at the top was “sticky”. So I tried to wrap the Column
with a SingleChildScrollView
but that didn’t work.
Then I tried to wrap everything in a CustomScrollView
, this also somewhat worked but I can’t scroll to the end of the WebView
.
Does somebody know how can I accomplish that? That I can scroll the complete page and not only the WebView
?
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: CustomScrollView(
slivers: [
SliverToBoxAdapter(
child: AspectRatio(
aspectRatio:
widget.news.imageRatio == NewsImageRatio.sixteenByNine
? 16 / 9
: 1 / 1,
child: FadeInImage.memoryNetwork(
image: widget.news.imageUrl!,
placeholder: kTransparentImage,
fit: BoxFit.cover,
),
),
),
SliverFillRemaining(
hasScrollBody: true,
child: WebViewWidget(
controller: _controller,
),
),
],
),
);
}