如何拍摄NestedScrollView的屏幕截图

时间:2019-05-28 01:47:19

标签: flutter

我正在使用RepaintBoundary来获取当前小部件NestedScrollView的屏幕截图。但是它只能捕获当时在屏幕上可见的内容。

RepaintBoundary(
          key: _screenContainer,
          child: NestedScrollView(
              headerSliverBuilder:
                  (BuildContext context, bool innerBoxIsScrolled) {
                return <Widget>[
                  SliverOverlapAbsorber(
                    handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
                        context),
                    child: SliverAppBar(
                      backgroundColor: Color(0xfff1f1f1),
                      forceElevated: innerBoxIsScrolled,
                      bottom: PreferredSize(
                          child: Container(),
                          preferredSize: Size.fromHeight(_appBarHeight)),
                      flexibleSpace: Column(
                        children: <Widget>[
                          _swiper(),
                          _spike(),
                        ],
                      ),
                    ),
                  ),
                  SliverPersistentHeader(
                    delegate: _SliverAppBarDelegate(_timeSelection()),
                    pinned: true,
                  ),
                ];
              },
              body:
                  TabBarView(controller: _timeTabController, children: <Widget>[
                _listItem(1),
                _listItem(2),
                _listItem(3),
                _listItem(4),
                _listItem(5),
                _listItem(6),
              ])),
        ),

有什么方法可以捕获整个NestedScrollView

0 个答案:

没有答案