浏览代码

Merge branch 'siyaoH/1.17/material' of github.com:Unity-Technologies/com.unity.uiwidgets into zxw/1.17/material

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
e272b714
共有 39 个文件被更改,包括 711 次插入234 次删除
  1. 5
      com.unity.uiwidgets/Runtime/animation/animation_controller.cs
  2. 4
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  3. 8
      com.unity.uiwidgets/Runtime/cupertino/slider.cs
  4. 4
      com.unity.uiwidgets/Runtime/cupertino/switch.cs
  5. 4
      com.unity.uiwidgets/Runtime/material/about.cs
  6. 4
      com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons.cs
  7. 4
      com.unity.uiwidgets/Runtime/material/app_bar_theme.cs
  8. 4
      com.unity.uiwidgets/Runtime/material/arc.cs
  9. 5
      com.unity.uiwidgets/Runtime/material/bottom_app_bar_theme.cs
  10. 254
      com.unity.uiwidgets/Runtime/material/button_bar.cs
  11. 4
      com.unity.uiwidgets/Runtime/material/button_theme.cs
  12. 4
      com.unity.uiwidgets/Runtime/material/card_theme.cs
  13. 6
      com.unity.uiwidgets/Runtime/material/chip_theme.cs
  14. 6
      com.unity.uiwidgets/Runtime/material/dialog.cs
  15. 5
      com.unity.uiwidgets/Runtime/material/dialog_theme.cs
  16. 9
      com.unity.uiwidgets/Runtime/material/floatting_action_button_theme.cs
  17. 2
      com.unity.uiwidgets/Runtime/material/input_border.cs
  18. 4
      com.unity.uiwidgets/Runtime/material/input_decorator.cs
  19. 5
      com.unity.uiwidgets/Runtime/material/mergeable_material.cs
  20. 2
      com.unity.uiwidgets/Runtime/material/slider_theme.cs
  21. 261
      com.unity.uiwidgets/Runtime/material/text_theme.cs
  22. 2
      com.unity.uiwidgets/Runtime/material/theme_data.cs
  23. 16
      com.unity.uiwidgets/Runtime/painting/alignment.cs
  24. 2
      com.unity.uiwidgets/Runtime/painting/borders.cs
  25. 4
      com.unity.uiwidgets/Runtime/painting/box_shadow.cs
  26. 30
      com.unity.uiwidgets/Runtime/painting/edge_insets.cs
  27. 8
      com.unity.uiwidgets/Runtime/painting/fractional_offset.cs
  28. 6
      com.unity.uiwidgets/Runtime/painting/gradient.cs
  29. 7
      com.unity.uiwidgets/Runtime/painting/rounded_rectangle_border.cs
  30. 11
      com.unity.uiwidgets/Runtime/painting/stadium_border.cs
  31. 5
      com.unity.uiwidgets/Runtime/painting/text_style.cs
  32. 8
      com.unity.uiwidgets/Runtime/rendering/box.cs
  33. 4
      com.unity.uiwidgets/Runtime/rendering/editable.cs
  34. 8
      com.unity.uiwidgets/Runtime/rendering/stack.cs
  35. 28
      com.unity.uiwidgets/Runtime/ui2/geometry.cs
  36. 8
      com.unity.uiwidgets/Runtime/ui2/painting.cs
  37. 4
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  38. 8
      com.unity.uiwidgets/Runtime/material/animated_icons.meta
  39. 182
      com.unity.uiwidgets/Runtime/material/button_bar_theme.cs

5
com.unity.uiwidgets/Runtime/animation/animation_controller.cs


using Unity.UIWidgets.physics;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;
using Ticker = Unity.UIWidgets.scheduler2.Ticker;
using TickerFuture = Unity.UIWidgets.scheduler2.TickerFuture;
using TickerProvider = Unity.UIWidgets.scheduler2.TickerProvider;

if (_reverse && _isPlayingReverse) {
directionSetter(_AnimationDirection.reverse);
return MathUtils.lerpFloat(_max, _min, t);
return Mathf.Lerp(_max, _min, t);
return MathUtils.lerpFloat(_min, _max, t);
return Mathf.Lerp(_min, _max, t);
}
}

4
com.unity.uiwidgets/Runtime/cupertino/route.cs


if (animateForward) {
int droppedPageForwardAnimationTime = Mathf.Min(
MathUtils.lerpFloat(CupertinoRouteUtils._kMaxDroppedSwipePageForwardAnimationTime, 0f,
Mathf.Lerp(CupertinoRouteUtils._kMaxDroppedSwipePageForwardAnimationTime, 0f,
controller.value).floor(),
CupertinoRouteUtils._kMaxPageBackAnimationTime
);

if (controller.isAnimating) {
int droppedPageBackAnimationTime =
MathUtils.lerpFloat(0f, CupertinoRouteUtils._kMaxDroppedSwipePageForwardAnimationTime,
Mathf.Lerp(0f, CupertinoRouteUtils._kMaxDroppedSwipePageForwardAnimationTime,
controller.value).floor();
controller.animateBack(0.0f, duration: new TimeSpan(0, 0, 0, 0, droppedPageBackAnimationTime),
curve: animationCurve);

8
com.unity.uiwidgets/Runtime/cupertino/slider.cs


class _CupertinoSliderState : TickerProviderStateMixin<CupertinoSlider> {
void _handleChanged(float value) {
D.assert(widget.onChanged != null);
float lerpValue = MathUtils.lerpFloat(widget.min, widget.max, value);
float lerpValue = Mathf.Lerp(widget.min, widget.max, value);
if (lerpValue != widget.value) {
widget.onChanged(lerpValue);
}

D.assert(widget.onChangeStart != null);
widget.onChangeStart(MathUtils.lerpFloat(widget.min, widget.max, value));
widget.onChangeStart(Mathf.Lerp(widget.min, widget.max, value));
widget.onChangeEnd(MathUtils.lerpFloat(widget.min, widget.max, value));
widget.onChangeEnd(Mathf.Lerp(widget.min, widget.max, value));
}
public override Widget build(BuildContext context) {

get {
float visualPosition = _value;
return MathUtils.lerpFloat(_trackLeft + CupertinoThumbPainter.radius,
return Mathf.Lerp(_trackLeft + CupertinoThumbPainter.radius,
_trackRight - CupertinoThumbPainter.radius,
visualPosition);
}

4
com.unity.uiwidgets/Runtime/cupertino/switch.cs


canvas.drawDRRect(outerRRect, innerRRect, paint);
float currentThumbExtension = CupertinoThumbPainter.extension * currentReactionValue;
float thumbLeft = MathUtils.lerpFloat(
float thumbLeft = Mathf.Lerp(
float thumbRight = MathUtils.lerpFloat(
float thumbRight = Mathf.Lerp(
trackRect.left + CupertinoSwitchUtils._kTrackInnerStart + CupertinoThumbPainter.radius +
currentThumbExtension,
trackRect.left + CupertinoSwitchUtils._kTrackInnerEnd + CupertinoThumbPainter.radius,

4
com.unity.uiwidgets/Runtime/material/about.cs


),
// All of the licenses page text is English. We don"t want localized text
// or text direction.
body: new Localizations(
body: Localizations.overrides(
// context: context,
context: context,
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.caption,
child: new SafeArea(

4
com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons.cs


return values[0];
}
float targetIdx = MathUtils.lerpFloat(0, values.Count - 1, progress);
float targetIdx = Mathf.Lerp(0, values.Count - 1, progress);
int lowIdx = targetIdx.floor();
int highIdx = targetIdx.ceil();
float t = targetIdx - lowIdx;

public readonly List<float> opacities;
public void paint(Canvas canvas, Color color, _UiPathFactory uiPathFactory, float progress) {
float opacity = AnimatedIconUtils._interpolate<float>(opacities, progress, MathUtils.lerpFloat);
float opacity = AnimatedIconUtils._interpolate<float>(opacities, progress, Mathf.Lerp);
Paint paint = new Paint();
paint.style = PaintingStyle.fill;
paint.color = color.withOpacity(color.opacity * opacity);

4
com.unity.uiwidgets/Runtime/material/app_bar_theme.cs


using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
namespace Unity.UIWidgets.material {
public class AppBarTheme : Diagnosticable {

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),
elevation: Mathf.Lerp(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t),
actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t),
textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t)

4
com.unity.uiwidgets/Runtime/material/arc.cs


}
Offset center = _centerArc.lerp(t);
float width = MathUtils.lerpFloat(begin.width, end.width, t);
float height = MathUtils.lerpFloat(begin.height, end.height, t);
float width = Mathf.Lerp(begin.width, end.width, t);
float height = Mathf.Lerp(begin.height, end.height, t);
return Rect.fromLTWH(
(center.dx - width / 2.0f),
(center.dy - height / 2.0f),

5
com.unity.uiwidgets/Runtime/material/bottom_app_bar_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
namespace Unity.UIWidgets.material {
public class BottomAppBarTheme : Diagnosticable {

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),
elevation: Mathf.Lerp(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
shape: t < 0.5f ? a?.shape : b?.shape
);
}

254
com.unity.uiwidgets/Runtime/material/button_bar.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {

MainAxisAlignment alignment = MainAxisAlignment.end,
MainAxisSize mainAxisSize = MainAxisSize.max,
ButtonTextTheme? buttonTextTheme = null,
float? buttonMinWidth = null,
float? buttonHeight = null,
EdgeInsetsGeometry buttonPadding = null,
bool? buttonAlignedDropdown = null,
ButtonBarLayoutBehavior? layoutBehavior = null,
VerticalDirection? overflowDirection = null,
float? overflowButtonSpacing = null,
D.assert(buttonMinWidth == null || buttonMinWidth >= 0.0f);
D.assert(buttonHeight == null || buttonHeight >= 0.0f);
D.assert(overflowButtonSpacing == null || overflowButtonSpacing >= 0.0f);
this.buttonTextTheme = buttonTextTheme;
this.buttonMinWidth = buttonMinWidth;
this.buttonHeight = buttonHeight;
this.buttonPadding = buttonPadding;
this.buttonAlignedDropdown = buttonAlignedDropdown;
this.layoutBehavior = layoutBehavior;
this.overflowDirection = overflowDirection;
this.overflowButtonSpacing = overflowButtonSpacing;
public readonly MainAxisAlignment alignment;
public readonly MainAxisAlignment? alignment;
public readonly MainAxisSize mainAxisSize;
public readonly MainAxisSize? mainAxisSize;
public readonly ButtonTextTheme? buttonTextTheme;
public readonly float? buttonMinWidth;
public readonly float? buttonHeight;
public readonly EdgeInsetsGeometry buttonPadding;
public readonly bool? buttonAlignedDropdown;
public readonly ButtonBarLayoutBehavior? layoutBehavior;
public readonly VerticalDirection? overflowDirection;
public readonly float? overflowButtonSpacing;
ButtonThemeData buttonTheme = ButtonTheme.of(context);
ButtonThemeData parentButtonTheme = ButtonTheme.of(context);
ButtonBarThemeData barTheme = ButtonBarTheme.of(context);
ButtonThemeData buttonTheme = parentButtonTheme.copyWith(
textTheme: buttonTextTheme ?? barTheme.buttonTextTheme ?? ButtonTextTheme.primary,
minWidth: buttonMinWidth ?? barTheme.buttonMinWidth ?? 64.0f,
height: buttonHeight ?? barTheme.buttonHeight ?? 36.0f,
padding: buttonPadding ?? barTheme.buttonPadding ?? EdgeInsets.symmetric(horizontal: 8.0f),
alignedDropdown: buttonAlignedDropdown ?? barTheme.buttonAlignedDropdown ?? false,
layoutBehavior: layoutBehavior ?? barTheme.layoutBehavior ?? ButtonBarLayoutBehavior.padded
);
List<Widget> _children = new List<Widget>();
foreach (Widget _child in children) {
_children.Add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: paddingUnit),
child: _child
)
);
}
Widget child = new Row(
mainAxisAlignment: alignment,
mainAxisSize: mainAxisSize,
children: _children
Widget child = ButtonTheme.fromButtonThemeData(
data: buttonTheme,
child: new _ButtonBarRow(
mainAxisAlignment: alignment ?? barTheme.alignment ?? MainAxisAlignment.end,
mainAxisSize: mainAxisSize ?? barTheme.mainAxisSize ?? MainAxisSize.max,
overflowDirection: overflowDirection ?? barTheme.overflowDirection ?? VerticalDirection.down,
children: children.Select((Widget childWidget) => {
return (Widget) new Padding(
padding: EdgeInsets.symmetric(horizontal: paddingUnit),
child: childWidget
);
}).ToList(),
overflowButtonSpacing: overflowButtonSpacing
)
);
switch (buttonTheme.layoutBehavior) {

D.assert(false);
return null;
}
}
internal class _ButtonBarRow : Flex {
internal _ButtonBarRow(
List<Widget> children,
Axis direction = Axis.horizontal,
MainAxisSize mainAxisSize = MainAxisSize.max,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
TextDirection? textDirection = null,
VerticalDirection overflowDirection = VerticalDirection.down,
TextBaseline? textBaseline = null,
float? overflowButtonSpacing = null
) : base(
children: children,
direction: direction,
mainAxisSize: mainAxisSize,
mainAxisAlignment: mainAxisAlignment,
crossAxisAlignment: crossAxisAlignment,
textDirection: textDirection,
verticalDirection: overflowDirection,
textBaseline: textBaseline
) {
this.overflowButtonSpacing = overflowButtonSpacing;
}
public readonly float? overflowButtonSpacing;
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderButtonBarRow(
direction: direction,
mainAxisAlignment: mainAxisAlignment,
mainAxisSize: mainAxisSize,
crossAxisAlignment: crossAxisAlignment,
textDirection: getEffectiveTextDirection(context),
verticalDirection: verticalDirection,
textBaseline: textBaseline ?? TextBaseline.alphabetic,
overflowButtonSpacing: overflowButtonSpacing
);
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
if (renderObject is _RenderButtonBarRow renderButtonBarRow) {
renderButtonBarRow.direction = direction;
renderButtonBarRow.mainAxisAlignment = mainAxisAlignment;
renderButtonBarRow.mainAxisSize = mainAxisSize;
renderButtonBarRow.crossAxisAlignment = crossAxisAlignment;
renderButtonBarRow.textDirection = getEffectiveTextDirection(context);
renderButtonBarRow.verticalDirection = verticalDirection;
renderButtonBarRow.textBaseline = textBaseline ?? TextBaseline.alphabetic;
renderButtonBarRow.overflowButtonSpacing = overflowButtonSpacing;
}
}
}
internal class _RenderButtonBarRow : RenderFlex {
internal _RenderButtonBarRow(
List<RenderBox> children = null,
Axis direction = Axis.horizontal,
MainAxisSize mainAxisSize = MainAxisSize.max,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
TextDirection textDirection = TextDirection.ltr,
VerticalDirection verticalDirection = VerticalDirection.down,
TextBaseline textBaseline = TextBaseline.alphabetic,
float? overflowButtonSpacing = null
) : base(
children: children,
direction: direction,
mainAxisSize: mainAxisSize,
mainAxisAlignment: mainAxisAlignment,
crossAxisAlignment: crossAxisAlignment,
textDirection: textDirection,
verticalDirection: verticalDirection,
textBaseline: textBaseline
) {
D.assert(overflowButtonSpacing == null || overflowButtonSpacing >= 0);
this.overflowButtonSpacing = overflowButtonSpacing;
}
bool _hasCheckedLayoutWidth = false;
public float? overflowButtonSpacing;
public new BoxConstraints constraints {
get {
if (_hasCheckedLayoutWidth)
return base.constraints;
return base.constraints.copyWith(maxWidth: float.PositiveInfinity);
}
}
protected override void performLayout() {
_hasCheckedLayoutWidth = false;
base.performLayout();
_hasCheckedLayoutWidth = true;
if (size.width <= constraints.maxWidth) {
base.performLayout();
}
else {
BoxConstraints childConstraints = constraints.copyWith(minWidth: 0.0f);
RenderBox child = null;
float currentHeight = 0.0f;
switch (verticalDirection) {
case VerticalDirection.down:
child = firstChild;
break;
case VerticalDirection.up:
child = lastChild;
break;
}
while (child != null) {
FlexParentData childParentData = child.parentData as FlexParentData;
child.layout(childConstraints, parentUsesSize: true);
switch (textDirection) {
case TextDirection.ltr:
switch (mainAxisAlignment) {
case MainAxisAlignment.center:
float midpoint = (constraints.maxWidth - child.size.width) / 2.0f;
childParentData.offset = new Offset(midpoint, currentHeight);
break;
case MainAxisAlignment.end:
childParentData.offset = new Offset(constraints.maxWidth - child.size.width,
currentHeight);
break;
default:
childParentData.offset = new Offset(0, currentHeight);
break;
}
break;
case TextDirection.rtl:
switch (mainAxisAlignment) {
case MainAxisAlignment.center:
float midpoint = constraints.maxWidth / 2.0f - child.size.width / 2.0f;
childParentData.offset = new Offset(midpoint, currentHeight);
break;
case MainAxisAlignment.end:
childParentData.offset = new Offset(0, currentHeight);
break;
default:
childParentData.offset = new Offset(constraints.maxWidth - child.size.width,
currentHeight);
break;
}
break;
}
currentHeight += child.size.height;
switch (verticalDirection) {
case VerticalDirection.down:
child = childParentData.nextSibling;
break;
case VerticalDirection.up:
child = childParentData.previousSibling;
break;
}
if (overflowButtonSpacing != null && child != null)
currentHeight += overflowButtonSpacing ?? 0;
}
size = constraints.constrain(new Size(constraints.maxWidth, currentHeight));
}
}
}
}

4
com.unity.uiwidgets/Runtime/material/button_theme.cs


ButtonBarLayoutBehavior? layoutBehavior = null,
float? minWidth = null,
float? height = null,
EdgeInsets padding = null,
EdgeInsetsGeometry padding = null,
ShapeBorder shape = null,
bool? alignedDropdown = null,
Color buttonColor = null,

layoutBehavior: layoutBehavior ?? this.layoutBehavior,
minWidth: minWidth ?? this.minWidth,
height: height ?? this.height,
padding: padding ?? this.padding,
padding: (EdgeInsets) padding ?? this.padding,
shape: shape ?? this.shape,
alignedDropdown: alignedDropdown ?? this.alignedDropdown,
buttonColor: buttonColor ?? _buttonColor,

4
com.unity.uiwidgets/Runtime/material/card_theme.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
namespace Unity.UIWidgets.material {
public class CardTheme : Diagnosticable {

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),
elevation: Mathf.Lerp(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)
);

6
com.unity.uiwidgets/Runtime/material/chip_theme.cs


using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {

labelStyle: TextStyle.lerp(a?.labelStyle, b?.labelStyle, t),
secondaryLabelStyle: TextStyle.lerp(a?.secondaryLabelStyle, b?.secondaryLabelStyle, t),
brightness: t < 0.5f ? a?.brightness ?? Brightness.light : b?.brightness ?? Brightness.light,
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
pressElevation: MathUtils.lerpFloat(a?.pressElevation ?? 0.0f, b?.pressElevation ?? 0.0f, t)
elevation: Mathf.Lerp(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
pressElevation: Mathf.Lerp(a?.pressElevation ?? 0.0f, b?.pressElevation ?? 0.0f, t)
);
}

6
com.unity.uiwidgets/Runtime/material/dialog.cs


actionsWidget = new Padding(
padding: (EdgeInsets)actionsPadding,
child: new ButtonBar(
// buttonPadding: buttonPadding,
// overflowDirection: actionsOverflowDirection,
// overflowButtonSpacing: actionsOverflowButtonSpacing,
buttonPadding: buttonPadding,
overflowDirection: actionsOverflowDirection,
overflowButtonSpacing: actionsOverflowButtonSpacing,
children: actions
)
);

5
com.unity.uiwidgets/Runtime/material/dialog_theme.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {

public static DialogTheme lerp(DialogTheme a, DialogTheme b, float t) {
return new DialogTheme(
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
elevation: Mathf.Lerp(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
titleTextStyle: TextStyle.lerp(a?.titleTextStyle, b?.titleTextStyle, t),
contentTextStyle: TextStyle.lerp(a?.contentTextStyle, b?.contentTextStyle, t)

9
com.unity.uiwidgets/Runtime/material/floatting_action_button_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
namespace Unity.UIWidgets.material {
public class FloatingActionButtonThemeData : Diagnosticable {

return new FloatingActionButtonThemeData(
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0, b?.elevation ?? 0, t),
disabledElevation: MathUtils.lerpFloat(a?.disabledElevation ?? 0, b?.disabledElevation ?? 0, t),
highlightElevation: MathUtils.lerpFloat(a?.highlightElevation ?? 0, b?.highlightElevation ?? 0, t),
elevation: Mathf.Lerp(a?.elevation ?? 0, b?.elevation ?? 0, t),
disabledElevation: Mathf.Lerp(a?.disabledElevation ?? 0, b?.disabledElevation ?? 0, t),
highlightElevation: Mathf.Lerp(a?.highlightElevation ?? 0, b?.highlightElevation ?? 0, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
);
}

2
com.unity.uiwidgets/Runtime/material/input_border.cs


canvas.drawRRect(center, paint);
}
else {
float extent = MathUtils.lerpFloat(0.0f, gapExtent + gapPadding * 2.0f, gapPercentage);
float extent = Mathf.Lerp(0.0f, gapExtent + gapPadding * 2.0f, gapPercentage);
Path path = _gapBorderPath(canvas, center, Mathf.Max(0.0f,gapStart - gapPadding), extent);
canvas.drawPath(path, paint);
}

4
com.unity.uiwidgets/Runtime/material/input_decorator.cs


float t = decoration.floatingLabelProgress;
bool isOutlineBorder = decoration.border != null && decoration.border.isOutline;
float floatingY = isOutlineBorder ? -labelHeight * 0.25f : contentPadding.top;
float scale = MathUtils.lerpFloat(1.0f, 0.75f, t);
float scale = Mathf.Lerp(1.0f, 0.75f, t);
float dy = MathUtils.lerpFloat(0.0f, floatingY - labelOffset.dy, t);
float dy = Mathf.Lerp(0.0f, floatingY - labelOffset.dy, t);
_labelTransform = Matrix4.identity();
_labelTransform.translate(dx, labelOffset.dy + dy);
_labelTransform.scale(scale, scale, 1);

5
com.unity.uiwidgets/Runtime/material/mergeable_material.cs


using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.material {
public abstract class MergeableMaterialItem {

float _getGapSize(int index) {
MaterialGap gap = (MaterialGap) _children[index];
return MathUtils.lerpFloat(_animationTuples[gap.key].gapStart,
return Mathf.Lerp(_animationTuples[gap.key].gapStart,
gap.size,
_animationTuples[gap.key].gapAnimation.value);
}

2
com.unity.uiwidgets/Runtime/material/slider_theme.cs


D.assert(a != null);
D.assert(b != null);
return new SliderThemeData(
trackHeight: MathUtils.lerpFloat(a.trackHeight, b.trackHeight, t),
trackHeight: Mathf.Lerp(a.trackHeight, b.trackHeight, t),
activeTrackColor: Color.lerp(a.activeTrackColor, b.activeTrackColor, t),
inactiveTrackColor: Color.lerp(a.inactiveTrackColor, b.inactiveTrackColor, t),
disabledActiveTrackColor: Color.lerp(a.disabledActiveTrackColor, b.disabledActiveTrackColor, t),

261
com.unity.uiwidgets/Runtime/material/text_theme.cs


namespace Unity.UIWidgets.material {
public class TextTheme : Diagnosticable, IEquatable<TextTheme> {
public TextTheme(
TextStyle headline1 = null,
TextStyle headline2 = null,
TextStyle headline3 = null,
TextStyle headline4 = null,
TextStyle headline5 = null,
TextStyle headline6 = null,
TextStyle subtitle1 = null,
TextStyle subtitle2 = null,
TextStyle bodyText1 = null,
TextStyle bodyText2 = null,
TextStyle display4 = null,
TextStyle display3 = null,
TextStyle display2 = null,

TextStyle subtitle = null,
TextStyle overline = null
) {
this.display4 = display4;
this.display3 = display3;
this.display2 = display2;
this.display1 = display1;
this.headline = headline;
this.title = title;
this.subhead = subhead;
this.body2 = body2;
this.body1 = body1;
D.assert(
(headline1 == null && headline2 == null && headline3 == null && headline4 == null &&
headline5 == null && headline6 == null &&
subtitle1 == null && subtitle2 == null &&
bodyText1 == null && bodyText2 == null) ||
(display4 == null && display3 == null && display2 == null && display1 == null && headline == null &&
title == null &&
subhead == null && subtitle == null &&
body2 == null && body1 == null),
() => "Cannot mix 2014 and 2018 terms in call to TextTheme() constructor.");
this.headline1 = headline1 ?? display4;
this.headline2 = headline2 ?? display3;
this.headline3 = headline3 ?? display2;
this.headline4 = headline4 ?? display1;
this.headline5 = headline5 ?? headline;
this.headline6 = headline6 ?? title;
this.subtitle1 = subtitle1 ?? subhead;
this.subtitle2 = subtitle2 ?? subtitle;
this.bodyText1 = bodyText1 ?? body2;
this.bodyText2 = bodyText2 ?? body1;
this.subtitle = subtitle;
this.overline = overline;
}

public readonly TextStyle headline5;
public readonly TextStyle headline6;
public readonly TextStyle bodyText1;
public readonly TextStyle bodyText2;
public readonly TextStyle bodyText1;
public readonly TextStyle display4;
public readonly TextStyle bodyText2;
public readonly TextStyle display3;
public TextStyle display4 => headline1;
public readonly TextStyle display2;
public TextStyle display3 => headline2;
public readonly TextStyle display1;
public TextStyle display2 => headline3;
public readonly TextStyle headline;
public TextStyle display1 => headline4;
public readonly TextStyle title;
public TextStyle headline => headline5;
public readonly TextStyle subhead;
public TextStyle title => headline6;
public TextStyle subhead => subtitle1;
public TextStyle subtitle => subtitle2;
public readonly TextStyle body2;
public TextStyle body2 => bodyText1;
public readonly TextStyle body1;
public TextStyle body1 => bodyText2;
public readonly TextStyle subtitle;
TextStyle headline1 = null,
TextStyle headline2 = null,
TextStyle headline3 = null,
TextStyle headline4 = null,
TextStyle headline5 = null,
TextStyle headline6 = null,
TextStyle subtitle1 = null,
TextStyle subtitle2 = null,
TextStyle bodyText1 = null,
TextStyle bodyText2 = null,
TextStyle caption = null,
TextStyle button = null,
TextStyle overline = null,
TextStyle display4 = null,
TextStyle display3 = null,
TextStyle display2 = null,

TextStyle subhead = null,
TextStyle body2 = null,
TextStyle body1 = null,
TextStyle caption = null,
TextStyle button = null,
TextStyle subtitle = null,
TextStyle overline = null
TextStyle body1 = null
D.assert(
(headline1 == null && headline2 == null && headline3 == null && headline4 == null &&
headline5 == null && headline6 == null &&
subtitle1 == null && subtitle2 == null &&
bodyText1 == null && bodyText2 == null) ||
(display4 == null && display3 == null && display2 == null && display1 == null && headline == null &&
title == null &&
subhead == null && subtitle == null &&
body2 == null && body1 == null),
() => "Cannot mix 2014 and 2018 terms in call to TextTheme.copyWith().");
display4: display4 ?? this.display4,
display3: display3 ?? this.display3,
display2: display2 ?? this.display2,
display1: display1 ?? this.display1,
headline: headline ?? this.headline,
title: title ?? this.title,
subhead: subhead ?? this.subhead,
body2: body2 ?? this.body2,
body1: body1 ?? this.body1,
headline1: headline1 ?? display4 ?? this.headline1,
headline2: headline2 ?? display3 ?? this.headline2,
headline3: headline3 ?? display2 ?? this.headline3,
headline4: headline4 ?? display1 ?? this.headline4,
headline5: headline5 ?? headline ?? this.headline5,
headline6: headline6 ?? title ?? this.headline6,
subtitle1: subtitle1 ?? subhead ?? this.subtitle1,
subtitle2: subtitle2 ?? subtitle ?? this.subtitle2,
bodyText1: bodyText1 ?? body2 ?? this.bodyText1,
bodyText2: bodyText2 ?? body1 ?? this.bodyText2,
subtitle: subtitle ?? this.subtitle,
overline: overline ?? this.overline
);
}

}
return copyWith(
display4: display4?.merge(other.display4) ?? other.display4,
display3: display3?.merge(other.display3) ?? other.display3,
display2: display2?.merge(other.display2) ?? other.display2,
display1: display1?.merge(other.display1) ?? other.display1,
headline: headline?.merge(other.headline) ?? other.headline,
title: title?.merge(other.title) ?? other.title,
subhead: subhead?.merge(other.subhead) ?? other.subhead,
body2: body2?.merge(other.body2) ?? other.body2,
body1: body1?.merge(other.body1) ?? other.body1,
headline1: headline1?.merge(other.headline1) ?? other.headline1,
headline2: headline2?.merge(other.headline2) ?? other.headline2,
headline3: headline3?.merge(other.headline3) ?? other.headline3,
headline4: headline4?.merge(other.headline4) ?? other.headline4,
headline5: headline5?.merge(other.headline5) ?? other.headline5,
headline6: headline6?.merge(other.headline6) ?? other.headline6,
subtitle1: subtitle1?.merge(other.subtitle1) ?? other.subtitle1,
subtitle2: subtitle2?.merge(other.subtitle2) ?? other.subtitle2,
bodyText1: bodyText1?.merge(other.bodyText1) ?? other.bodyText1,
bodyText2: bodyText2?.merge(other.bodyText2) ?? other.bodyText2,
subtitle: subtitle?.merge(other.subtitle) ?? other.subtitle,
overline: overline?.merge(other.overline) ?? other.overline
);
}

TextDecorationStyle? decorationStyle = null
) {
return new TextTheme(
display4: display4?.apply(
headline1: headline1?.apply(
color: displayColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
display3: display3?.apply(
headline2: headline2?.apply(
color: displayColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
display2: display2?.apply(
headline3: headline3?.apply(
color: displayColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
display1: display1?.apply(
headline4: headline4?.apply(
color: displayColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
headline: headline?.apply(
headline5: headline5?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
title: title?.apply(
headline6: headline6?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
subhead: subhead?.apply(
subtitle1: subtitle1?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
body2: body2?.apply(
subtitle2: subtitle2?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
body1: body1?.apply(
bodyText1: bodyText1?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
fontFamily: fontFamily,
fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta
),
bodyText2: bodyText2?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,

fontSizeDelta: fontSizeDelta
),
button: button?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
fontFamily: fontFamily,
fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta
),
subtitle: subtitle?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,

public static TextTheme lerp(TextTheme a, TextTheme b, float t) {
return new TextTheme(
display4: TextStyle.lerp(a?.display4, b?.display4, t),
display3: TextStyle.lerp(a?.display3, b?.display3, t),
display2: TextStyle.lerp(a?.display2, b?.display2, t),
display1: TextStyle.lerp(a?.display1, b?.display1, t),
headline: TextStyle.lerp(a?.headline, b?.headline, t),
title: TextStyle.lerp(a?.title, b?.title, t),
subhead: TextStyle.lerp(a?.subhead, b?.subhead, t),
body2: TextStyle.lerp(a?.body2, b?.body2, t),
body1: TextStyle.lerp(a?.body1, b?.body1, t),
headline1: TextStyle.lerp(a?.headline1, b?.headline1, t),
headline2: TextStyle.lerp(a?.headline2, b?.headline2, t),
headline3: TextStyle.lerp(a?.headline3, b?.headline3, t),
headline4: TextStyle.lerp(a?.headline4, b?.headline4, t),
headline5: TextStyle.lerp(a?.headline5, b?.headline5, t),
headline6: TextStyle.lerp(a?.headline6, b?.headline6, t),
subtitle1: TextStyle.lerp(a?.subtitle1, b?.subtitle1, t),
subtitle2: TextStyle.lerp(a?.subtitle2, b?.subtitle2, t),
bodyText1: TextStyle.lerp(a?.bodyText1, b?.bodyText1, t),
bodyText2: TextStyle.lerp(a?.bodyText2, b?.bodyText2, t),
subtitle: TextStyle.lerp(a?.subtitle, b?.subtitle, t),
overline: TextStyle.lerp(a?.overline, b?.overline, t)
);
}

return true;
}
return display4 == other.display4
&& display3 == other.display3
&& display2 == other.display2
&& display1 == other.display1
&& headline == other.headline
&& title == other.title
&& subhead == other.subhead
&& body2 == other.body2
&& body1 == other.body1
return headline1 == other.headline1
&& headline2 == other.headline2
&& headline3 == other.headline3
&& headline4 == other.headline4
&& headline5 == other.headline5
&& headline6 == other.headline6
&& subtitle1 == other.subtitle1
&& subtitle2 == other.subtitle2
&& bodyText1 == other.bodyText1
&& bodyText2 == other.bodyText2
&& subtitle == other.subtitle
&& overline == other.overline;
}

}
int? _cachedHashCode = null;
var hashCode = display4?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ display3?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ display2?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ display1?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ headline?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ title?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ subhead?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ body2?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ body1?.GetHashCode() ?? 0;
var hashCode = headline1?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ headline2?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ headline3?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ headline4?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ headline5?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ headline6?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ subtitle1?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ subtitle2?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ bodyText1?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ bodyText2?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ subtitle?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ overline?.GetHashCode() ?? 0;
_cachedHashCode = hashCode;

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
TextTheme defaultTheme = new Typography().black;
properties.add(new DiagnosticsProperty<TextStyle>("display4", display4,
properties.add(new DiagnosticsProperty<TextStyle>("display4", headline1,
properties.add(new DiagnosticsProperty<TextStyle>("display3", display3,
properties.add(new DiagnosticsProperty<TextStyle>("display3", headline2,
properties.add(new DiagnosticsProperty<TextStyle>("display2", display2,
properties.add(new DiagnosticsProperty<TextStyle>("display2", headline3,
properties.add(new DiagnosticsProperty<TextStyle>("display1", display1,
properties.add(new DiagnosticsProperty<TextStyle>("display1", headline4,
properties.add(new DiagnosticsProperty<TextStyle>("headline", headline,
properties.add(new DiagnosticsProperty<TextStyle>("headline", headline5,
properties.add(new DiagnosticsProperty<TextStyle>("title", title, defaultValue: defaultTheme.title));
properties.add(new DiagnosticsProperty<TextStyle>("title", headline6, defaultValue: defaultTheme.title));
new DiagnosticsProperty<TextStyle>("subhead", subhead, defaultValue: defaultTheme.subhead));
properties.add(new DiagnosticsProperty<TextStyle>("body2", body2, defaultValue: defaultTheme.body2));
properties.add(new DiagnosticsProperty<TextStyle>("body1", body1, defaultValue: defaultTheme.body1));
new DiagnosticsProperty<TextStyle>("subhead", subtitle1, defaultValue: defaultTheme.subhead));
properties.add(new DiagnosticsProperty<TextStyle>("body2", subtitle2, defaultValue: defaultTheme.body2));
properties.add(new DiagnosticsProperty<TextStyle>("body1", bodyText1, defaultValue: defaultTheme.body1));
new DiagnosticsProperty<TextStyle>("caption", caption, defaultValue: defaultTheme.caption));
new DiagnosticsProperty<TextStyle>("caption", bodyText2, defaultValue: defaultTheme.caption));
new DiagnosticsProperty<TextStyle>("button", button, defaultValue: defaultTheme.button));
properties.add(new DiagnosticsProperty<TextStyle>("subtitle)", subtitle,
new DiagnosticsProperty<TextStyle>("button", caption, defaultValue: defaultTheme.button));
properties.add(new DiagnosticsProperty<TextStyle>("subtitle)", button,
defaultValue: defaultTheme.subtitle));
properties.add(new DiagnosticsProperty<TextStyle>("overline", overline,
defaultValue: defaultTheme.overline));

2
com.unity.uiwidgets/Runtime/material/theme_data.cs


public readonly Typography typography;
public readonly ButtonBarThemeData buttonBarTheme;
public ThemeData copyWith(
Brightness? brightness = null,
Color primaryColor = null,

16
com.unity.uiwidgets/Runtime/painting/alignment.cs


}
if (a == null) {
return new Alignment(MathUtils.lerpFloat(0.0f, b.x, t), MathUtils.lerpFloat(0.0f, b.y, t));
return new Alignment(Mathf.Lerp(0.0f, b.x, t), Mathf.Lerp(0.0f, b.y, t));
return new Alignment(MathUtils.lerpFloat(a.x, 0.0f, t), MathUtils.lerpFloat(a.y, 0.0f, t));
return new Alignment(Mathf.Lerp(a.x, 0.0f, t), Mathf.Lerp(a.y, 0.0f, t));
return new Alignment(MathUtils.lerpFloat(a.x, b.x, t), MathUtils.lerpFloat(a.y, b.y, t));
return new Alignment(Mathf.Lerp(a.x, b.x, t), Mathf.Lerp(a.y, b.y, t));
}
public bool Equals(Alignment other) {

if (a == null && b == null)
return null;
if (a == null)
return new AlignmentDirectional(MathUtils.lerpFloat(0.0f, b.start, t),
MathUtils.lerpFloat(0.0f, b.y, t));
return new AlignmentDirectional(Mathf.Lerp(0.0f, b.start, t),
Mathf.Lerp(0.0f, b.y, t));
return new AlignmentDirectional(MathUtils.lerpFloat(a.start, 0.0f, t),
MathUtils.lerpFloat(a.y, 0.0f, t));
return new AlignmentDirectional(MathUtils.lerpFloat(a.start, b.start, t), MathUtils.lerpFloat(a.y, b.y, t));
return new AlignmentDirectional(Mathf.Lerp(a.start, 0.0f, t),
Mathf.Lerp(a.y, 0.0f, t));
return new AlignmentDirectional(Mathf.Lerp(a.start, b.start, t), Mathf.Lerp(a.y, b.y, t));
}
public override Alignment resolve(TextDirection? direction) {

2
com.unity.uiwidgets/Runtime/painting/borders.cs


return b;
}
float width = MathUtils.lerpFloat(a.width, b.width, t);
float width = Mathf.Lerp(a.width, b.width, t);
if (width < 0.0) {
return none;
}

4
com.unity.uiwidgets/Runtime/painting/box_shadow.cs


return new BoxShadow(
color: Color.lerp(a.color, b.color, t),
offset: Offset.lerp(a.offset, b.offset, t),
blurRadius: MathUtils.lerpFloat(a.blurRadius, b.blurRadius, t),
spreadRadius: MathUtils.lerpFloat(a.spreadRadius, b.spreadRadius, t)
blurRadius: Mathf.Lerp(a.blurRadius, b.blurRadius, t),
spreadRadius: Mathf.Lerp(a.spreadRadius, b.spreadRadius, t)
);
}

30
com.unity.uiwidgets/Runtime/painting/edge_insets.cs


using JetBrains.Annotations;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.painting {

return EdgeInsetsDirectional.lerp(a, b, t);
return _MixedEdgeInsets.fromLRSETB(
MathUtils.lerpFloat(a._left, b._left, t),
MathUtils.lerpFloat(a._right, b._right, t),
MathUtils.lerpFloat(a._start, b._start, t),
MathUtils.lerpFloat(a._end, b._end, t),
MathUtils.lerpFloat(a._top, b._top, t),
MathUtils.lerpFloat(a._bottom, b._bottom, t)
Mathf.Lerp(a._left, b._left, t),
Mathf.Lerp(a._right, b._right, t),
Mathf.Lerp(a._start, b._start, t),
Mathf.Lerp(a._end, b._end, t),
Mathf.Lerp(a._top, b._top, t),
Mathf.Lerp(a._bottom, b._bottom, t)
);
}

if (b == null)
return a * (1.0f - t);
return fromSTEB(
MathUtils.lerpFloat(a.start, b.start, t),
MathUtils.lerpFloat(a.top, b.top, t),
MathUtils.lerpFloat(a.end, b.end, t),
MathUtils.lerpFloat(a.bottom, b.bottom, t)
Mathf.Lerp(a.start, b.start, t),
Mathf.Lerp(a.top, b.top, t),
Mathf.Lerp(a.end, b.end, t),
Mathf.Lerp(a.bottom, b.bottom, t)
);
}

}
return fromLTRB(
MathUtils.lerpFloat(a.left, b.left, t),
MathUtils.lerpFloat(a.top, b.top, t),
MathUtils.lerpFloat(a.right, b.right, t),
MathUtils.lerpFloat(a.bottom, b.bottom, t)
Mathf.Lerp(a.left, b.left, t),
Mathf.Lerp(a.top, b.top, t),
Mathf.Lerp(a.right, b.right, t),
Mathf.Lerp(a.bottom, b.bottom, t)
);
}

8
com.unity.uiwidgets/Runtime/painting/fractional_offset.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.painting {
public class FractionalOffset : Alignment {

}
if (a == null) {
return new FractionalOffset(MathUtils.lerpFloat(0.5f, b.dx, t), MathUtils.lerpFloat(0.5f, b.dy, t));
return new FractionalOffset(Mathf.Lerp(0.5f, b.dx, t), Mathf.Lerp(0.5f, b.dy, t));
return new FractionalOffset(MathUtils.lerpFloat(a.dx, 0.5f, t), MathUtils.lerpFloat(a.dy, 0.5f, t));
return new FractionalOffset(Mathf.Lerp(a.dx, 0.5f, t), Mathf.Lerp(a.dy, 0.5f, t));
return new FractionalOffset(MathUtils.lerpFloat(a.dx, b.dx, t), MathUtils.lerpFloat(a.dy, b.dy, t));
return new FractionalOffset(Mathf.Lerp(a.dx, b.dx, t), Mathf.Lerp(a.dy, b.dy, t));
}
public override string ToString() {

6
com.unity.uiwidgets/Runtime/painting/gradient.cs


t);
return new RadialGradient(
center: Alignment.lerp(a.center, b.center, t),
radius: Mathf.Max(0.0f, MathUtils.lerpFloat(a.radius, b.radius, t)),
radius: Mathf.Max(0.0f, Mathf.Lerp(a.radius, b.radius, t)),
colors: interpolated.colors,
stops: interpolated.stops,
tileMode: t < 0.5 ? a.tileMode : b.tileMode

_ColorsAndStops._interpolateColorsAndStops(a.colors, a.stops, b.colors, b.stops, t);
return new SweepGradient(
center: Alignment.lerp(a.center, b.center, t),
startAngle: Mathf.Max(0.0f, MathUtils.lerpFloat(a.startAngle, b.startAngle, t)),
endAngle: Mathf.Max(0.0f, MathUtils.lerpFloat(a.endAngle, b.endAngle, t)),
startAngle: Mathf.Max(0.0f, Mathf.Lerp(a.startAngle, b.startAngle, t)),
endAngle: Mathf.Max(0.0f, Mathf.Lerp(a.endAngle, b.endAngle, t)),
colors: interpolated.colors,
stops: interpolated.stops,
tileMode: t < 0.5 ? a.tileMode : b.tileMode

7
com.unity.uiwidgets/Runtime/painting/rounded_rectangle_border.cs


using System;
using Unity.UIWidgets.ui;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.painting {
public class RoundedRectangleBorder : ShapeBorder, IEquatable<RoundedRectangleBorder> {

return new _RoundedRectangleToCircleBorder(
side: BorderSide.lerp(border.side, side, t),
borderRadius: BorderRadius.lerp(border.borderRadius, borderRadius, t),
circleness: MathUtils.lerpFloat(border.circleness, circleness, t)
circleness: Mathf.Lerp(border.circleness, circleness, t)
);
}

return new _RoundedRectangleToCircleBorder(
side: BorderSide.lerp(side, border.side, t),
borderRadius: BorderRadius.lerp(borderRadius, border.borderRadius, t),
circleness: MathUtils.lerpFloat(circleness, border.circleness, t)
circleness: Mathf.Lerp(circleness, border.circleness, t)
);
}

11
com.unity.uiwidgets/Runtime/painting/stadium_border.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.painting {
public class StadiumBorder : ShapeBorder, IEquatable<StadiumBorder> {

if (a is _StadiumToCircleBorder border) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(border.side, side, t),
circleness: MathUtils.lerpFloat(border.circleness, circleness, t)
circleness: Mathf.Lerp(border.circleness, circleness, t)
);
}

if (b is _StadiumToCircleBorder border) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(side, border.side, t),
circleness: MathUtils.lerpFloat(circleness, border.circleness, t)
circleness: Mathf.Lerp(circleness, border.circleness, t)
);
}

return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(border.side, side, t),
borderRadius: BorderRadius.lerp(border.borderRadius, borderRadius, t),
rectness: MathUtils.lerpFloat(border.rectness, rectness, t)
rectness: Mathf.Lerp(border.rectness, rectness, t)
);
}

return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(side, border.side, t),
borderRadius: BorderRadius.lerp(borderRadius, border.borderRadius, t),
rectness: MathUtils.lerpFloat(rectness, border.rectness, t)
rectness: Mathf.Lerp(rectness, border.rectness, t)
);
}

5
com.unity.uiwidgets/Runtime/painting/text_style.cs


using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using FontStyle = Unity.UIWidgets.ui.FontStyle;
namespace Unity.UIWidgets.painting {
public class TextStyle : Diagnosticable, IEquatable<TextStyle> {

decoration: t < 0.5 ? a.decoration : b.decoration,
decorationColor: Color.lerp(a.decorationColor, b.decorationColor, t),
decorationStyle: t < 0.5 ? a.decorationStyle : b.decorationStyle,
decorationThickness: MathUtils.lerpFloat(
decorationThickness: Mathf.Lerp(
a.decorationThickness ?? b.decorationThickness ?? 0.0f,
b.decorationThickness ?? a.decorationThickness ?? 0.0f, t),
shadows: t < 0.5f ? a.shadows : b.shadows,

8
com.unity.uiwidgets/Runtime/rendering/box.cs


() => "Cannot interpolate between finite constraints and unbounded constraints.");
return new BoxConstraints(
minWidth: a.minWidth.isFinite()
? MathUtils.lerpFloat(a.minWidth, b.minWidth, t)
? Mathf.Lerp(a.minWidth, b.minWidth, t)
? MathUtils.lerpFloat(a.maxWidth, b.maxWidth, t)
? Mathf.Lerp(a.maxWidth, b.maxWidth, t)
? MathUtils.lerpFloat(a.minHeight, b.minHeight, t)
? Mathf.Lerp(a.minHeight, b.minHeight, t)
? MathUtils.lerpFloat(a.maxHeight, b.maxHeight, t)
? Mathf.Lerp(a.maxHeight, b.maxHeight, t)
: float.PositiveInfinity
);
}

4
com.unity.uiwidgets/Runtime/rendering/editable.cs


if (_resetFloatingCursorAnimationValue != null) {
sizeAdjustmentX =
MathUtils.lerpFloat(sizeAdjustmentX, 0f, _resetFloatingCursorAnimationValue.Value);
Mathf.Lerp(sizeAdjustmentX, 0f, _resetFloatingCursorAnimationValue.Value);
MathUtils.lerpFloat(sizeAdjustmentY, 0f, _resetFloatingCursorAnimationValue.Value);
Mathf.Lerp(sizeAdjustmentY, 0f, _resetFloatingCursorAnimationValue.Value);
}
Rect floatingCaretPrototype = Rect.fromLTRB(

8
com.unity.uiwidgets/Runtime/rendering/stack.cs


}
return fromLTRB(
MathUtils.lerpFloat(a.left, b.left, t),
MathUtils.lerpFloat(a.top, b.top, t),
MathUtils.lerpFloat(a.right, b.right, t),
MathUtils.lerpFloat(a.bottom, b.bottom, t)
Mathf.Lerp(a.left, b.left, t),
Mathf.Lerp(a.top, b.top, t),
Mathf.Lerp(a.right, b.right, t),
Mathf.Lerp(a.bottom, b.bottom, t)
);
}

28
com.unity.uiwidgets/Runtime/ui2/geometry.cs


return float.IsNaN(it);
}
public static float lerpFloat(float a, float b, float t) {
return a + (b - a) * t;
}
public static float? lerpNullableFloat(float? a, float? b, float t) {
if (a == null && b == null) {
return null;

return a * (1.0f - t);
}
return new Offset(MathUtils.lerpFloat(a.dx, b.dx, t), MathUtils.lerpFloat(a.dy, b.dy, t));
return new Offset(Mathf.Lerp(a.dx, b.dx, t), Mathf.Lerp(a.dy, b.dy, t));
}
public bool Equals(Offset other) {

return a * (1.0f - t);
}
return new Size(MathUtils.lerpFloat(a.width, b.width, t), MathUtils.lerpFloat(a.height, b.height, t));
return new Size(Mathf.Lerp(a.width, b.width, t), Mathf.Lerp(a.height, b.height, t));
}
public bool Equals(Size other) {

}
return fromLTRB(
MathUtils.lerpFloat(a.left, b.left, t),
MathUtils.lerpFloat(a.top, b.top, t),
MathUtils.lerpFloat(a.right, b.right, t),
MathUtils.lerpFloat(a.bottom, b.bottom, t)
Mathf.Lerp(a.left, b.left, t),
Mathf.Lerp(a.top, b.top, t),
Mathf.Lerp(a.right, b.right, t),
Mathf.Lerp(a.bottom, b.bottom, t)
);
}

}
return elliptical(
MathUtils.lerpFloat(a.x, b.x, t),
MathUtils.lerpFloat(a.y, b.y, t)
Mathf.Lerp(a.x, b.x, t),
Mathf.Lerp(a.y, b.y, t)
);
}

}
return fromLTRBAndCorners(
MathUtils.lerpFloat(a.left, b.left, t),
MathUtils.lerpFloat(a.top, b.top, t),
MathUtils.lerpFloat(a.right, b.right, t),
MathUtils.lerpFloat(a.bottom, b.bottom, t),
Mathf.Lerp(a.left, b.left, t),
Mathf.Lerp(a.top, b.top, t),
Mathf.Lerp(a.right, b.right, t),
Mathf.Lerp(a.bottom, b.bottom, t),
Radius.lerp(a.tlRadius, b.tlRadius, t),
Radius.lerp(a.trRadius, b.trRadius, t),
Radius.lerp(a.brRadius, b.brRadius, t),

8
com.unity.uiwidgets/Runtime/ui2/painting.cs


}
return fromARGB(
((int) MathUtils.lerpFloat(a.alpha, b.alpha, t)).clamp(0, 255),
((int) MathUtils.lerpFloat(a.red, b.red, t)).clamp(0, 255),
((int) MathUtils.lerpFloat(a.green, b.green, t)).clamp(0, 255),
((int) MathUtils.lerpFloat(a.blue, b.blue, t)).clamp(0, 255)
((int) Mathf.Lerp(a.alpha, b.alpha, t)).clamp(0, 255),
((int) Mathf.Lerp(a.red, b.red, t)).clamp(0, 255),
((int) Mathf.Lerp(a.green, b.green, t)).clamp(0, 255),
((int) Mathf.Lerp(a.blue, b.blue, t)).clamp(0, 255)
);
}

4
com.unity.uiwidgets/Runtime/widgets/editable_text.cs


}
else {
float lerpValue = _floatingCursorResetController.value;
float lerpX = MathUtils.lerpFloat(_lastBoundedOffset.dx, finalPosition.dx, lerpValue);
float lerpY = MathUtils.lerpFloat(_lastBoundedOffset.dy, finalPosition.dy, lerpValue);
float lerpX = Mathf.Lerp(_lastBoundedOffset.dx, finalPosition.dx, lerpValue);
float lerpY = Mathf.Lerp(_lastBoundedOffset.dy, finalPosition.dy, lerpValue);
renderEditable.setFloatingCursor(FloatingCursorDragState.Update, new Offset(lerpX, lerpY),
_lastTextPosition, resetLerpValue: lerpValue);

8
com.unity.uiwidgets/Runtime/material/animated_icons.meta


fileFormatVersion: 2
guid: fe9d2309a41964cba855171391dab665
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

182
com.unity.uiwidgets/Runtime/material/button_bar_theme.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Unity.UIWidgets.material {
public class ButtonBarThemeData : Diagnosticable, IEquatable<ButtonBarThemeData> {
public ButtonBarThemeData(
MainAxisAlignment? alignment = null,
MainAxisSize? mainAxisSize = null,
ButtonTextTheme? buttonTextTheme = null,
float? buttonMinWidth = null,
float? buttonHeight = null,
EdgeInsetsGeometry buttonPadding = null,
bool? buttonAlignedDropdown = null,
ButtonBarLayoutBehavior? layoutBehavior = null,
VerticalDirection? overflowDirection = null
) {
D.assert(buttonMinWidth >= 0.0f);
D.assert(buttonHeight >= 0.0f);
this.alignment = alignment;
this.mainAxisSize = mainAxisSize;
this.buttonTextTheme = buttonTextTheme;
this.buttonMinWidth = buttonMinWidth;
this.buttonHeight = buttonHeight;
this.buttonPadding = buttonPadding;
this.buttonAlignedDropdown = buttonAlignedDropdown;
this.layoutBehavior = layoutBehavior;
this.overflowDirection = overflowDirection;
}
public readonly MainAxisAlignment? alignment;
public readonly MainAxisSize? mainAxisSize;
public readonly ButtonTextTheme? buttonTextTheme;
public readonly float? buttonMinWidth;
public readonly float? buttonHeight;
public readonly EdgeInsetsGeometry buttonPadding;
public readonly bool? buttonAlignedDropdown;
public readonly ButtonBarLayoutBehavior? layoutBehavior;
public readonly VerticalDirection? overflowDirection;
public ButtonBarThemeData copyWith(
MainAxisAlignment? alignment,
MainAxisSize? mainAxisSize,
ButtonTextTheme? buttonTextTheme,
float? buttonMinWidth,
float? buttonHeight,
EdgeInsetsGeometry buttonPadding,
bool? buttonAlignedDropdown,
ButtonBarLayoutBehavior? layoutBehavior,
VerticalDirection? overflowDirection
) {
return new ButtonBarThemeData(
alignment: alignment ?? this.alignment,
mainAxisSize: mainAxisSize ?? this.mainAxisSize,
buttonTextTheme: buttonTextTheme ?? this.buttonTextTheme,
buttonMinWidth: buttonMinWidth ?? this.buttonMinWidth,
buttonHeight: buttonHeight ?? this.buttonHeight,
buttonPadding: buttonPadding ?? this.buttonPadding,
buttonAlignedDropdown: buttonAlignedDropdown ?? this.buttonAlignedDropdown,
layoutBehavior: layoutBehavior ?? this.layoutBehavior,
overflowDirection: overflowDirection ?? this.overflowDirection
);
}
public static ButtonBarThemeData lerp(ButtonBarThemeData a, ButtonBarThemeData b, float t) {
if (a == null && b == null)
return null;
return new ButtonBarThemeData(
alignment: t < 0.5 ? a.alignment : b.alignment,
mainAxisSize: t < 0.5 ? a.mainAxisSize : b.mainAxisSize,
buttonTextTheme: t < 0.5 ? a.buttonTextTheme : b.buttonTextTheme,
buttonMinWidth: Mathf.Lerp(a?.buttonMinWidth ?? 0, b?.buttonMinWidth ?? 0, t),
buttonHeight: Mathf.Lerp(a?.buttonHeight ?? 0, b?.buttonHeight ?? 0, t),
buttonPadding: EdgeInsetsGeometry.lerp(a?.buttonPadding, b?.buttonPadding, t),
buttonAlignedDropdown: t < 0.5 ? a.buttonAlignedDropdown : b.buttonAlignedDropdown,
layoutBehavior: t < 0.5 ? a.layoutBehavior : b.layoutBehavior,
overflowDirection: t < 0.5 ? a.overflowDirection : b.overflowDirection
);
}
public bool Equals(ButtonBarThemeData other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return alignment == other.alignment && mainAxisSize == other.mainAxisSize &&
buttonTextTheme == other.buttonTextTheme && buttonMinWidth.Equals(other.buttonMinWidth) &&
buttonHeight.Equals(other.buttonHeight) && Equals(buttonPadding, other.buttonPadding) &&
buttonAlignedDropdown == other.buttonAlignedDropdown && layoutBehavior == other.layoutBehavior &&
overflowDirection == other.overflowDirection;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != GetType()) {
return false;
}
return Equals((ButtonBarThemeData) obj);
}
public override int GetHashCode() {
unchecked {
var hashCode = (int) alignment;
hashCode = (hashCode * 397) ^ (int) mainAxisSize;
hashCode = (hashCode * 397) ^ (int) buttonTextTheme;
hashCode = (hashCode * 397) ^ buttonMinWidth.GetHashCode();
hashCode = (hashCode * 397) ^ buttonHeight.GetHashCode();
hashCode = (hashCode * 397) ^ (buttonPadding != null ? buttonPadding.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ buttonAlignedDropdown.GetHashCode();
hashCode = (hashCode * 397) ^ (int) layoutBehavior;
hashCode = (hashCode * 397) ^ (int) overflowDirection;
return hashCode;
}
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<MainAxisAlignment?>("alignment", alignment, defaultValue: null));
properties.add(new DiagnosticsProperty<MainAxisSize?>("mainAxisSize", mainAxisSize, defaultValue: null));
properties.add(new DiagnosticsProperty<ButtonTextTheme?>("textTheme", buttonTextTheme, defaultValue: null));
properties.add(new FloatProperty("minWidth", buttonMinWidth, defaultValue: null));
properties.add(new FloatProperty("height", buttonHeight, defaultValue: null));
properties.add(new DiagnosticsProperty<EdgeInsetsGeometry>("padding", buttonPadding, defaultValue: null));
properties.add(new FlagProperty(
"buttonAlignedDropdown",
value: buttonAlignedDropdown,
ifTrue: "dropdown width matches button",
defaultValue: null));
properties.add(
new DiagnosticsProperty<ButtonBarLayoutBehavior?>("layoutBehavior", layoutBehavior,
defaultValue: null));
properties.add(new DiagnosticsProperty<VerticalDirection?>("overflowDirection", overflowDirection,
defaultValue: null));
}
}
public class ButtonBarTheme : InheritedWidget {
public ButtonBarTheme(
Key key = null,
ButtonBarThemeData data = null,
Widget child = null
) : base(key: key, child: child) {
D.assert(data != null);
this.data = data;
}
public readonly ButtonBarThemeData data;
public static ButtonBarThemeData of(BuildContext context) {
ButtonBarTheme buttonBarTheme = context.dependOnInheritedWidgetOfExactType<ButtonBarTheme>();
return buttonBarTheme?.data ?? Theme.of(context).buttonBarTheme;
}
public override bool updateShouldNotify(InheritedWidget oldWidget) {
return oldWidget is ButtonBarTheme buttonBarTheme && !data.Equals(buttonBarTheme.data);
}
}
}
正在加载...
取消
保存