Fix Material 3 tab indicator weight and position (#125883)

fixes https://github.com/flutter/flutter/issues/123112

### Description
1. Add proper M3 indicator height aka`IndictorWeight` from the M3 specs for the primary tab bar with label indicator size.
db6074ade4/dev/tools/gen_defaults/data/navigation_tab_primary.json (L9)
(this was held due to `indicatorWeight` having a hard-coded value) 

and added a secondary tab bar indicator height.
2. Set a minimum value for the rounded indicator to maintain the indicator shape.
3. With proper indicator height, the rounded indicator position is also fixed.
4. Fix round indicator is shown for the primary tab bar with tab indicator size.
5. Above changes fix https://github.com/flutter/flutter/issues/123112.
6. Fix the `startOffset` const value from https://github.com/flutter/flutter/pull/125036  to match docs and move it to a variable.
This commit is contained in:
Taha Tesser
2023-05-05 17:09:18 +03:00
committed by GitHub
parent 9d9ad2d52f
commit ad009fb7ac
5 changed files with 430 additions and 15 deletions

View File

@@ -72,6 +72,8 @@ class _${blockName}PrimaryDefaultsM3 extends TabBarTheme {
@override
TabAlignment? get tabAlignment => isScrollable ? TabAlignment.start : TabAlignment.fill;
static double indicatorWeight = ${tokens['md.comp.primary-navigation-tab.active-indicator.height']};
}
class _${blockName}SecondaryDefaultsM3 extends TabBarTheme {