I am trying to create custom titlebar layout for my windows version of flutter app.
The blank space between open file button and windows action buttons is MoveWindow Widget which acts as a drag handle.
When tabs are added the tabbar should grow to the maxwidth and if started to overflow, the tabbar should be scrollable.
These two images indicate the initial and final state of my UI.
class DynamicTabs extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(body: DefaultTabController(
length: 6,
child: Row(children: [
IconButton(icon: Icon(Icons.home), onPressed: (){}),
Flexible(child: TabBar(
isScrollable: true,
tabs: [
Tab(text: "Tab 1"),
Tab(text: "Tab 1"),
Tab(text: "Tab 1"),
Tab(text: "Tab 1"),
Tab(text: "Tab 1"),
Tab(text: "Tab 1"),
Tab(text: "Tab 1"),
])),
Expanded(child: MoveWindow()),
WindowsActionButtons()
])
));
}
}
This is the code snippet I am trying to achieve that behavior. Currently, both [tabbar and MoveWindow] are taking equal space. I know that when there is more than one flex widget inside row/col, they divide the space equally but unable to find any way to implement this.
Any hints on how to solve this will be appreciated.