I have a weekview with daily exercises logged like shown in the attachment. The days in red are disabled. When I swipe the page, it needs to skip the disabled tab and go directly to the next active tab. For e.g. if I'm on Sunday and swipe, it should go to Tuesday skipping monday and vice versa(if I swipe backwards from tuesday, it should go to monday). Also, clicking on enabled days should take me to the respective page.
Inside the pageview.builder I built the pages. When I swipe a page, itemBuilder of PageView is called and the pages changes based on the index and the index increments automatically. I'm not sure how to skip the disabled screens. Please help.
Here is my code:
Stack(
children: <Widget>[
new PageView.builder(
controller: _controller,
itemBuilder: (BuildContext context, int index) {
return Container(
padding: EdgeInsets.only(top:50.0),
child: ListView(
children: <Widget>[
Text('Trying out')
],
));
},
),
new Positioned(
top: 0.0,
left: 0.0,
right: 0.0,
child: Center(
child: new DotsIndicator(
controller: _controller,
itemCount: 7,
onPageSelected: (int page) {
_controller.animateToPage(
page,
duration: _kDuration,
curve: _kCurve,
);
},
),
),)
)]
)