|
|
|
|
|
|
using Unity.UIWidgets.painting; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using TextStyle = Unity.UIWidgets.painting.TextStyle; |
|
|
|
|
|
|
|
namespace Unity.UIWidgets.material { |
|
|
|
public class TabBarTheme : Diagnosticable, IEquatable<TabBarTheme> { |
|
|
|
|
|
|
Color labelColor = null, |
|
|
|
Color unselectedLabelColor = null) { |
|
|
|
TextStyle labelStyle = null, |
|
|
|
Color unselectedLabelColor = null, |
|
|
|
TextStyle unselectedLabelStyle = null) { |
|
|
|
this.labelStyle = labelStyle; |
|
|
|
this.unselectedLabelStyle = unselectedLabelStyle; |
|
|
|
} |
|
|
|
|
|
|
|
public readonly Decoration indicator; |
|
|
|
|
|
|
public readonly Color labelColor; |
|
|
|
|
|
|
|
public readonly TextStyle labelStyle; |
|
|
|
|
|
|
|
public readonly TextStyle unselectedLabelStyle; |
|
|
|
|
|
|
|
Color unselectedLabelColor = null |
|
|
|
TextStyle labelStyle = null, |
|
|
|
Color unselectedLabelColor = null, |
|
|
|
TextStyle unselectedLabelStyle = null |
|
|
|
unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor); |
|
|
|
labelStyle: labelStyle ?? this.labelStyle, |
|
|
|
unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor, |
|
|
|
unselectedLabelStyle: unselectedLabelStyle ?? this.unselectedLabelStyle); |
|
|
|
} |
|
|
|
|
|
|
|
public static TabBarTheme of(BuildContext context) { |
|
|
|
|
|
|
indicator: Decoration.lerp(a.indicator, b.indicator, t), |
|
|
|
indicatorSize: t < 0.5 ? a.indicatorSize : b.indicatorSize, |
|
|
|
labelColor: Color.lerp(a.labelColor, b.labelColor, t), |
|
|
|
unselectedLabelColor: Color.lerp(a.unselectedLabelColor, b.unselectedLabelColor, t) |
|
|
|
labelStyle: TextStyle.lerp(a.labelStyle, b.labelStyle, t), |
|
|
|
unselectedLabelColor: Color.lerp(a.unselectedLabelColor, b.unselectedLabelColor, t), |
|
|
|
unselectedLabelStyle: TextStyle.lerp(a.unselectedLabelStyle, b.unselectedLabelStyle, t) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
hashCode = (hashCode * 397) ^ (this.indicatorSize != null ? this.indicatorSize.GetHashCode() : 0); |
|
|
|
hashCode = (hashCode * 397) ^ (this.labelColor != null ? this.labelColor.GetHashCode() : 0); |
|
|
|
hashCode = (hashCode * 397) ^ (this.labelStyle != null ? this.labelStyle.GetHashCode() : 0); |
|
|
|
hashCode = (hashCode * 397) ^ |
|
|
|
(this.unselectedLabelStyle != null ? this.unselectedLabelStyle.GetHashCode() : 0); |
|
|
|
return hashCode; |
|
|
|
} |
|
|
|
} |
|
|
|