I have a condition which I want to disable my pageview scroll while my splash screen is loading. I dont want to use native splash screen etc because I need my splash screen persist until my data is fetched and displayed in the screen. I was already able to do this which my singlechildscrollview like this
SingleChildScrollView(
physics:
G.doesSplashAlreadyLoaded?AlwaysScrollableScrollPhysics():NeverScrollableScrollPhysics(),
);
but when I’m trying it to do with my pageview I have a weird bug which my pageview doesn’t work until I manually changing the page. I tried multiple solutions like these ones
PageView(
controller: _pageController,
physics: G.doesSplashAlreadyLoaded?null:NeverScrollableScrollPhysics(),
onPageChanged: (index) {
setState(() {
_selectedIndex = index;
});
},
children: [
// Home screen content
AccountFragment(pageColor: G.appBarColors[0]),
SearchFragment(
pageColor: G.appBarColors[0],
currentGenre: widget.fromTag),
HomeFragment(
pageColor: G.appBarColors[2],
onTagged: (int index) {
_pageController.jumpToPage(1);
},
),
// Account screen content
],
)
or
PageView(
controller: _pageController,
physics: G.doesSplashAlreadyLoaded?ClampingScrollPhysics():NeverScrollableScrollPhysics(),
onPageChanged: (index) {
setState(() {
_selectedIndex = index;
});
},
children: [
// Home screen content
AccountFragment(pageColor: G.appBarColors[0]),
SearchFragment(
pageColor: G.appBarColors[0],
currentGenre: widget.fromTag),
HomeFragment(
pageColor: G.appBarColors[2],
onTagged: (int index) {
_pageController.jumpToPage(1);
},
),
// Account screen content
],
)
and every possible scroll physics.
Any solutions to this problem will be appreciated