From bb2e0e72c5f78937d08acb73fe721eb01cdaf983 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Mon, 23 Sep 2024 13:57:08 +0200 Subject: [PATCH] fix --- lib/pages/flow.dart | 48 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/lib/pages/flow.dart b/lib/pages/flow.dart index f017662..8585754 100644 --- a/lib/pages/flow.dart +++ b/lib/pages/flow.dart @@ -130,29 +130,31 @@ class _FlowsPageState extends State { return const CircularProgressIndicator(); } - return Scaffold( - appBar: AppBar( - title: const Text("Flows"), - bottom: TabBar( - tabs: const [ - Tab(text: "All"), - Tab(text: "Produces"), - Tab(text: "Depends"), - Tab(text: "Active") - ], - onTap: (value) { - setState(() { - tabSelection = value; - }); - }, - )), - body: switch (tabSelection) { - 0 => listAllFlowInfos(context, flowInfos!), - 1 => listFlowInfoByProduced(context, flowInfos!), - 2 => listFlowInfoByDependant(context, flowInfos!), - 3 => listFlowInfoByActive(context, flowInfos!), - _ => const Text("..."), - }); + return DefaultTabController( + length: 4, + child: Scaffold( + appBar: AppBar( + title: const Text("Flows"), + bottom: TabBar( + tabs: const [ + Tab(text: "All"), + Tab(text: "Produces"), + Tab(text: "Depends"), + Tab(text: "Active") + ], + onTap: (value) { + setState(() { + tabSelection = value; + }); + }, + )), + body: switch (tabSelection) { + 0 => listAllFlowInfos(context, flowInfos!), + 1 => listFlowInfoByProduced(context, flowInfos!), + 2 => listFlowInfoByDependant(context, flowInfos!), + 3 => listFlowInfoByActive(context, flowInfos!), + _ => const Text("..."), + })); } }