1

我使用 CustomScrollview->SliverAppBar->SliverFillRemaining->WebView。出现的问题是网页不可滚动。当我删除 SliverAppBar 时,它可以正常工作。但是当使用 SliverAppBar 时它不能正常工作。我应该如何解决这个问题?

CustomScrollView(
                shrinkWrap: true,
                slivers: [
                  SliverAppBar(
                    floating: true,
                    //for status bar design
                    backwardsCompatibility: false,
                    backgroundColor: Colors.white,
                    elevation: 0,
                    systemOverlayStyle: SystemUiOverlayStyle(
                      statusBarColor: Colors.white,
                      // statusBarBrightness: Brightness.light,
                      statusBarIconBrightness: Brightness.dark,
                    ),
                    // systemOverlayStyle: statusBarDesign,
                    actions: [
                      NavigationControls(_controller.future),
                    ],
 
                    //pinned: true,
                  ),
                  SliverFillRemaining(
                    child: Container(
                      height: MediaQuery.of(context).size.height,
                      width: MediaQuery.of(context).size.width,
                      child: WebView(
                        gestureNavigationEnabled: true,
                        initialUrl: 'https://rosbd.org/',
                        javascriptMode: JavascriptMode.unrestricted,
                        onWebViewCreated:
                            (WebViewController webViewController) {
                          _controller.complete(webViewController);
                        },
                        onPageStarted: (start) {
                          setState(() {
                            _checkInternetConnetion();
                          });
                        },
                        onPageFinished: (finish) {
                          setState(() {
                            _checkInternetConnetion();
                          });
                        },
                      ),
                    ),
                  )
                ]);
4

0 回答 0