widget.indicator; final TabBarTheme tabBarTheme = TabBarTheme.of(context); if (tabBarTheme.indicator != null) return tabBarTheme.indicator; Color color = widget.indicatorColor ?? Theme.of(context).indicatorColor; // ThemeData tries to avoid this by having indicatorColor avoid being the // primaryColor. However, it's possible that the tab bar is on a // Material that isn't the primaryColor. In that case, if the indicator // color ends up matching the material's color, then this overrides it. // When that happens, automatic transitions of the theme will likely look // ugly as the indicator color suddenly snaps to white at one end, but it's // not clear how to avoid that any further. // // The material's color might be null (if it's a transparency). In that case // there's no good way for us to find out what the color is so we don't. if (color.value == Material.of(context).color?.value) color = Colors.white; 5BC#BSͷதͷɺJOEJDBUPSͷॲཧ 'MVUUFSҎલ IUUQTHJUIVCDPN fl VUUFS fl VUUFSCMPCQBDLBHFT fl VUUFSMJCTSDNBUFSJBMUBCTEBSU
widget.indicator; final TabBarTheme tabBarTheme = TabBarTheme.of(context); if (tabBarTheme.indicator != null) return tabBarTheme.indicator; Color color = widget.indicatorColor ?? Theme.of(context).indicatorColor; // ThemeData tries to avoid this by having indicatorColor avoid being the // primaryColor. However, it's possible that the tab bar is on a // Material that isn't the primaryColor. In that case, if the indicator // color ends up matching the material's color, then this overrides it. // When that happens, automatic transitions of the theme will likely look // ugly as the indicator color suddenly snaps to white at one end, but it's // not clear how to avoid that any further. // // The material's color might be null (if it's a transparency). In that case // there's no good way for us to find out what the color is so we don't. if (color.value == Material.of(context).color?.value) color = Colors.white; *OEJDBUPS$PMPS͕QSJNBSZ$PMPSͱҰக͢Δ߹ɺ നͰ্ॻ͖͍ͯ͠Δ 5BC#BSͷதͷɺJOEJDBUPSͷॲཧ 'MVUUFSҎલ
widget.indicator; final TabBarTheme tabBarTheme = TabBarTheme.of(context); if (tabBarTheme.indicator != null) return tabBarTheme.indicator; Color color = widget.indicatorColor ?? Theme.of(context).indicatorColor; // ThemeData tries to avoid this by having indicatorColor avoid being the // primaryColor. However, it's possible that the tab bar is on a // Material that isn't the primaryColor. In that case, if the indicator // color ends up matching the material's color, then this overrides it. // When that happens, automatic transitions of the theme will likely look // ugly as the indicator color suddenly snaps to white at one end, but it's // not clear how to avoid that any further. // // The material's color might be null (if it's a transparency). In that case // there's no good way for us to find out what the color is so we don't. if (color.value == Material.of(context).color?.value) color = Colors.white; *OEJDBUPS$PMPS͕QSJNBSZ$PMPSͱҰக͢Δ߹ɺ നͰ্ॻ͖͍ͯ͠Δ JOEJDBUPSجຊతʹQSJNBSZ$PMPSͷ ্ʹඳը͞ΕΔ͜ͱΛఆ͍ͯ͠ΔͨΊɺ ࣗવͳڍಈ 5BC#BSͷதͷɺJOEJDBUPSͷॲཧ 'MVUUFSҎલ
?? Theme.of(context).indicatorColor; // ThemeData tries to avoid this by having indicatorColor avoid being the // primaryColor. However, it's possible that the tab bar is on a // Material that isn't the primaryColor. In that case, if the indicator // color ends up matching the material's color, then this overrides it. // When that happens, automatic transitions of the theme will likely look // ugly as the indicator color suddenly snaps to white at one end, but it's // not clear how to avoid that any further. // // The material's color might be null (if it's a transparency). In that case // there's no good way for us to find out what the color is so we don't. // // TODO(xu-baolin): Remove automatic adjustment to white color indicator // with a better long-term solution. // https://github.com/flutter/flutter/pull/68171#pullrequestreview-517753917 if (widget.automaticIndicatorColorAdjustment && color.value == Material.of(context)?.color?.value) color = Colors.white; 5BC#BSͷதͷɺJOEJDBUPSͷॲཧ 'MVUUFSd IUUQTHJUIVCDPN fl VUUFS fl VUUFSCMPCQBDLBHFT fl VUUFSMJCTSDNBUFSJBMUBCTEBSU 50%0ίϝϯτͱҰॹʹϑϥά͕Ճ͞Ε͍ͯΔ
[indicatorColor]. /// /// If [automaticIndicatorColorAdjustment] is true, /// then the [indicatorColor] will be automatically adjusted to [Colors.white] /// when the [indicatorColor] is same as [Material.color] of the [Material] parent widget. final bool automaticIndicatorColorAdjustment; BVUPNBUJD*OEJDBUPS$PMPS"EKVTUNFOUͱ͍͏ϑϥά͕Ճ USVFͷ߹طଘͷΑ͏ʹɺJOEJDBUPS$PMPSQSJNBSZ$PMPSͷ߹ʹ JOEJDBUPS$PMPSΛࣗಈͰനʹ͢ΔڍಈʹͳΔɻ ͜ΕΛ͍͗ͨ߹ɺϑϥάΛGBMTFʹ͢Δ͜ͱͰରԠՄೳ