Question : flutter change width of tabs
Answered by : jagat-guru
double width = MediaQuery.of(context).size.width; double yourWidth = width / 5;
bottom: TabBar( indicatorColor: Colors.white, indicatorSize: TabBarIndicatorSize.label, isScrollable: true, controller: _tabcontroller, tabs: <Widget>[ Container( width: 30, height: 50, alignment: Alignment.center, child: Icon( Icons.camera_alt, ), ), Container( width: yourWidth, height: 50, alignment: Alignment.center, child: Text("CHATS")), Container( width: yourWidth, height: 50, alignment: Alignment.center, child: Text("STATUS")), Container( width: yourWidth, height: 50, alignment: Alignment.center, child: Text("CALL")) ], ),`
---------------
`
Source : https://stackoverflow.com/questions/51239291/how-to-customize-tabbar-width-in-flutter | Last Update : Sun, 28 Aug 22