Yuncong Zhang
5 年前
当前提交
38f23b4b
共有 41 个文件被更改,包括 1416 次插入 和 480 次删除
-
58Runtime/material/app.cs
-
38Runtime/material/app_bar.cs
-
40Runtime/material/bottom_app_bar.cs
-
53Runtime/material/bottom_navigation_bar.cs
-
1Runtime/material/bottom_sheet.cs
-
37Runtime/material/button.cs
-
2Runtime/material/button_theme.cs
-
26Runtime/material/card.cs
-
74Runtime/material/dialog.cs
-
64Runtime/material/dialog_theme.cs
-
11Runtime/material/drawer.cs
-
11Runtime/material/expansion_tile.cs
-
17Runtime/material/flexible_space_bar.cs
-
72Runtime/material/float_action_button.cs
-
114Runtime/material/float_action_button_location.cs
-
206Runtime/material/input_decorator.cs
-
19Runtime/material/list_tile.cs
-
31Runtime/material/material.cs
-
1Runtime/material/material_button.cs
-
72Runtime/material/outline_button.cs
-
50Runtime/material/reorderable_list.cs
-
88Runtime/material/scaffold.cs
-
75Runtime/material/switch.cs
-
26Runtime/material/tab_bar_theme.cs
-
44Runtime/material/tabs.cs
-
146Runtime/material/text_field.cs
-
28Runtime/material/text_theme.cs
-
51Runtime/material/theme_data.cs
-
2Runtime/painting/notched_shapes.cs
-
82Runtime/widgets/editable_text.cs
-
14Runtime/widgets/gesture_detector.cs
-
8Runtime/widgets/page_view.cs
-
28Runtime/widgets/scrollable.cs
-
6Runtime/widgets/single_child_scroll_view.cs
-
2Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs
-
112Runtime/material/app_bar_theme.cs
-
3Runtime/material/app_bar_theme.cs.meta
-
89Runtime/material/bottom_app_bar_theme.cs
-
3Runtime/material/bottom_app_bar_theme.cs.meta
-
89Runtime/material/card_theme.cs
-
3Runtime/material/card_theme.cs.meta
|
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.service; |
|||
using Unity.UIWidgets.ui; |
|||
using Unity.UIWidgets.widgets; |
|||
|
|||
namespace Unity.UIWidgets.material { |
|||
public class AppBarTheme : Diagnosticable { |
|||
public AppBarTheme( |
|||
Brightness? brightness = null, |
|||
Color color = null, |
|||
float? elevation = null, |
|||
IconThemeData iconTheme = null, |
|||
TextTheme textTheme = null |
|||
) { |
|||
this.brightness = brightness; |
|||
this.color = color; |
|||
this.elevation = elevation; |
|||
this.iconTheme = iconTheme; |
|||
this.textTheme = textTheme; |
|||
} |
|||
|
|||
public readonly Brightness? brightness; |
|||
|
|||
public readonly Color color; |
|||
|
|||
public readonly float? elevation; |
|||
|
|||
public readonly IconThemeData iconTheme; |
|||
|
|||
public readonly TextTheme textTheme; |
|||
|
|||
AppBarTheme copyWith( |
|||
Brightness? brightness = null, |
|||
Color color = null, |
|||
float? elevation = null, |
|||
IconThemeData iconTheme = null, |
|||
TextTheme textTheme = null |
|||
) { |
|||
return new AppBarTheme( |
|||
brightness: brightness ?? this.brightness, |
|||
color: color ?? this.color, |
|||
elevation: elevation ?? this.elevation, |
|||
iconTheme: iconTheme ?? this.iconTheme, |
|||
textTheme: textTheme ?? this.textTheme |
|||
); |
|||
} |
|||
|
|||
public static AppBarTheme of(BuildContext context) { |
|||
return Theme.of(context).appBarTheme; |
|||
} |
|||
|
|||
public static AppBarTheme lerp(AppBarTheme a, AppBarTheme b, float t) { |
|||
return new AppBarTheme( |
|||
brightness: t < 0.5f ? a?.brightness : b?.brightness, |
|||
color: Color.lerp(a?.color, b?.color, t), |
|||
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t), |
|||
iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t), |
|||
textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t) |
|||
); |
|||
} |
|||
|
|||
public override int GetHashCode() { |
|||
var hashCode = this.brightness?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.color?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.iconTheme?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.textTheme?.GetHashCode() ?? 0; |
|||
return hashCode; |
|||
} |
|||
|
|||
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((AppBarTheme) obj); |
|||
} |
|||
|
|||
public static bool operator ==(AppBarTheme left, AppBarTheme right) { |
|||
return Equals(left, right); |
|||
} |
|||
|
|||
public static bool operator !=(AppBarTheme left, AppBarTheme right) { |
|||
return !Equals(left, right); |
|||
} |
|||
|
|||
public bool Equals(AppBarTheme other) { |
|||
return other.brightness == this.brightness |
|||
&& other.color == this.color |
|||
&& other.elevation == this.elevation |
|||
&& other.iconTheme == this.iconTheme |
|||
&& other.textTheme == this.textTheme; |
|||
} |
|||
|
|||
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) { |
|||
base.debugFillProperties(properties); |
|||
properties.add(new DiagnosticsProperty<Brightness?>("brightness", this.brightness, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<IconThemeData>("iconTheme", this.iconTheme, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<TextTheme>("textTheme", this.textTheme, defaultValue: null)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0c0ee979ef6b4f32a092532c3bdae31e |
|||
timeCreated: 1556178331 |
|
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.painting; |
|||
using Unity.UIWidgets.ui; |
|||
using Unity.UIWidgets.widgets; |
|||
|
|||
namespace Unity.UIWidgets.material { |
|||
public class BottomAppBarTheme : Diagnosticable { |
|||
public BottomAppBarTheme( |
|||
Color color = null, |
|||
float? elevation = null, |
|||
NotchedShape shape = null |
|||
) { |
|||
} |
|||
|
|||
public readonly Color color; |
|||
|
|||
public readonly float? elevation; |
|||
|
|||
public readonly NotchedShape shape; |
|||
|
|||
BottomAppBarTheme copyWith( |
|||
Color color = null, |
|||
float? elevation = null, |
|||
NotchedShape shape = null |
|||
) { |
|||
return new BottomAppBarTheme( |
|||
color: color ?? this.color, |
|||
elevation: elevation ?? this.elevation, |
|||
shape: shape ?? this.shape |
|||
); |
|||
} |
|||
|
|||
public static BottomAppBarTheme of(BuildContext context) { |
|||
return Theme.of(context).bottomAppBarTheme; |
|||
} |
|||
|
|||
public static BottomAppBarTheme lerp(BottomAppBarTheme a, BottomAppBarTheme b, float t) { |
|||
return new BottomAppBarTheme( |
|||
color: Color.lerp(a?.color, b?.color, t), |
|||
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t), |
|||
shape: t < 0.5f ? a?.shape : b?.shape |
|||
); |
|||
} |
|||
|
|||
public override int GetHashCode() { |
|||
var hashCode = this.color?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.shape?.GetHashCode() ?? 0; |
|||
return hashCode; |
|||
} |
|||
|
|||
public bool Equals(BottomAppBarTheme other) { |
|||
return other.color == this.color |
|||
&& other.elevation == this.elevation |
|||
&& other.shape == this.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((BottomAppBarTheme) obj); |
|||
} |
|||
|
|||
public static bool operator ==(BottomAppBarTheme left, BottomAppBarTheme right) { |
|||
return Equals(left, right); |
|||
} |
|||
|
|||
public static bool operator !=(BottomAppBarTheme left, BottomAppBarTheme right) { |
|||
return !Equals(left, right); |
|||
} |
|||
|
|||
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) { |
|||
base.debugFillProperties(properties); |
|||
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<NotchedShape>("shape", this.shape, defaultValue: null)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9c88d19dd1254f4eb6c0c998084832ea |
|||
timeCreated: 1556185402 |
|
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.painting; |
|||
using Unity.UIWidgets.ui; |
|||
using Unity.UIWidgets.widgets; |
|||
|
|||
namespace Unity.UIWidgets.material { |
|||
public class CardTheme : Diagnosticable { |
|||
public CardTheme( |
|||
Clip? clipBehavior = null, |
|||
Color color = null, |
|||
float? elevation = null, |
|||
EdgeInsets margin = null, |
|||
ShapeBorder shape = null |
|||
) { |
|||
D.assert(elevation == null || elevation >= 0.0f); |
|||
this.clipBehavior = clipBehavior; |
|||
this.color = color; |
|||
this.elevation = elevation; |
|||
this.margin = margin; |
|||
this.shape = shape; |
|||
} |
|||
|
|||
public readonly Clip? clipBehavior; |
|||
|
|||
public readonly Color color; |
|||
|
|||
public readonly float? elevation; |
|||
|
|||
public readonly EdgeInsets margin; |
|||
|
|||
public readonly ShapeBorder shape; |
|||
|
|||
CardTheme copyWith( |
|||
Clip? clipBehavior = null, |
|||
Color color = null, |
|||
float? elevation = null, |
|||
EdgeInsets margin = null, |
|||
ShapeBorder shape = null |
|||
) { |
|||
return new CardTheme( |
|||
clipBehavior: this.clipBehavior ?? this.clipBehavior, |
|||
color: color ?? this.color, |
|||
elevation: this.elevation ?? this.elevation, |
|||
margin: margin ?? this.margin, |
|||
shape: shape ?? this.shape |
|||
); |
|||
} |
|||
|
|||
public static CardTheme of(BuildContext context) { |
|||
return Theme.of(context).cardTheme; |
|||
} |
|||
|
|||
public static CardTheme lerp(CardTheme a, CardTheme b, float t) { |
|||
return new CardTheme( |
|||
clipBehavior: t < 0.5f ? a?.clipBehavior : b?.clipBehavior, |
|||
color: Color.lerp(a?.color, b?.color, t), |
|||
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t), |
|||
margin: EdgeInsets.lerp(a?.margin, b?.margin, t), |
|||
shape: ShapeBorder.lerp(a?.shape, b?.shape, t) |
|||
); |
|||
} |
|||
|
|||
public override int GetHashCode() { |
|||
var hashCode = this.clipBehavior?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.color?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.margin?.GetHashCode() ?? 0; |
|||
hashCode = (hashCode * 397) ^ this.shape?.GetHashCode() ?? 0; |
|||
return hashCode; |
|||
} |
|||
|
|||
public bool Equals(CardTheme other) { |
|||
return other.clipBehavior == this.clipBehavior |
|||
&& other.color == this.color |
|||
&& other.elevation == this.elevation |
|||
&& other.margin == this.margin |
|||
&& other.shape == this.shape; |
|||
} |
|||
|
|||
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) { |
|||
base.debugFillProperties(properties); |
|||
properties.add(new DiagnosticsProperty<Clip?>("clipBehavior", this.clipBehavior, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<EdgeInsets>("margin", this.margin, defaultValue: null)); |
|||
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape, defaultValue: null)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d74c4f94f0994a3880425c80ec3d9ba3 |
|||
timeCreated: 1556187816 |
撰写
预览
正在加载...
取消
保存
Reference in new issue