pd4d10 / git-touch

An open-source app for GitHub, GitLab, Bitbucket, Gitea, and Gitee(码云), built with Flutter
Apache License 2.0
1.56k stars 137 forks source link

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

Closed van-8 closed 3 years ago

van-8 commented 4 years ago

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 commented 4 years ago

Nice catch!

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

van-8 commented 4 years ago

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 commented 4 years ago

Would Row > Expanded > CupertinoSlidingSegmentedControl work for this case?

shreyas1599 commented 4 years ago

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?