fluttercommunity / fluttercommunity/flutter_webview_plugin
WebView in TabBarView show not correct.
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 1.5k
- 派生
- 936
- PR 合并指标
- 30 天内没有已合并 PR
描述
```
class DetailAcademicPage extends StatelessWidget {
final String title;
DetailAcademicPage(this.type);
@override
Widget build(BuildContext context) {
final SectionPage tab1 = SectionPage(0, title);
final SectionPage tab2 = SectionPage(1, title);
final SectionPage tab3 = SectionPage(2, title);
return Scaffold(
body: DefaultTabController(
length: 3,
child: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: Text(
title,
style: TextStyle(color: Colors.white),
),
centerTitle: true,
iconTheme: IconThemeData(color: Colors.white),
bottom: TabBar(
indicatorColor: Colors.white,
tabs: [
Tab(
child: Text("Section 1")),
Tab(
child: Text("Section 2")),
Tab(
child: Text("Section 3",))
])),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [tab1, tab2, tab3],
),
)),
);
}
}
class SectionPage extends StatefulWidget {
final int pageNumber;
final String title;
SectionPage(this.pageNumber, this.title);
@override
State createState() {
return _SectionPage();
}
}
class _SectionPage extends State with AutomaticKeepAliveClientMixin {
String urlPath;
@override
void initState() {
super.initState();
switch (widget.pageNumber) {
case 0:
urlPath = "/Section 1.html";
break;
case 1:
urlPath = "/Section 2.html";
break;
case 2:
urlPath = "/Section 3.html";
break;
}
}
@override
Widget build(BuildContext context) {
super.build(context);
return Container(
child: WebviewScaffold(
url: urlPath,
resizeToAvoidBottomInset: false,
withJavascript: true,
withZoom: false,
withLocalStorage: true,
scrollBar: false,
supportMultipleWindows: false,
hidden: true),
);
}
@override
bool get wantKeepAlive => true;
}
```
## Steps to Reproduce
I create TabBar with 3 TabBarView, every TabBarView i use WebView inside.
But when render webview it auto put appbar top and can't scroll, and bottom view empty.
## Logs
- I dont see error log in Logcat
```
```
```
```
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
Start by reproducing the provided DetailAcademicPage, TabBarView, and WebviewScaffold example in a minimal Flutter app, then inspect the plugin's WebView layout and scrolling behavior. The issue is resolved when each tab's WebView is positioned below the app bar, the lower view is not empty, and its content scrolls correctly.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart, flutter
- 领域
- mobile-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100