学无先后,达者为师

网站首页 编程语言 正文

Flutter InAppWebView在showModalBottomSheet中无法滚动

作者:langyalaoa 更新时间: 2022-02-17 编程语言

设置showModalBottomSheet的enabledDrag为false

showModalBottomSheet(
        context: context,
        isScrollControlled: true,
        enableDrag: false,
        builder: (BuildContext modalContext) {
          return Container(
            height: MediaQuery.of(context).size.height,
            color: ThemeDF().colors.bg,
            padding: EdgeInsets.only(top: ScreenUtil.getInstance().statusBarHeight),
            child: InAppWebView(
                    initialUrlRequest: URLRequest(url: Uri.parse(url)),
                    initialOptions: InAppWebViewGroupOptions(
                        crossPlatform: InAppWebViewOptions(
                          useShouldOverrideUrlLoading: true,
                          javaScriptEnabled: true,
                      ),
                    ),
                  ),
                ),
            ),
          );
        });

原文链接:https://blog.csdn.net/langyalaoa/article/details/118520990

栏目分类
最近更新