I think you need to provide a little context to your code since there are loads of ways to implement PageView and indicator. I think you are using TabBarView as parent to the PageView because By default PageView doesn't have indicator itself, TabBarView has.
assuming I am right you really don't need to use TabBarView unless you want to use different tabs, and each tab has different PageView or other widgets. Judging your UI i think PageView with controller can satisfy your UI need.
Class XYZ extends StatefullWidget{
.......
}
Class _XYZ extends State<XYZ>
with SingleTickerProviderStateMixin{
PageController _pageController;
int pageNumber = 0;
void initState() {
super.initState();
_pageController = PageController();
}
..................
//inside build PageView
PageView(
controller: _pageController,
onPageChanged: (pageIndex) {
setState(() {
pageNumber = pageIndex;
});
},
children: <Widget>[
Notes(), // scaffold or widget or other class
Wochenplan(), scaffold or widget or other class
ETC(), // scaffold or widget or other class
],
),
..................
//inside build bottom nav icons
Row(
children: <Widget>[
buildTabButton(int currentIndex, int pageNumber, String image),
buildTabButton2....,
buildTabButton3...,
],
)
.......
buildTabButton1........
buildTabButton2(int currentIndex, int pageNumber, String image) {
return AnimatedContainer(
height: _height,
width: currentIndex == pageNumber ? 100 : 30,
padding: EdgeInsets.all(10),
duration: Duration(milliseconds: 300),
decoration: BoxDecoration(),// use currentIndex == pageNumber to decorate current widget and others
child: ../*ClickableWidget*/, //onClckWochenplan() // and so on
);
}
buildTabButton3........
........................
//onPressed or onTap functions which you can implement inside widgets as well..
void ABC() {
_pageController.animateToPage(0,
duration: Duration(milliseconds: 500), curve: Curves.decelerate);
}
void onClckWochenplan() {
_pageController.animateToPage(1,
duration: Duration(milliseconds: 500), curve: Curves.decelerate);
}
void DEF() {
_pageController.animateToPage(2,
duration: Duration(milliseconds: 500), curve: Curves.decelerate);
}
I hope It helps.. else provide some code to get help from the community.. cheers