浏览代码

Update tab bar theme.

/main
Yuncong Zhang 5 年前
当前提交
8dd57688
共有 1 个文件被更改,包括 22 次插入4 次删除
  1. 26
      Runtime/material/tab_bar_theme.cs

26
Runtime/material/tab_bar_theme.cs


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;
}
}

正在加载...
取消
保存