1
+ using Unity . UIWidgets . foundation ;
2
+ using Unity . UIWidgets . painting ;
3
+ using Unity . UIWidgets . ui ;
4
+
5
+ namespace Unity . UIWidgets . material {
6
+ public class FloatingActionButtonThemeData : Diagnosticable {
7
+ public FloatingActionButtonThemeData (
8
+ Color backgroundColor = null ,
9
+ Color foregroundColor = null ,
10
+ float ? elevation = null ,
11
+ float ? disabledElevation = null ,
12
+ float ? highlightElevation = null ,
13
+ ShapeBorder shape = null
14
+ ) {
15
+ this . backgroundColor = backgroundColor ;
16
+ this . foregroundColor = foregroundColor ;
17
+ this . elevation = elevation ;
18
+ this . disabledElevation = disabledElevation ;
19
+ this . highlightElevation = highlightElevation ;
20
+ this . shape = shape ;
21
+ }
22
+
23
+ public readonly Color backgroundColor ;
24
+
25
+ public readonly Color foregroundColor ;
26
+
27
+ public readonly float ? elevation ;
28
+
29
+ public readonly float ? disabledElevation ;
30
+
31
+ public readonly float ? highlightElevation ;
32
+
33
+ public readonly ShapeBorder shape ;
34
+
35
+ public FloatingActionButtonThemeData copyWith (
36
+ Color backgroundColor ,
37
+ Color foregroundColor ,
38
+ float ? elevation ,
39
+ float ? disabledElevation ,
40
+ float ? highlightElevation ,
41
+ ShapeBorder shape
42
+ ) {
43
+ return new FloatingActionButtonThemeData (
44
+ backgroundColor : backgroundColor ?? this . backgroundColor ,
45
+ foregroundColor : foregroundColor ?? this . foregroundColor ,
46
+ elevation : elevation ?? this . elevation ,
47
+ disabledElevation : disabledElevation ?? this . disabledElevation ,
48
+ highlightElevation : highlightElevation ?? this . highlightElevation ,
49
+ shape : shape ?? this . shape
50
+ ) ;
51
+ }
52
+
53
+ public static FloatingActionButtonThemeData lerp ( FloatingActionButtonThemeData a , FloatingActionButtonThemeData b ,
54
+ float t ) {
55
+ D . assert ( t != null ) ;
56
+ if ( a == null && b == null ) {
57
+ return null ;
58
+ }
59
+
60
+ return new FloatingActionButtonThemeData (
61
+ backgroundColor : Color . lerp ( a ? . backgroundColor , b ? . backgroundColor , t ) ,
62
+ foregroundColor : Color . lerp ( a ? . foregroundColor , b ? . foregroundColor , t ) ,
63
+ elevation : MathUtils . lerpFloat ( a ? . elevation ?? 0 , b ? . elevation ?? 0 , t ) ,
64
+ disabledElevation : MathUtils . lerpFloat ( a ? . disabledElevation ?? 0 , b ? . disabledElevation ?? 0 , t ) ,
65
+ highlightElevation : MathUtils . lerpFloat ( a ? . highlightElevation ?? 0 , b ? . highlightElevation ?? 0 , t ) ,
66
+ shape : ShapeBorder . lerp ( a ? . shape , b ? . shape , t )
67
+ ) ;
68
+ }
69
+
70
+ public override int GetHashCode ( ) {
71
+ var hashCode = this . backgroundColor ? . GetHashCode ( ) ?? 0 ;
72
+ hashCode = ( hashCode * 397 ) ^ this . foregroundColor ? . GetHashCode ( ) ?? 0 ;
73
+ hashCode = ( hashCode * 397 ) ^ this . elevation ? . GetHashCode ( ) ?? 0 ;
74
+ hashCode = ( hashCode * 397 ) ^ this . disabledElevation ? . GetHashCode ( ) ?? 0 ;
75
+ hashCode = ( hashCode * 397 ) ^ this . highlightElevation ? . GetHashCode ( ) ?? 0 ;
76
+ hashCode = ( hashCode * 397 ) ^ this . shape ? . GetHashCode ( ) ?? 0 ;
77
+ return hashCode ;
78
+ }
79
+
80
+ public bool Equals ( FloatingActionButtonThemeData other ) {
81
+ if ( ReferenceEquals ( null , other ) ) {
82
+ return false ;
83
+ }
84
+
85
+ if ( ReferenceEquals ( this , other ) ) {
86
+ return true ;
87
+ }
88
+
89
+ return Equals ( this . backgroundColor , other . backgroundColor )
90
+ && Equals ( this . elevation , other . elevation )
91
+ && Equals ( this . shape , other . shape )
92
+ && Equals ( this . foregroundColor , other . foregroundColor )
93
+ && Equals ( this . disabledElevation , other . disabledElevation )
94
+ && Equals ( this . highlightElevation , other . highlightElevation ) ;
95
+ }
96
+
97
+ public override bool Equals ( object obj ) {
98
+ if ( ReferenceEquals ( null , obj ) ) {
99
+ return false ;
100
+ }
101
+
102
+ if ( ReferenceEquals ( this , obj ) ) {
103
+ return true ;
104
+ }
105
+
106
+ if ( obj . GetType ( ) != this . GetType ( ) ) {
107
+ return false ;
108
+ }
109
+
110
+ return this . Equals ( ( FloatingActionButtonThemeData ) obj ) ;
111
+ }
112
+
113
+ public override void debugFillProperties ( DiagnosticPropertiesBuilder properties ) {
114
+ base . debugFillProperties ( properties ) ;
115
+ FloatingActionButtonThemeData defaultData = new FloatingActionButtonThemeData ( ) ;
116
+
117
+ properties . add ( new DiagnosticsProperty < Color > ( "backgroundColor" , this . backgroundColor ,
118
+ defaultValue : defaultData . backgroundColor ) ) ;
119
+ properties . add ( new DiagnosticsProperty < Color > ( "foregroundColor" , this . foregroundColor ,
120
+ defaultValue : defaultData . foregroundColor ) ) ;
121
+ properties . add ( new DiagnosticsProperty < float ? > ( "elevation" , this . elevation ,
122
+ defaultValue : defaultData . elevation ) ) ;
123
+ properties . add ( new DiagnosticsProperty < float ? > ( "disabledElevation" , this . disabledElevation ,
124
+ defaultValue : defaultData . disabledElevation ) ) ;
125
+ properties . add ( new DiagnosticsProperty < float ? > ( "highlightElevation" , this . highlightElevation ,
126
+ defaultValue : defaultData . highlightElevation ) ) ;
127
+ properties . add ( new DiagnosticsProperty < ShapeBorder > ( "shape" , this . shape , defaultValue : defaultData . shape ) ) ;
128
+ }
129
+ }
130
+ }
0 commit comments