Проблема NestedScrollView, выдавая ошибку при переключении между двумя экранами - PullRequest
1 голос
/ 11 октября 2019

У меня есть некоторые проблемы с NestedScrollView. Я реализовал PageView с BottomNavigationBar, и иногда, когда я переключаюсь между двумя экранами, я получаю эту ошибку:

'package: flutter / src / widgets / nested_scroll_view.dart': Неудачное утверждение: строка 501 поз. 14:'position.minScrollExtent! = null && position.pixels! = null': не соответствует действительности.

enter image description here

child: NestedScrollView(
      controller: _controller,
      headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            automaticallyImplyLeading: false,
            pinned: true,
            expandedHeight: 140.0,
            floating: false,
            centerTitle: true,
            flexibleSpace: FlexibleSpaceBar(
              centerTitle: true,
              background: new Container(
                child: FutureBuilder(
                  future: CoverImagesApi().getImageFile(1),
                  builder: (context, snapshot) {
                    if(snapshot.data != null) {
                      return Container(
                        child: Column(
                          children: <Widget>[
                            Expanded(
                              flex: 5,
                              child: Container(
                                alignment: Alignment.topCenter,
                              ),
                            ),
                            Expanded(
                              flex: 2,
                              child: new Container(
                                child: Center(
                                child: Text('Obecná tabuľa',
                                  style: TextStyle(
                                    fontSize: 26.0,
                                    fontWeight: FontWeight.bold
                                  ),
                                  textAlign: TextAlign.center,
                                ),
                                ),
                                decoration: BoxDecoration(
                                  color: Color.fromRGBO(255, 255, 255, 0.8)
                                ),
                                alignment: Alignment.bottomCenter, //variable above
                              )
                            ),
                          ],
                        ),
                        decoration: new BoxDecoration(
                          image: new DecorationImage(
                            fit: BoxFit.cover
                            image: snapshot.data.existsSync() ? Image.file(snapshot.data).image : AssetImage('assets/tabula.jpg'),
                          ),
                        ),
                      );
                    } else {
                      return Container(height: 0.0, width: 0.0);
                    }
                  }
                ),
              ),
            ),
          ),
        ];

      },
      body: DataFiller(scaffoldKey: _scaffoldKey),
    )

У кого-нибудь есть идеи?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...