您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
69 行
2.2 KiB
69 行
2.2 KiB
using System;
|
|
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.painting;
|
|
using Unity.UIWidgets.widgets;
|
|
|
|
namespace Unity.UIWidgets.material {
|
|
public class DialogTheme : Diagnosticable, IEquatable<DialogTheme> {
|
|
public DialogTheme(ShapeBorder shape = null) {
|
|
this.shape = shape;
|
|
}
|
|
|
|
public readonly ShapeBorder shape;
|
|
|
|
public DialogTheme copyWith(ShapeBorder shape = null) {
|
|
return new DialogTheme(shape: shape ?? this.shape);
|
|
}
|
|
|
|
public static DialogTheme of(BuildContext context) {
|
|
return Theme.of(context).dialogTheme;
|
|
}
|
|
|
|
public static DialogTheme lerp(DialogTheme a, DialogTheme b, float t) {
|
|
return new DialogTheme(
|
|
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
|
|
);
|
|
}
|
|
|
|
public bool Equals(DialogTheme other) {
|
|
if (ReferenceEquals(null, other)) {
|
|
return false;
|
|
}
|
|
if (ReferenceEquals(this, other)) {
|
|
return true;
|
|
}
|
|
return Equals(this.shape, other.shape);
|
|
}
|
|
|
|
public override bool Equals(object obj) {
|
|
if (ReferenceEquals(null, obj)) {
|
|
return false;
|
|
}
|
|
if (ReferenceEquals(this, obj)) {
|
|
return true;
|
|
}
|
|
if (obj.GetType() != this.GetType()) {
|
|
return false;
|
|
}
|
|
return this.Equals((DialogTheme) obj);
|
|
}
|
|
|
|
public override int GetHashCode() {
|
|
return (this.shape != null ? this.shape.GetHashCode() : 0);
|
|
}
|
|
|
|
public static bool operator ==(DialogTheme left, DialogTheme right) {
|
|
return Equals(left, right);
|
|
}
|
|
|
|
public static bool operator !=(DialogTheme left, DialogTheme right) {
|
|
return !Equals(left, right);
|
|
}
|
|
|
|
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
|
base.debugFillProperties(properties);
|
|
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape,
|
|
defaultValue: Diagnostics.kNullDefaultValue));
|
|
}
|
|
}
|
|
}
|