From 00aa71ff11a9ca68a1c8d9c5cb0d453a3ce870b1 Mon Sep 17 00:00:00 2001 From: shreyas1599 Date: Tue, 15 Sep 2020 17:23:31 +0530 Subject: [PATCH 1/2] fix: use container to fix expansion of tab --- lib/scaffolds/tab.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/scaffolds/tab.dart b/lib/scaffolds/tab.dart index c78afcbd..771ed7a4 100644 --- a/lib/scaffolds/tab.dart +++ b/lib/scaffolds/tab.dart @@ -34,9 +34,11 @@ class TabScaffold extends StatelessWidget { onValueChanged: onTabSwitch, children: tabs.asMap().map((key, text) => MapEntry( key, - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Text(text), + Container( + width: 100, + child: Center( + child: Text(text), + ), ))), ), ); From 60c7c7ea21ae7e368bf5a32a48cf382dfa6ddd3d Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Thu, 8 Oct 2020 14:38:33 +0800 Subject: [PATCH 2/2] fixup --- lib/scaffolds/tab.dart | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/scaffolds/tab.dart b/lib/scaffolds/tab.dart index 771ed7a4..efd1a93e 100644 --- a/lib/scaffolds/tab.dart +++ b/lib/scaffolds/tab.dart @@ -29,17 +29,21 @@ class TabScaffold extends StatelessWidget { case AppThemeType.cupertino: return DefaultTextStyle( style: DefaultTextStyle.of(context).style.copyWith(fontSize: 14), - child: CupertinoSlidingSegmentedControl( - groupValue: activeTab, - onValueChanged: onTabSwitch, - children: tabs.asMap().map((key, text) => MapEntry( - key, - Container( - width: 100, - child: Center( - child: Text(text), - ), - ))), + child: Row( + children: [ + Expanded( + child: CupertinoSlidingSegmentedControl( + groupValue: activeTab, + onValueChanged: onTabSwitch, + children: tabs.asMap().map((key, text) => MapEntry( + key, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text(text), + ))), + ), + ), + ], ), ); default: