Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI : Container length of TabStatefulScaffold in "Cupertino style" changes when switching tabs #95

Closed
van-8 opened this issue Jul 12, 2020 · 4 comments · Fixed by #101
Closed

Comments

@van-8
Copy link
Contributor

van-8 commented Jul 12, 2020

For example, in the Github Notificiations_Screen, the word "Participating" is long. When the tab is selected, it expands the entire Tab widget. This is mostly likely because the selected state has a heavier fontweight, thus expanding the entire parent Container Widget. This occurs in Cupertino style only.

gittouch UI tab issue

Possible fix: When tab is active, do not change the fontweight.
I only started learning coding and Flutter a few months ago, so if I figure it out I'll submit a merge.

@pd4d10
Copy link
Owner

pd4d10 commented Jul 12, 2020

Nice catch!

How about expanding the tabbar to full width? Then it would have enough space.

@van-8
Copy link
Contributor Author

van-8 commented Jul 14, 2020

Perfect.

In the Apple Human Interface Guidelines, the Segmented Controls are always full width. It seems this might be Flutter not updating their widget to iOS13 standards? Maybe we can submit this fix to the main Flutter branch?

Seems like in lib/scaffolds/tab.dart you can just do a quick change of line 64 from DefaultTabController() to a CupertinoSlidingSegmentedControl() .

I'm so bad at coding. You have CupertinoSlidingSegmentedControl() on line 32. I don't know how to fix. 😅

Here's an example for 2 segments, which would apply to the GitTouch trending_screen.

segmented controls screenshot

@pd4d10
Copy link
Owner

pd4d10 commented Jul 15, 2020

Would Row > Expanded > CupertinoSlidingSegmentedControl work for this case?

@shreyas1599
Copy link
Contributor

shreyas1599 commented Aug 17, 2020

Would Row > Expanded > CupertinoSlidingSegmentedControl work for this case?

This didn't work. I changed the padding to 12 and it seemed to work on iphone se2 and 11 pro. Guess it should work for all devices. Shall I open a pr? Or @van-8 would you like to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants