浏览代码

Change double to float.

/main
Yuncong Zhang 6 年前
当前提交
7bea6c4c
共有 185 个文件被更改,包括 1776 次插入1554 次删除
  1. 2
      Editor/EditorExample.cs
  2. 2
      Editor/editor/WidgetCanvasEditor.cs
  3. 2
      Runtime/animation/animation.cs
  4. 110
      Runtime/animation/animation_controller.cs
  5. 56
      Runtime/animation/animations.cs
  6. 139
      Runtime/animation/curves.cs
  7. 63
      Runtime/animation/tween.cs
  8. 7
      Runtime/editor/editor_window.cs
  9. 38
      Runtime/engine/DisplayMetrics.cs
  10. 27
      Runtime/engine/WidgetCanvas.cs
  11. 2
      Runtime/flow/picture_layer.cs
  12. 5
      Runtime/foundation/basic_types.cs
  13. 2
      Runtime/foundation/debug.cs
  14. 72
      Runtime/foundation/diagnostics.cs
  15. 12
      Runtime/gestures/constants.cs
  16. 2
      Runtime/gestures/converter.cs
  17. 4
      Runtime/gestures/drag_details.cs
  18. 44
      Runtime/gestures/lsq_resolver.cs
  19. 22
      Runtime/gestures/monodrag.cs
  20. 16
      Runtime/gestures/velocity_tracker.cs
  21. 46
      Runtime/material/arc.cs
  22. 6
      Runtime/material/button.cs
  23. 6
      Runtime/material/button_bar.cs
  24. 30
      Runtime/material/button_theme.cs
  25. 6
      Runtime/material/card.cs
  26. 4
      Runtime/material/constants.cs
  27. 12
      Runtime/material/divider.cs
  28. 14
      Runtime/material/drawer.cs
  29. 6
      Runtime/material/drawer_header.cs
  30. 10
      Runtime/material/expand_icon.cs
  31. 8
      Runtime/material/expansion_panel.cs
  32. 12
      Runtime/material/expansion_tile.cs
  33. 2
      Runtime/material/flat_button.cs
  34. 12
      Runtime/material/grid_tile.cs
  35. 10
      Runtime/material/icon_button.cs
  36. 12
      Runtime/material/ink_decoration.cs
  37. 28
      Runtime/material/ink_ripple.cs
  38. 8
      Runtime/material/ink_splash.cs
  39. 8
      Runtime/material/ink_well.cs
  40. 80
      Runtime/material/list_tile.cs
  41. 6
      Runtime/material/material.cs
  42. 14
      Runtime/material/material_button.cs
  43. 36
      Runtime/material/mergeable_material.cs
  44. 20
      Runtime/material/raised_button.cs
  45. 2
      Runtime/material/scrollbar.cs
  46. 60
      Runtime/material/shadows.cs
  47. 16
      Runtime/material/text_selection.cs
  48. 6
      Runtime/material/text_theme.cs
  49. 2
      Runtime/material/theme.cs
  50. 2
      Runtime/material/theme_data.cs
  51. 30
      Runtime/material/tooltip.cs
  52. 188
      Runtime/material/typography.cs
  53. 34
      Runtime/material/utils.cs
  54. 12
      Runtime/painting/alignment.cs
  55. 32
      Runtime/painting/beveled_rectangle_border.cs
  56. 22
      Runtime/painting/border_radius.cs
  57. 38
      Runtime/painting/borders.cs
  58. 18
      Runtime/painting/box_border.cs
  59. 12
      Runtime/painting/box_decoration.cs
  60. 5
      Runtime/painting/box_fit.cs
  61. 22
      Runtime/painting/box_shadow.cs
  62. 10
      Runtime/painting/circle_border.cs
  63. 15
      Runtime/painting/decoration.cs
  64. 8
      Runtime/painting/decoration_image.cs
  65. 52
      Runtime/painting/edge_insets.cs
  66. 4
      Runtime/painting/geometry.cs
  67. 52
      Runtime/painting/gradient.cs
  68. 20
      Runtime/painting/image_provider.cs
  69. 2
      Runtime/painting/image_resolution.cs
  70. 8
      Runtime/painting/image_stream.cs
  71. 7
      Runtime/painting/matrix_utils.cs
  72. 44
      Runtime/painting/rounded_rectangle_border.cs
  73. 46
      Runtime/painting/shape_decoration.cs
  74. 90
      Runtime/painting/stadium_border.cs
  75. 38
      Runtime/painting/text_painter.cs
  76. 52
      Runtime/painting/text_style.cs
  77. 22
      Runtime/physics/clamped_simulation.cs
  78. 58
      Runtime/physics/friction_simulation.cs
  79. 24
      Runtime/physics/gravity_simulation.cs
  80. 6
      Runtime/physics/simulation.cs
  81. 64
      Runtime/physics/spring_simulation.cs
  82. 14
      Runtime/physics/tolerance.cs
  83. 2
      Runtime/rendering/animated_size.cs
  84. 186
      Runtime/rendering/box.cs
  85. 12
      Runtime/rendering/box.mixin.gen.cs
  86. 32
      Runtime/rendering/custom_layout.cs
  87. 2
      Runtime/rendering/custom_paint.cs
  88. 82
      Runtime/rendering/editable.cs
  89. 4
      Runtime/rendering/error.cs
  90. 90
      Runtime/rendering/flex.cs
  91. 44
      Runtime/rendering/image.cs
  92. 46
      Runtime/rendering/list_body.cs
  93. 22
      Runtime/rendering/paragraph.cs
  94. 116
      Runtime/rendering/proxy_box.cs
  95. 18
      Runtime/rendering/proxy_box.mixin.gen.cs
  96. 188
      Runtime/rendering/shifted_box.cs
  97. 214
      Runtime/rendering/sliver.cs
  98. 34
      Runtime/rendering/sliver_fill.cs
  99. 52
      Runtime/rendering/sliver_fixed_extent_list.cs
  100. 26
      Runtime/rendering/sliver_list.cs

2
Editor/EditorExample.cs


return parameter3 ? (parameter1 + parameter2) : (parameter1 - parameter2);
}
}
}
}

2
Editor/editor/WidgetCanvasEditor.cs


this.serializedObject.ApplyModifiedProperties();
}
}
}
}

2
Runtime/animation/animation.cs


public Animation<U> drive<U>(Animatable<U> child) {
D.assert(this is Animation<double>);
return child.animate(this as Animation<double>);
return child.animate(this as Animation<float>);
}
}
}

110
Runtime/animation/animation_controller.cs


}
public class AnimationController :
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<double> {
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<float> {
double? value = null,
float? value = null,
double lowerBound = 0.0,
double upperBound = 1.0,
float lowerBound = 0.0f,
float upperBound = 1.0f,
TickerProvider vsync = null
) {
D.assert(upperBound >= lowerBound);

}
AnimationController(
double value = 0.0,
float value = 0.0f,
this.lowerBound = double.NegativeInfinity;
this.upperBound = double.PositiveInfinity;
this.lowerBound = float.NegativeInfinity;
this.upperBound = float.PositiveInfinity;
this._direction = _AnimationDirection.forward;
this.duration = duration;

}
public static AnimationController unbounded(
double value = 0.0,
float value = 0.0f,
TimeSpan? duration = null,
string debugLabel = null,
TickerProvider vsync = null

public readonly double lowerBound;
public readonly float lowerBound;
public readonly double upperBound;
public readonly float upperBound;
public Animation<double> view {
public Animation<float> view {
get { return this; }
}

Simulation _simulation;
public override double value {
public override float value {
double _value;
float _value;
public void setValue(double newValue) {
public void setValue(float newValue) {
this.stop();
this._internalSetValue(newValue);
this.notifyListeners();

this.setValue(this.lowerBound);
}
public double velocity {
public float velocity {
return 0.0;
return 0.0f;
return this._simulation.dx((double) this.lastElapsedDuration.Value.Ticks / TimeSpan.TicksPerSecond);
return this._simulation.dx(this.lastElapsedDuration.Value.Ticks / TimeSpan.TicksPerSecond);
void _internalSetValue(double newValue) {
void _internalSetValue(float newValue) {
this._value = newValue.clamp(this.lowerBound, this.upperBound);
if (this._value == this.lowerBound) {
this._status = AnimationStatus.dismissed;

AnimationStatus _status;
public TickerFuture forward(double? from = null) {
public TickerFuture forward(float? from = null) {
D.assert(() => {
if (this.duration == null) {
throw new UIWidgetsError(

return this._animateToInternal(this.upperBound);
}
public TickerFuture reverse(double? from = null) {
public TickerFuture reverse(float? from = null) {
D.assert(() => {
if (this.duration == null) {
throw new UIWidgetsError(

return this._animateToInternal(this.lowerBound);
}
public TickerFuture animateTo(double target, TimeSpan? duration = null, Curve curve = null) {
public TickerFuture animateTo(float target, TimeSpan? duration = null, Curve curve = null) {
curve = curve ?? Curves.linear;
this._direction = _AnimationDirection.forward;

TickerFuture _animateToInternal(double target, TimeSpan? duration = null, Curve curve = null) {
TickerFuture _animateToInternal(float target, TimeSpan? duration = null, Curve curve = null) {
curve = curve ?? Curves.linear;
TimeSpan? simulationDuration = duration;

return true;
});
double range = this.upperBound - this.lowerBound;
double remainingFraction = range.isFinite() ? (target - this._value).abs() / range : 1.0;
float range = this.upperBound - this.lowerBound;
float remainingFraction = range.isFinite() ? (target - this._value).abs() / range : 1.0f;
simulationDuration = TimeSpan.FromTicks((long) (this.duration.Value.Ticks * remainingFraction));
}
else if (target == this.value) {

new _InterpolationSimulation(this._value, target, simulationDuration.Value, curve));
}
public TickerFuture repeat(double? min = null, double? max = null, TimeSpan? period = null) {
public TickerFuture repeat(float? min = null, float? max = null, TimeSpan? period = null) {
min = min ?? this.lowerBound;
max = max ?? this.upperBound;
period = period ?? this.duration;

return this.animateWith(new _RepeatingSimulation(min.Value, max.Value, period.Value));
}
public TickerFuture fling(double velocity = 1.0) {
public TickerFuture fling(float velocity = 1.0f) {
double target = velocity < 0.0
float target = velocity < 0.0f
? this.lowerBound - _kFlingTolerance.distance
: this.upperBound + _kFlingTolerance.distance;
Simulation simulation = new SpringSimulation(_kFlingSpringDescription, this.value,

D.assert(!this.isAnimating);
this._simulation = simulation;
this._lastElapsedDuration = TimeSpan.Zero;
this._value = simulation.x(0.0).clamp(this.lowerBound, this.upperBound);
this._value = simulation.x(0.0f).clamp(this.lowerBound, this.upperBound);
var result = this._ticker.start();
this._status = (this._direction == _AnimationDirection.forward)
? AnimationStatus.forward

void _tick(TimeSpan elapsed) {
this._lastElapsedDuration = elapsed;
double elapsedInSeconds = (double) elapsed.Ticks / TimeSpan.TicksPerSecond;
float elapsedInSeconds = elapsed.Ticks / TimeSpan.TicksPerSecond;
D.assert(elapsedInSeconds >= 0.0);
this._value = this._simulation.x(elapsedInSeconds).clamp(this.lowerBound, this.upperBound);
if (this._simulation.isDone(elapsedInSeconds)) {

);
static readonly Tolerance _kFlingTolerance = new Tolerance(
velocity: double.PositiveInfinity,
distance: 0.01
velocity: float.PositiveInfinity,
distance: 0.01f
internal _InterpolationSimulation(double begin, double end, TimeSpan duration, Curve curve) {
internal _InterpolationSimulation(float begin, float end, TimeSpan duration, Curve curve) {
this._durationInSeconds = (double) duration.Ticks / TimeSpan.TicksPerSecond;
this._durationInSeconds = duration.Ticks / TimeSpan.TicksPerSecond;
readonly double _durationInSeconds;
readonly double _begin;
readonly double _end;
readonly float _durationInSeconds;
readonly float _begin;
readonly float _end;
public override double x(double timeInSeconds) {
double t = (timeInSeconds / this._durationInSeconds).clamp(0.0, 1.0);
if (t == 0.0) {
public override float x(float timeInSeconds) {
float t = (timeInSeconds / this._durationInSeconds).clamp(0.0f, 1.0f);
if (t == 0.0f) {
else if (t == 1.0) {
else if (t == 1.0f) {
return this._end;
}
else {

public override double dx(double timeInSeconds) {
double epsilon = this.tolerance.time;
public override float dx(float timeInSeconds) {
float epsilon = this.tolerance.time;
public override bool isDone(double timeInSeconds) {
public override bool isDone(float timeInSeconds) {
internal _RepeatingSimulation(double min, double max, TimeSpan period) {
internal _RepeatingSimulation(float min, float max, TimeSpan period) {
this._periodInSeconds = (double) period.Ticks / TimeSpan.TicksPerSecond;
D.assert(this._periodInSeconds > 0.0);
this._periodInSeconds = period.Ticks / TimeSpan.TicksPerSecond;
D.assert(this._periodInSeconds > 0.0f);
readonly double _min;
readonly double _max;
readonly double _periodInSeconds;
readonly float _min;
readonly float _max;
readonly float _periodInSeconds;
public override double x(double timeInSeconds) {
D.assert(timeInSeconds >= 0.0);
double t = (timeInSeconds / this._periodInSeconds) % 1.0;
return MathUtils.lerpDouble(this._min, this._max, t);
public override float x(float timeInSeconds) {
D.assert(timeInSeconds >= 0.0f);
float t = (timeInSeconds / this._periodInSeconds) % 1.0f;
return MathUtils.lerpFloat(this._min, this._max, t);
public override double dx(double timeInSeconds) {
public override float dx(float timeInSeconds) {
public override bool isDone(double timeInSeconds) {
public override bool isDone(float timeInSeconds) {
return false;
}
}

56
Runtime/animation/animations.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.animation {
class _AlwaysCompleteAnimation : Animation<double> {
class _AlwaysCompleteAnimation : Animation<float> {
internal _AlwaysCompleteAnimation() {
}

}
public override double value {
get { return 1.0; }
public override float value {
get { return 1.0f; }
}
public override string ToString() {

class _AlwaysDismissedAnimation : Animation<double> {
class _AlwaysDismissedAnimation : Animation<float> {
internal _AlwaysDismissedAnimation() {
}

}
public override double value {
get { return 0.0; }
public override float value {
get { return 0.0f; }
}
public override string ToString() {

}
public class ProxyAnimation :
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<double> {
public ProxyAnimation(Animation<double> animation = null) {
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<float> {
public ProxyAnimation(Animation<float> animation = null) {
this._value = 0.0;
this._value = 0.0f;
double _value;
float _value;
public Animation<double> parent {
public Animation<float> parent {
get { return this._parent; }
set {
if (value == this._parent) {

}
}
Animation<double> _parent;
Animation<float> _parent;
protected override void didStartListening() {
if (this._parent != null) {

get { return this._parent != null ? this._parent.status : this._status; }
}
public override double value {
public override float value {
get { return this._parent != null ? this._parent.value : this._value; }
}

}
}
public class CurvedAnimation : AnimationWithParentMixin<double, double> {
public class CurvedAnimation : AnimationWithParentMixin<float, float> {
Animation<double> parent = null,
Animation<float> parent = null,
Curve curve = null,
Curve reverseCurve = null
) {

parent.addStatusListener(this._updateCurveDirection);
}
public override Animation<double> parent {
public override Animation<float> parent {
readonly Animation<double> _parent;
readonly Animation<float> _parent;
public Curve curve;

}
}
public override double value {
public override float value {
double t = this.parent.value;
float t = this.parent.value;
if (activeCurve == null) {
return t;
}

}
public class TrainHoppingAnimation :
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<double> {
AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<float> {
Animation<double> currentTrain = null,
Animation<double> nextTrain = null,
Animation<float> currentTrain = null,
Animation<float> nextTrain = null,
VoidCallback onSwitchedTrain = null) {
D.assert(currentTrain != null);
this._currentTrain = currentTrain;

}
}
public Animation<double> currentTrain {
public Animation<float> currentTrain {
Animation<double> _currentTrain;
Animation<double> _nextTrain;
Animation<float> _currentTrain;
Animation<float> _nextTrain;
_TrainHoppingMode _mode;
public VoidCallback onSwitchedTrain;

}
}
public override double value {
public override float value {
get { return this._currentTrain.value; }
}

}
public static class Animations {
public static readonly Animation<double> kAlwaysCompleteAnimation = new _AlwaysCompleteAnimation();
public static readonly Animation<float> kAlwaysCompleteAnimation = new _AlwaysCompleteAnimation();
public static readonly Animation<double> kAlwaysDismissedAnimation = new _AlwaysDismissedAnimation();
public static readonly Animation<float> kAlwaysDismissedAnimation = new _AlwaysDismissedAnimation();
}
}

139
Runtime/animation/curves.cs


namespace Unity.UIWidgets.animation {
public abstract class Curve {
public abstract double transform(double t);
public abstract float transform(float t);
public Curve flipped {
get { return new FlippedCurve(this); }

}
class _Linear : Curve {
public override double transform(double t) {
public override float transform(float t) {
return t;
}
}

public readonly int count;
public override double transform(double t) {
public override float transform(float t) {
if (t == 1.0) {
return 1.0;
if (t == 1.0f) {
return 1.0f;
}
t *= this.count;

}
public class Interval : Curve {
public Interval(double begin, double end, Curve curve = null) {
public Interval(float begin, float end, Curve curve = null) {
public readonly double begin;
public readonly float begin;
public readonly double end;
public readonly float end;
public override double transform(double t) {
public override float transform(float t) {
D.assert(t >= 0.0 && t <= 1.0);
D.assert(this.begin >= 0.0);
D.assert(this.begin <= 1.0);

return t;
}
t = ((t - this.begin) / (this.end - this.begin)).clamp(0.0, 1.0);
t = ((t - this.begin) / (this.end - this.begin)).clamp(0.0f, 1.0f);
if (t == 0.0 || t == 1.0) {
return t;
}

public readonly double threshold;
public override double transform(double t) {
public override float transform(float t) {
D.assert(t >= 0.0 && t <= 1.0);
D.assert(this.threshold >= 0.0);
D.assert(this.threshold <= 1.0);

return t < this.threshold ? 0.0 : 1.0;
return t < this.threshold ? 0.0f : 1.0f;
public Cubic(double a, double b, double c, double d) {
public Cubic(float a, float b, float c, float d) {
this.a = a;
this.b = b;
this.c = c;

public readonly double a;
public readonly float a;
public readonly double b;
public readonly float b;
public readonly double c;
public readonly float c;
public readonly double d;
public readonly float d;
const double _cubicErrorBound = 0.001;
const float _cubicErrorBound = 0.001f;
double _evaluateCubic(double a, double b, double m) {
float _evaluateCubic(float a, float b, float m) {
public override double transform(double t) {
public override float transform(float t) {
double start = 0.0;
double end = 1.0;
if (t.isNaN()) {
return float.NaN;
}
float start = 0.0f;
float end = 1.0f;
double midpoint = (start + end) / 2;
double estimate = this._evaluateCubic(this.a, this.c, midpoint);
float midpoint = (start + end) / 2;
float estimate = this._evaluateCubic(this.a, this.c, midpoint);
if ((t - estimate).abs() < _cubicErrorBound) {
return this._evaluateCubic(this.b, this.d, midpoint);
}

public readonly Curve curve;
public override double transform(double t) {
return 1.0 - this.curve.transform(1.0 - t);
public override float transform(float t) {
return 1.0f - this.curve.transform(1.0f - t);
}
public override string ToString() {

internal _DecelerateCurve() {
}
public override double transform(double t) {
public override float transform(float t) {
t = 1.0 - t;
return 1.0 - t * t;
t = 1.0f - t;
return 1.0f - t * t;
}
}

public override double transform(double t) {
public override float transform(float t) {
return 1.0 - Curves._bounce(1.0 - t);
return 1.0f - Curves._bounce(1.0f - t);
}
}

public override double transform(double t) {
D.assert(t >= 0.0 && t <= 1.0);
public override float transform(float t) {
D.assert(t >= 0.0f && t <= 1.0f);
return Curves._bounce(t);
}
}

}
public override double transform(double t) {
D.assert(t >= 0.0 && t <= 1.0);
if (t < 0.5) {
return (1.0 - Curves._bounce(1.0 - t)) * 0.5;
public override float transform(float t) {
D.assert(t >= 0.0 && t <= 1.0f);
if (t < 0.5f) {
return (1.0f - Curves._bounce(1.0f - t)) * 0.5f;
return Curves._bounce(t * 2.0 - 1.0) * 0.5 + 0.5;
return Curves._bounce(t * 2.0f - 1.0f) * 0.5f + 0.5f;
public ElasticInCurve(double period = 0.4) {
public ElasticInCurve(float period = 0.4f) {
public readonly double period;
public readonly float period;
public override double transform(double t) {
public override float transform(float t) {
double s = this.period / 4.0;
t = t - 1.0;
return -Math.Pow(2.0, 10.0 * t) * Math.Sin((t - s) * (Math.PI * 2.0) / this.period);
float s = this.period / 4.0f;
t = t - 1.0f;
return (float) (-Math.Pow(2.0, 10.0 * t) * Math.Sin((t - s) * (Math.PI * 2.0) / this.period));
}
public override string ToString() {

public readonly double period;
public override double transform(double t) {
public override float transform(float t) {
return Math.Pow(2.0, -10.0 * t) * Math.Sin((t - s) * (Math.PI * 2.0) / this.period) + 1.0;
return (float) (Math.Pow(2.0, -10.0 * t) * Math.Sin((t - s) * (Math.PI * 2.0) / this.period) + 1.0);
}
public override string ToString() {

public readonly double period;
public override double transform(double t) {
public override float transform(float t) {
double s = this.period / 4.0;
t = 2.0 * t - 1.0;
double s = this.period / 4.0f;
t = 2.0f * t - 1.0f;
return -0.5 * Math.Pow(2.0, 10.0 * t) * Math.Sin((t - s) * (Math.PI * 2.0) / this.period);
return (float) (-0.5 * Math.Pow(2.0f, 10.0f * t) * Math.Sin((t - s) * (Math.PI * 2.0f) / this.period));
return Math.Pow(2.0, -10.0 * t) * Math.Sin((t - s) * (Math.PI * 2.0) / this.period) * 0.5 + 1.0;
return (float) (Math.Pow(2.0f, -10.0f * t) * Math.Sin((t - s) * (Math.PI * 2.0f) / this.period) * 0.5f +
1.0f);
}
}

public static readonly Curve decelerate = new _DecelerateCurve();
public static readonly Curve ease = new Cubic(0.25, 0.1, 0.25, 1.0);
public static readonly Curve ease = new Cubic(0.25f, 0.1f, 0.25f, 1.0f);
public static readonly Curve easeIn = new Cubic(0.42, 0.0, 1.0, 1.0);
public static readonly Curve easeIn = new Cubic(0.42f, 0.0f, 1.0f, 1.0f);
public static readonly Curve easeOut = new Cubic(0.0, 0.0, 0.58, 1.0);
public static readonly Curve easeOut = new Cubic(0.0f, 0.0f, 0.58f, 1.0f);
public static readonly Curve easeInOut = new Cubic(0.42, 0.0, 0.58, 1.0);
public static readonly Curve easeInOut = new Cubic(0.42f, 0.0f, 0.58f, 1.0f);
public static readonly Curve fastOutSlowIn = new Cubic(0.4, 0.0, 0.2, 1.0);
public static readonly Curve fastOutSlowIn = new Cubic(0.4f, 0.0f, 0.2f, 1.0f);
public static readonly Curve bounceIn = new _BounceInCurve();

public static readonly Curve elasticInOut = new ElasticInOutCurve();
internal static double _bounce(double t) {
if (t < 1.0 / 2.75) {
return 7.5625 * t * t;
internal static float _bounce(float t) {
if (t < 1.0f / 2.75f) {
return 7.5625f * t * t;
else if (t < 2 / 2.75) {
t -= 1.5 / 2.75;
return 7.5625 * t * t + 0.75;
else if (t < 2 / 2.75f) {
t -= 1.5f / 2.75f;
return 7.5625f * t * t + 0.75f;
else if (t < 2.5 / 2.75) {
t -= 2.25 / 2.75;
return 7.5625 * t * t + 0.9375;
else if (t < 2.5f / 2.75f) {
t -= 2.25f / 2.75f;
return 7.5625f * t * t + 0.9375f;
t -= 2.625 / 2.75;
return 7.5625 * t * t + 0.984375;
t -= 2.625f / 2.75f;
return 7.5625f * t * t + 0.984375f;
}
}
}

63
Runtime/animation/tween.cs


namespace Unity.UIWidgets.animation {
public abstract class Animatable<T> {
public abstract T evaluate(Animation<double> animation);
public abstract T evaluate(Animation<float> animation);
public Animation<T> animate(Animation<double> parent) {
public Animation<T> animate(Animation<float> parent) {
public Animatable<T> chain(Animatable<double> parent) {
public Animatable<T> chain(Animatable<float> parent) {
class _AnimatedEvaluation<T> : AnimationWithParentMixin<double, T> {
internal _AnimatedEvaluation(Animation<double> parent, Animatable<T> evaluatable) {
class _AnimatedEvaluation<T> : AnimationWithParentMixin<float, T> {
internal _AnimatedEvaluation(Animation<float> parent, Animatable<T> evaluatable) {
public override Animation<double> parent {
public override Animation<float> parent {
readonly Animation<double> _parent;
readonly Animation<float> _parent;
readonly Animatable<T> _evaluatable;

class _ChainedEvaluation<T> : Animatable<T> {
internal _ChainedEvaluation(Animatable<double> parent, Animatable<T> evaluatable) {
internal _ChainedEvaluation(Animatable<float> parent, Animatable<T> evaluatable) {
readonly Animatable<double> _parent;
readonly Animatable<float> _parent;
public override T evaluate(Animation<double> animation) {
double value = this._parent.evaluate(animation);
return this._evaluatable.evaluate(new AlwaysStoppedAnimation<double>(value));
public override T evaluate(Animation<float> animation) {
float value = this._parent.evaluate(animation);
return this._evaluatable.evaluate(new AlwaysStoppedAnimation<float>(value));
}
public override string ToString() {

public T end;
public abstract T lerp(double t);
public abstract T lerp(float t);
public override T evaluate(Animation<double> animation) {
double t = animation.value;
public override T evaluate(Animation<float> animation) {
float t = animation.value;
if (t == 0.0) {
return this.begin;
}

public readonly Tween<T> parent;
public override T lerp(double t) {
return this.parent.lerp(1.0 - t);
public override T lerp(float t) {
return this.parent.lerp(1.0f - t);
}
}

public override Color lerp(double t) {
public override Color lerp(float t) {
return Color.lerp(this.begin, this.end, t);
}
}

}
public override Size lerp(double t) {
public override Size lerp(float t) {
return Size.lerp(this.begin, this.end, t);
}
}

}
public override Rect lerp(double t) {
public override Rect lerp(float t) {
return Rect.lerp(this.begin, this.end, t);
}
}

}
public override int lerp(double t) {
public override int lerp(float t) {
return (this.begin + (this.end - this.begin) * t).round();
}
}

}
public override double lerp(double t) {
public override double lerp(float t) {
return this.begin + (this.end - this.begin) * t;
}
}
public class FloatTween : Tween<float> {
public FloatTween(float begin, float end) : base(begin: begin, end: end) {
}
public override float lerp(float t) {
return this.begin + (this.end - this.begin) * t;
}
}

}
public override int lerp(double t) {
public override int lerp(float t) {
return (this.begin + (this.end - this.begin) * t).floor();
}
}

}
public override Offset lerp(double t) {
public override Offset lerp(float t) {
public class CurveTween : Animatable<double> {
public class CurveTween : Animatable<float> {
public CurveTween(Curve curve = null) {
D.assert(curve != null);
this.curve = curve;

public override double evaluate(Animation<double> animation) {
double t = animation.value;
public override float evaluate(Animation<float> animation) {
float t = animation.value;
if (t == 0.0 || t == 1.0) {
D.assert(this.curve.transform(t).round() == t);
return t;

7
Runtime/editor/editor_window.cs


get { return this.editorWindow.titleContent; }
}
protected override double queryDevicePixelRatio() {
protected override float queryDevicePixelRatio() {
return EditorGUIUtility.pixelsPerPoint;
}

if (this._devicePixelRatio != this.queryDevicePixelRatio()) {
return true;
}
var size = this.queryWindowSize();
if (this._lastWindowWidth != size.x
|| this._lastWindowHeight != size.y) {

get { return null; }
}
protected abstract double queryDevicePixelRatio();
protected abstract float queryDevicePixelRatio();
protected abstract Vector2 queryWindowSize();
protected virtual Surface createSurface() {

if (this._textInput != null) {
this._textInput.keyboardManager.Update();
}
this._timerProvider.update(this.flushMicrotasks);
this.flushMicrotasks();
}

38
Runtime/engine/DisplayMetrics.cs


using UnityEngine;
namespace Unity.UIWidgets.engine {
static float _devicePixelRatio = 0;
static Func<float> _devicePixelRatioGetter;

}
if (_devicePixelRatioGetter != null) {
return _devicePixelRatioGetter();
}

}
if (Application.platform == RuntimePlatform.Android) {
_devicePixelRatio = DevicePixelRatioAndroid();
} else if (Application.platform == RuntimePlatform.WebGLPlayer) {
_devicePixelRatio = UIWidgetsWebGLDevicePixelRatio();
} else if (Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.tvOS) {
_devicePixelRatio = IOSDeviceSaleFactor();
}
#if UNITY_ANDROID
_devicePixelRatio = AndroidDevicePixelRatio();
#endif
#if UNITY_WEBGL
_devicePixelRatio = UIWidgetsWebGLDevicePixelRatio();
#endif
#if UNITY_IOS
_devicePixelRatio = IOSDeviceSaleFactor();
#endif
if (_devicePixelRatio <= 0) {
_devicePixelRatio = 1;

}
}
}
static float DevicePixelRatioAndroid() {
#if UNITY_ANDROID
static float AndroidDevicePixelRatio() {
using (
AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")
) {

displayInstance = windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay")
) {
displayInstance.Call("getMetrics", metricsInstance);
return metricsInstance.Get<float>("density");
return metricsInstance.Get<float>("density");
#endif
#if UNITY_WEBGL
#endif
#if UNITY_IOS
#endif
}
}

27
Runtime/engine/WidgetCanvas.cs


protected override void updateSafeArea() {
this._padding = new WindowPadding(
Screen.safeArea.x,
Screen.safeArea.y,
Screen.safeArea.x,
Screen.safeArea.y,
Screen.width - Screen.safeArea.width,
Screen.height - Screen.safeArea.height);
}

if (this.displayMetricsChanged()) {
this._needsPaint = true;
}
if (evt.type == EventType.Repaint) {
if (!this._needsPaint) {
return;

get { return new GUIContent(this._widgetCanvas.gameObject.name); }
}
protected override double queryDevicePixelRatio() {
protected override float queryDevicePixelRatio() {
size = size * this._widgetCanvas.canvas.scaleFactor / (float)this._widgetCanvas.devicePixelRatio;
return new Vector2 (Mathf.Round (size.x), Mathf.Round (size.y));
size = size * this._widgetCanvas.canvas.scaleFactor / (float) this._widgetCanvas.devicePixelRatio;
return new Vector2(Mathf.Round(size.x), Mathf.Round(size.y));
}
}

static Event _repaintEvent;
[SerializeField]
protected double devicePixelRatioOverride;
protected float devicePixelRatioOverride;
WindowAdapter _windowAdapter;
Texture _texture;
Vector2 _lastMouseMove;

this._lastMouseMove = Input.mousePosition;
}
public double devicePixelRatio {
get { return this.devicePixelRatioOverride > 0 ? this.devicePixelRatioOverride : DisplayMetrics.devicePixelRatio; }
public float devicePixelRatio {
get {
return this.devicePixelRatioOverride > 0
? this.devicePixelRatioOverride
: DisplayMetrics.devicePixelRatio;
}
}
protected virtual Dictionary<string, WidgetBuilder> routes {

return (RouteSettings settings, WidgetBuilder builder) =>
new PageRouteBuilder(
settings: settings,
pageBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) => builder(context)
pageBuilder: (BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) => builder(context)
);
}
}

2
Runtime/flow/picture_layer.cs


var canvas = context.canvas;
canvas.save();
canvas.translate(this._offset.dx, this._offset.dy);
canvas.translate((float) this._offset.dx, (float) this._offset.dy);
// align to pixel
var matrix = canvas.getTotalMatrix();

5
Runtime/foundation/basic_types.cs


hashCode = (hashCode * 397) ^ item.GetHashCode();
}
}
public static bool equalsList<T>(this IList<T> it, IList<T> list) {
if (it == null && list == null) {
return true;

return true;
}
public static string toStringList<T>(this IList<T> it) {
return "{ " + string.Join(", ", it.Select(item => item.ToString())) + " }";
}

2
Runtime/foundation/debug.cs


// canvas.drawPath(path, paint);
}
public static void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, double outlineWidth = 2.0) {
public static void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, float outlineWidth = 2.0f) {
assert(() => {
if (innerRect != null && !innerRect.isEmpty) {
_debugDrawDoubleRect(canvas, outerRect, innerRect, new Color(0x900090FF));

72
Runtime/foundation/diagnostics.cs


}
}
public class FloatProperty : _NumProperty<float?> {
public FloatProperty(string name, float? value,
string ifNull = null,
string unit = null,
string tooltip = null,
object defaultValue = null,
bool showName = true,
DiagnosticLevel level = DiagnosticLevel.info
) : base(
name,
value,
ifNull: ifNull,
unit: unit,
tooltip: tooltip,
defaultValue: defaultValue,
showName: showName,
level: level
) {
}
FloatProperty(
string name,
ComputePropertyValueCallback<float?> computeValue,
string ifNull = null,
bool showName = true,
string unit = null,
string tooltip = null,
object defaultValue = null,
DiagnosticLevel level = DiagnosticLevel.info
) : base(
name,
computeValue,
showName: showName,
ifNull: ifNull,
unit: unit,
tooltip: tooltip,
defaultValue: defaultValue,
level: level
) {
}
public static FloatProperty lazy(
string name,
ComputePropertyValueCallback<float?> computeValue,
string ifNull = null,
bool showName = true,
string unit = null,
string tooltip = null,
object defaultValue = null,
DiagnosticLevel level = DiagnosticLevel.info
) {
return new FloatProperty(
name,
computeValue,
showName: showName,
ifNull: ifNull,
unit: unit,
tooltip: tooltip,
defaultValue: defaultValue,
level: level
);
}
protected override string numberToString() {
if (this.value != null) {
return this.value.Value.ToString("F1");
}
return "null";
}
}
public class PercentProperty : DoubleProperty {
public PercentProperty(string name, double fraction,
string ifNull = null,

12
Runtime/gestures/constants.cs


namespace Unity.UIWidgets.gestures {
public static class Constants {
public const double kTouchSlop = 18.0;
public const float kTouchSlop = 18.0f;
public const double kDoubleTapTouchSlop = kTouchSlop;
public const float kDoubleTapTouchSlop = kTouchSlop;
public const double kDoubleTapSlop = 100.0;
public const float kDoubleTapSlop = 100.0f;
public const double kPanSlop = kTouchSlop * 2.0;
public const float kPanSlop = kTouchSlop * 2.0f;
public static readonly TimeSpan kPressTimeout = new TimeSpan(0, 0, 0, 0, 100);

public const double kMinFlingVelocity = 50.0;
public const float kMinFlingVelocity = 50.0f;
public const double kMaxFlingVelocity = 8000.0;
public const float kMaxFlingVelocity = 8000.0f;
}
}

2
Runtime/gestures/converter.cs


() => new _PointerState(position));
}
public static IEnumerable<PointerEvent> expand(IEnumerable<PointerData> data, double devicePixelRatio) {
public static IEnumerable<PointerEvent> expand(IEnumerable<PointerData> data, float devicePixelRatio) {
foreach (PointerData datum in data) {
var position = new Offset(datum.physicalX, datum.physicalY) / devicePixelRatio;
var timeStamp = datum.timeStamp;

4
Runtime/gestures/drag_details.cs


public DragUpdateDetails(
TimeSpan sourceTimeStamp,
Offset delta = null,
double? primaryDelta = null,
float? primaryDelta = null,
Offset globalPosition = null,
bool isScroll = false) {
this.sourceTimeStamp = sourceTimeStamp;

public readonly Offset delta;
public readonly double? primaryDelta;
public readonly float? primaryDelta;
public readonly Offset globalPosition;

44
Runtime/gestures/lsq_resolver.cs


internal _Vector(int size) {
this._offset = 0;
this._length = size;
this._elements = Enumerable.Repeat(0.0, size).ToList();
this._elements = Enumerable.Repeat(0.0f, size).ToList();
_Vector(List<double> values, int offset, int length) {
_Vector(List<float> values, int offset, int length) {
internal static _Vector fromVOL(List<double> values, int offset, int length) {
internal static _Vector fromVOL(List<float> values, int offset, int length) {
return new _Vector(values, offset, length);
}

readonly List<double> _elements;
readonly List<float> _elements;
public double this[int i] {
public float this[int i] {
public static double operator *(_Vector a, _Vector b) {
double result = 0.0;
public static float operator *(_Vector a, _Vector b) {
float result = 0.0f;
for (int i = 0; i < a._length; i += 1) {
result += a[i] * b[i];
}

public double norm() {
return Math.Sqrt(this * this);
public float norm() {
return (float) Math.Sqrt(this * this);
}
}

this._elements = Enumerable.Repeat(0.0, rows * cols).ToList();
this._elements = Enumerable.Repeat(0.0f, rows * cols).ToList();
readonly List<double> _elements;
readonly List<float> _elements;
public double this[int row, int col] {
public float this[int row, int col] {
get { return this._elements[row * this._columns + col]; }
set { this._elements[row * this._columns + col] = value; }
}

public class PolynomialFit {
public PolynomialFit(int degree) {
this.coefficients = Enumerable.Repeat(0.0, degree + 1).ToList();
this.coefficients = Enumerable.Repeat(0.0f, degree + 1).ToList();
public readonly List<double> coefficients;
public readonly List<float> coefficients;
public LeastSquaresSolver(List<double> x, List<double> y, List<double> w) {
public LeastSquaresSolver(List<float> x, List<float> y, List<float> w) {
D.assert(x != null && y != null && w != null);
D.assert(x.Count == y.Count);
D.assert(y.Count == w.Count);

}
public readonly List<double> x;
public readonly List<float> x;
public readonly List<double> y;
public readonly List<float> y;
public readonly List<double> w;
public readonly List<float> w;
/// Fits a polynomial of the given degree to the data points.
public PolynomialFit solve(int degree) {

}
for (int i = 0; i < j; i += 1) {
double dot = q.getRow(j) * q.getRow(i);
float dot = q.getRow(j) * q.getRow(i);
double norm = q.getRow(j).norm();
float norm = q.getRow(j).norm();
double inverseNorm = 1.0 / norm;
float inverseNorm = 1.0f / norm;
r[j, i] = i < j ? 0.0 : q.getRow(j) * a.getRow(i);
r[j, i] = i < j ? 0.0f : q.getRow(j) * a.getRow(i);
}
}

22
Runtime/gestures/monodrag.cs


public GestureDragCancelCallback onCancel;
public double? minFlingDistance;
public float? minFlingDistance;
public double? minFlingVelocity;
public float? minFlingVelocity;
public double? maxFlingVelocity;
public float? maxFlingVelocity;
_DragState _state = _DragState.ready;
Offset _initialPosition;

protected abstract bool _isFlingGesture(VelocityEstimate estimate);
protected abstract Offset _getDeltaForDetails(Offset delta);
protected abstract double? _getPrimaryValueFromOffset(Offset value);
protected abstract float? _getPrimaryValueFromOffset(Offset value);
protected abstract bool _hasSufficientPendingDragDeltaToAccept { get; }
readonly Dictionary<int, VelocityTracker> _velocityTrackers = new Dictionary<int, VelocityTracker>();

}
protected override Offset _getDeltaForDetails(Offset delta) {
return new Offset(0.0, delta.dy);
return new Offset(0.0f, delta.dy);
protected override double? _getPrimaryValueFromOffset(Offset value) {
return value.dy;
protected override float? _getPrimaryValueFromOffset(Offset value) {
return (float) value.dy;
}
public override string debugDescription {

}
protected override Offset _getDeltaForDetails(Offset delta) {
return new Offset(delta.dx, 0.0);
return new Offset(delta.dx, 0.0f);
protected override double? _getPrimaryValueFromOffset(Offset value) {
return value.dx;
protected override float? _getPrimaryValueFromOffset(Offset value) {
return (float) value.dx;
}
public override string debugDescription {

return delta;
}
protected override double? _getPrimaryValueFromOffset(Offset value) {
protected override float? _getPrimaryValueFromOffset(Offset value) {
return null;
}

16
Runtime/gestures/velocity_tracker.cs


pixelsPerSecond: a.pixelsPerSecond + b.pixelsPerSecond);
}
public Velocity clampMagnitude(double minValue, double maxValue) {
public Velocity clampMagnitude(float minValue, float maxValue) {
D.assert(minValue >= 0.0);
D.assert(maxValue >= 0.0 && maxValue >= minValue);
double valueSquared = this.pixelsPerSecond.distanceSquared;

}
public VelocityEstimate getVelocityEstimate() {
List<double> x = new List<double>();
List<double> y = new List<double>();
List<double> w = new List<double>();
List<double> time = new List<double>();
List<float> x = new List<float>();
List<float> y = new List<float>();
List<float> w = new List<float>();
List<float> time = new List<float>();
int sampleCount = 0;
int index = this._index;

break;
}
double age = (newestSample.time - sample.time).TotalMilliseconds;
double delta = Math.Abs((sample.time - previousSample.time).TotalMilliseconds);
float age = (float) (newestSample.time - sample.time).TotalMilliseconds;
float delta = (float) Math.Abs((sample.time - previousSample.time).TotalMilliseconds);
previousSample = sample;
if (age > _horizonMilliseconds ||
delta > _assumePointerMoveStoppedMilliseconds) {

Offset position = sample.point;
x.Add(position.dx);
y.Add(position.dy);
w.Add(1.0);
w.Add(1.0f);
time.Add(-age);
index = (index == 0 ? _historySize : index) - 1;

46
Runtime/material/arc.cs


D.assert(this.end != null);
Offset delta = this.end - this.begin;
double deltaX = delta.dx.abs();
double deltaY = delta.dy.abs();
double distanceFromAtoB = delta.distance;
float deltaX = delta.dx.abs();
float deltaY = delta.dy.abs();
float distanceFromAtoB = delta.distance;
double sweepAngle() {
return 2.0 * Math.Asin(distanceFromAtoB / (2.0 * this._radius));
float sweepAngle() {
return 2.0f * (float) Math.Asin(distanceFromAtoB / (2.0f * this._radius));
this._radius = distanceFromAtoB * distanceFromAtoB / (c - this.begin).distance / 2.0;
this._radius = distanceFromAtoB * distanceFromAtoB / (c - this.begin).distance / 2.0f;
this._endAngle = 0.0;
this._endAngle = 0.0f;
this._beginAngle = Math.PI + sweepAngle() * (this.end.dy - this.begin.dy).sign();
this._endAngle = Math.PI;
this._beginAngle = (float) (Math.PI + sweepAngle() * (this.end.dy - this.begin.dy).sign());
this._endAngle = (float) Math.PI;
this._radius = distanceFromAtoB * distanceFromAtoB / (c - this.end).distance / 2.0;
this._radius = distanceFromAtoB * distanceFromAtoB / (c - this.end).distance / 2.0f;
this._beginAngle = -Math.PI / 2.0;
this._beginAngle = -(float) Math.PI / 2.0f;
this._beginAngle = Math.PI / 2.0;
this._beginAngle = (float) Math.PI / 2.0f;
this._endAngle = this._beginAngle + sweepAngle() * (this.begin.dx - this.end.dx).sign();
}
}

}
}
double _radius;
float _radius;
public double? beginAngle {
get {

}
}
double? _beginAngle;
float? _beginAngle;
public double? endAngle {
get {

}
}
double? _endAngle;
float? _endAngle;
public new Offset begin {
get { return base.begin; }

}
}
public override Offset lerp(double t) {
public override Offset lerp(float t) {
if (this._dirty) {
this._initialze();
}

double angle = MathUtils.lerpNullableDouble(this._beginAngle, this._endAngle, t) ?? 0.0;
double x = Math.Cos(angle) * this._radius;
double y = Math.Sin(angle) * this._radius;
return this._center + new Offset(x, y);
return this._center + new Offset((float) x, (float) y);
}
public override string ToString() {

}
}
public override Rect lerp(double t) {
public override Rect lerp(float t) {
if (this._dirty) {
this._initialize();
}

}
}
public override Rect lerp(double t) {
public override Rect lerp(float t) {
if (this._dirty) {
this._initialize();
}

double width = MathUtils.lerpDouble(this.begin.width, this.end.width, t);
double height = MathUtils.lerpDouble(this.begin.height, this.end.height, t);
return Rect.fromLTWH(
center.dx - width / 2.0,
center.dy - height / 2.0,
width,
height);
(float) (center.dx - width / 2.0),
(float) (center.dy - height / 2.0),
(float) width,
(float) height);
}
public override string ToString() {

6
Runtime/material/button.cs


MaterialTapTargetSize _materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded;
shape = shape ?? new RoundedRectangleBorder();
padding = padding ?? EdgeInsets.zero;
constraints = constraints ?? new BoxConstraints(minWidth: 88.0, minHeight: 36.0);
constraints = constraints ?? new BoxConstraints(minWidth: 88.0f, minHeight: 36.0f);
TimeSpan _animationDuration = animationDuration ?? Constants.kThemeChangeDuration;
this.onPressed = onPressed;

child: new Container(
padding: this.widget.padding,
child: new Center(
widthFactor: 1.0,
heightFactor: 1.0,
widthFactor: 1.0f,
heightFactor: 1.0f,
child: this.widget.child)
)
)

6
Runtime/material/button_bar.cs


public override Widget build(BuildContext context) {
ButtonThemeData buttonTheme = ButtonTheme.of(context);
double paddingUnit = buttonTheme.padding.horizontal / 4.0;
float paddingUnit = buttonTheme.padding.horizontal / 4.0f;
List<Widget> _children = new List<Widget>();
foreach (Widget _child in this.children) {
_children.Add(

case ButtonBarLayoutBehavior.padded:
return new Padding(
padding: EdgeInsets.symmetric(
vertical: 2.0 * paddingUnit,
vertical: 2.0f * paddingUnit,
horizontal: paddingUnit
),
child: child

padding: EdgeInsets.symmetric(horizontal: paddingUnit),
constraints: new BoxConstraints(minHeight: 52.0),
constraints: new BoxConstraints(minHeight: 52.0f),
alignment: Alignment.center,
child: child
);

30
Runtime/material/button_theme.cs


Key key = null,
ButtonTextTheme textTheme = ButtonTextTheme.normal,
ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded,
double minWidth = 88.0,
double height = 36.0,
float minWidth = 88.0f,
float height = 36.0f,
EdgeInsets padding = null,
ShapeBorder shape = null,
bool alignedDropdown = false,

public class ButtonThemeData : Diagnosticable {
public ButtonThemeData(
ButtonTextTheme textTheme = ButtonTextTheme.normal,
double minWidth = 88.0,
double height = 36.0,
float minWidth = 88.0f,
float height = 36.0f,
EdgeInsets padding = null,
ShapeBorder shape = null,
ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded,

}
public readonly double minWidth;
public readonly float minWidth;
public readonly double height;
public readonly float height;
public readonly ButtonTextTheme textTheme;

switch (this.textTheme) {
case ButtonTextTheme.normal:
case ButtonTextTheme.accent:
return EdgeInsets.symmetric(horizontal: 16.0);
return EdgeInsets.symmetric(horizontal: 16.0f);
return EdgeInsets.symmetric(horizontal: 24.0);
return EdgeInsets.symmetric(horizontal: 24.0f);
}
D.assert(false);

case ButtonTextTheme.normal:
case ButtonTextTheme.accent:
return new RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2.0)));
borderRadius: BorderRadius.all(Radius.circular(2.0f)));
borderRadius: BorderRadius.all(Radius.circular(4.0)));
borderRadius: BorderRadius.all(Radius.circular(4.0f)));
}
return new RoundedRectangleBorder();

}
if (button is MaterialButtonWithIconMixin) {
return EdgeInsets.fromLTRB(12.0, 0.0, 16.0, 0.0);
return EdgeInsets.fromLTRB(12.0f, 0.0f, 16.0f, 0.0f);
}
if (this._padding != null) {

switch (this.getTextTheme(button)) {
case ButtonTextTheme.normal:
case ButtonTextTheme.accent:
return EdgeInsets.symmetric(horizontal: 16.0);
return EdgeInsets.symmetric(horizontal: 16.0f);
return EdgeInsets.symmetric(horizontal: 24.0);
return EdgeInsets.symmetric(horizontal: 24.0f);
}
D.assert(false);

public ButtonThemeData copyWith(
ButtonTextTheme? textTheme = null,
ButtonBarLayoutBehavior? layoutBehavior = null,
double? minWidth = null,
double? height = null,
float? minWidth = null,
float? height = null,
EdgeInsets padding = null,
ShapeBorder shape = null,
bool? alignedDropdown = null,

6
Runtime/material/card.cs


this.color = color;
this.elevation = elevation;
this.shape = shape;
this.margin = margin ?? EdgeInsets.all(4.0);
this.margin = margin ?? EdgeInsets.all(4.0f);
this.clipBehavior = clipBehavior;
this.child = child;
}

public override Widget build(BuildContext context) {
return new Container(
margin: this.margin ?? EdgeInsets.all(4.0),
margin: this.margin ?? EdgeInsets.all(4.0f),
borderRadius: BorderRadius.all(Radius.circular(4.0))
borderRadius: BorderRadius.all(Radius.circular(4.0f))
),
clipBehavior: this.clipBehavior,
child: this.child)

4
Runtime/material/constants.cs


public static readonly TimeSpan kTabScrollDuration = new TimeSpan(0, 0, 0, 0, 300);
public static readonly EdgeInsets kTabLabelPadding = EdgeInsets.symmetric(horizontal: 16.0);
public static readonly EdgeInsets kTabLabelPadding = EdgeInsets.symmetric(horizontal: 16.0f);
public static readonly EdgeInsets kMaterialListPadding = EdgeInsets.symmetric(vertical: 8.0);
public static readonly EdgeInsets kMaterialListPadding = EdgeInsets.symmetric(vertical: 8.0f);
}
}

12
Runtime/material/divider.cs


public class Divider : StatelessWidget {
public Divider(
Key key = null,
double height = 16.0,
double indent = 0.0,
float height = 16.0f,
float indent = 0.0f,
Color color = null) : base(key: key) {
D.assert(height >= 0.0);
this.height = height;

public readonly double height;
public readonly float height;
public readonly double indent;
public readonly float indent;
public static BorderSide createBorderSide(BuildContext context, Color color = null, double width = 0.0) {
public static BorderSide createBorderSide(BuildContext context, Color color = null, float width = 0.0f) {
return new BorderSide(
color: color ?? Theme.of(context).dividerColor,
width: width);

height: this.height,
child: new Center(
child: new Container(
height: 0.0,
height: 0.0f,
margin: EdgeInsets.only(this.indent),
decoration: new BoxDecoration(
border: new Border(

14
Runtime/material/drawer.cs


public readonly GlobalKey _drawerKey = GlobalKey.key();
double _width {
float _width {
return box.size.width;
return (float) box.size.width;
}
return DrawerUtils._kWidth;

bool _previouslyOpened = false;
void _move(DragUpdateDetails details) {
double delta = (details.primaryDelta ?? 0) / this._width;
float delta = (details.primaryDelta ?? 0) / this._width;
switch (this.widget.alignment) {
case DrawerAlignment.start:
break;

}
if (details.velocity.pixelsPerSecond.dx.abs() >= DrawerUtils._kMinFlingVelocity) {
double visualVelocity = details.velocity.pixelsPerSecond.dx / DrawerUtils._kWidth;
float visualVelocity = (float) details.velocity.pixelsPerSecond.dx / DrawerUtils._kWidth;
switch (this.widget.alignment) {
case DrawerAlignment.start:
break;

}
public void open() {
this._controller.fling(velocity: 1.0);
this._controller.fling(velocity: 1.0f);
if (this.widget.drawerCallback != null) {
this.widget.drawerCallback(true);
}

this._controller.fling(velocity: -1.0);
this._controller.fling(velocity: -1.0f);
if (this.widget.drawerCallback != null) {
this.widget.drawerCallback(false);
}

onHorizontalDragUpdate: this._move,
onHorizontalDragEnd: this._settle,
behavior: HitTestBehavior.translucent,
child: new Container(width: dragAreaWidth)
child: new Container(width: (float) dragAreaWidth)
)
);
}

6
Runtime/material/drawer_header.cs


) : base(key: key) {
D.assert(child != null);
this.decoration = decoration;
this.margin = margin ?? EdgeInsets.only(bottom: 8.0);
this.padding = padding ?? EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0);
this.margin = margin ?? EdgeInsets.only(bottom: 8.0f);
this.padding = padding ?? EdgeInsets.fromLTRB(16.0f, 16.0f, 16.0f, 8.0f);
this.duration = duration ?? new TimeSpan(0, 0, 0, 0, 250);
this.curve = curve ?? Curves.fastOutSlowIn;
this.child = child;

public override Widget build(BuildContext context) {
D.assert(MaterialDebug.debugCheckHasMaterial(context));
ThemeData theme = Theme.of(context);
double statusBarHeight = MediaQuery.of(context).padding.top;
float statusBarHeight = MediaQuery.of(context).padding.top;
return new Container(
height: statusBarHeight + DrawerHeaderUtils._kDrawerHeaderHeight,
margin: this.margin,

10
Runtime/material/expand_icon.cs


this.isExpanded = isExpanded;
this.size = size;
this.onPressed = onPressed;
this.padding = padding ?? EdgeInsets.all(8.0);
this.padding = padding ?? EdgeInsets.all(8.0f);
}
public readonly bool isExpanded;

public class _ExpandIconState : SingleTickerProviderStateMixin<ExpandIcon> {
AnimationController _controller;
Animation<double> _iconTurns;
Animation<float> _iconTurns;
static readonly Animatable<double> _iconTurnTween =
new DoubleTween(begin: 0.0, end: 0.5).chain(new CurveTween(curve: Curves.fastOutSlowIn));
static readonly Animatable<float> _iconTurnTween =
new FloatTween(begin: 0.0f, end: 0.5f).chain(new CurveTween(curve: Curves.fastOutSlowIn));
public override void initState() {
base.initState();

this._controller.setValue(Math.PI);
this._controller.setValue((float) Math.PI);
}
}

8
Runtime/material/expansion_panel.cs


margin: EdgeInsets.fromLTRB(0, 0, 8, 0),
child: new ExpandIcon(
isExpanded: this._isChildExpanded(index),
padding: EdgeInsets.all(16.0),
padding: EdgeInsets.all(16.0f),
onPressed: (bool isExpanded) => this._handlePressed(isExpanded, expandIndex)
)
)

children: new List<Widget> {
header,
new AnimatedCrossFade(
firstChild: new Container(height: 0.0),
firstChild: new Container(height: 0.0f),
firstCurve: new Interval(0.0, 0.6, curve: Curves.fastOutSlowIn),
secondCurve: new Interval(0.4, 1.0, curve: Curves.fastOutSlowIn),
firstCurve: new Interval(0.0f, 0.6f, curve: Curves.fastOutSlowIn),
secondCurve: new Interval(0.4f, 1.0f, curve: Curves.fastOutSlowIn),
sizeCurve: Curves.fastOutSlowIn,
crossFadeState: this._isChildExpanded(index)
? CrossFadeState.showSecond

12
Runtime/material/expansion_tile.cs


}
public class _ExpansionTileState : SingleTickerProviderStateMixin<ExpansionTile> {
static readonly Animatable<double> _easeOutTween = new CurveTween(curve: Curves.easeOut);
static readonly Animatable<double> _easeInTween = new CurveTween(curve: Curves.easeIn);
static readonly Animatable<double> _halfTween = new DoubleTween(begin: 0.0, end: 0.5);
static readonly Animatable<float> _easeOutTween = new CurveTween(curve: Curves.easeOut);
static readonly Animatable<float> _easeInTween = new CurveTween(curve: Curves.easeIn);
static readonly Animatable<float> _halfTween = new FloatTween(begin: 0.0f, end: 0.5f);
readonly ColorTween _borderColorTween = new ColorTween();
readonly ColorTween _headerColorTween = new ColorTween();

AnimationController _controller;
Animation<double> _iconTurns;
Animation<double> _heightFactor;
Animation<float> _iconTurns;
Animation<float> _heightFactor;
Animation<Color> _borderColor;
Animation<Color> _headerColor;
Animation<Color> _iconColor;

: (bool) PageStorage.of(this.context)?.readState(this.context);
if (this._isExpanded) {
this._controller.setValue(1.0);
this._controller.setValue(1.0f);
}
}

2
Runtime/material/flat_button.cs


mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
icon,
new SizedBox(width: 8.0),
new SizedBox(width: 8.0f),
label
}
)) {

12
Runtime/material/grid_tile.cs


};
if (this.header != null) {
children.Add(new Positioned(
top: 0.0,
left: 0.0,
right: 0.0,
top: 0.0f,
left: 0.0f,
right: 0.0f,
left: 0.0,
bottom: 0.0,
right: 0.0,
left: 0.0f,
bottom: 0.0f,
right: 0.0f,
child: this.footer));
}

10
Runtime/material/icon_button.cs


public class IconButton : StatelessWidget {
public IconButton(
Key key = null,
double iconSize = 24.0,
float iconSize = 24.0f,
EdgeInsets padding = null,
Alignment alignment = null,
Widget icon = null,

D.assert(icon != null);
this.iconSize = iconSize;
this.padding = padding ?? EdgeInsets.all(8.0);
this.padding = padding ?? EdgeInsets.all(8.0f);
this.alignment = alignment ?? Alignment.center;
this.icon = icon;
this.color = color;

this.tooltip = tooltip;
}
public readonly double iconSize;
public readonly float iconSize;
public readonly EdgeInsets padding;

child: result,
highlightColor: this.highlightColor ?? Theme.of(context).highlightColor,
splashColor: this.splashColor ?? Theme.of(context).splashColor,
radius: Math.Max(
radius: (float) Math.Max(
(this.iconSize + Math.Min(this.padding.horizontal, this.padding.vertical)) * 0.7)
(this.iconSize + Math.Min(this.padding.horizontal, this.padding.vertical)) * 0.7f)
);
}

12
Runtime/material/ink_decoration.cs


EdgeInsets padding = null,
Color color = null,
Decoration decoration = null,
double? width = null,
double? height = null,
float? width = null,
float? height = null,
Widget child = null) : base(key: key) {
D.assert(padding == null || padding.isNonNegative);
D.assert(decoration == null || decoration.debugAssertIsValid());

Alignment alignment = null,
Rect centerSlice = null,
ImageRepeat repeat = ImageRepeat.noRepeat,
double? width = null,
double? height = null,
float? width = null,
float? height = null,
Widget child = null
) {
D.assert(padding == null || padding.isNonNegative);

public readonly Decoration decoration;
public readonly double? width;
public readonly float? width;
public readonly double? height;
public readonly float? height;
public EdgeInsets _paddingIncludingDecoration {
get {

28
Runtime/material/ink_ripple.cs


RectCallback rectCallback = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null,
double? radius = null,
float? radius = null,
VoidCallback onRemoved = null
) {
D.assert(controller != null);

RectCallback rectCallback = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null,
double? radius = null,
float? radius = null,
VoidCallback onRemoved = null
) : base(
controller: controller,

vsync: controller.vsync);
this._radiusController.addListener(controller.markNeedsPaint);
this._radiusController.forward();
this._radius = this._radiusController.drive(new DoubleTween(
begin: this._targetRadius * 0.30,
end: this._targetRadius + 5.0
this._radius = this._radiusController.drive(new FloatTween(
begin: this._targetRadius * 0.30f,
end: this._targetRadius + 5.0f
).chain(_easeCurveTween)
);

readonly ShapeBorder _customBorder;
readonly double _targetRadius;
readonly float _targetRadius;
Animation<double> _radius;
Animation<float> _radius;
AnimationController _radiusController;
Animation<int> _fadeIn;

public static InteractiveInkFeatureFactory splashFactory = new _InkRippleFactory();
static readonly Animatable<double> _easeCurveTween = new CurveTween(curve: Curves.ease);
static readonly Animatable<float> _easeCurveTween = new CurveTween(curve: Curves.ease);
static readonly Animatable<double> _fadeOutIntervalTween =
new CurveTween(curve: new Interval(InkRippleUtils._kFadeOutIntervalStart, 1.0));
static readonly Animatable<float> _fadeOutIntervalTween =
new CurveTween(curve: new Interval(InkRippleUtils._kFadeOutIntervalStart, 1.0f));
this._fadeOutController.animateTo(1.0, duration: InkRippleUtils._kFadeOutDuration);
this._fadeOutController.animateTo(1.0f, duration: InkRippleUtils._kFadeOutDuration);
double fadeOutValue = 1.0 - this._fadeInController.value;
float fadeOutValue = 1.0f - this._fadeInController.value;
this._fadeOutController.animateTo(1.0, duration: InkRippleUtils._kCancelDuration);
this._fadeOutController.animateTo(1.0f, duration: InkRippleUtils._kCancelDuration);
}
}

canvas.concat(transform);
}
else {
canvas.translate(originOffset.dx, originOffset.dy);
canvas.translate((float) originOffset.dx, (float) originOffset.dy);
}
if (this._clipCallback != null) {

8
Runtime/material/ink_splash.cs


RectCallback rectCallback = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null,
double? radius = null,
float? radius = null,
VoidCallback onRemoved = null
) {
D.assert(controller != null);

RectCallback rectCallback = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null,
double? radius = null,
float? radius = null,
VoidCallback onRemoved = null
) : base(
controller: controller,

readonly ShapeBorder _customBorder;
readonly double _targetRadius;
readonly float _targetRadius;
readonly RectCallback _clipCallback;

canvas.concat(transform);
}
else {
canvas.translate(originOffset.dx, originOffset.dy);
canvas.translate((float) originOffset.dx, (float) originOffset.dy);
}
if (this._clipCallback != null) {

8
Runtime/material/ink_well.cs


RectCallback rectCallback = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null,
double? radius = null,
float? radius = null,
VoidCallback onRemoved = null);
}

ValueChanged<bool> onHighlightChanged = null,
bool containedInkWell = false,
BoxShape highlightShape = BoxShape.circle,
double? radius = null,
float? radius = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null,
Color highlightColor = null,

public readonly BoxShape highlightShape;
public readonly double? radius;
public readonly float? radius;
public readonly BorderRadius borderRadius;

Color highlightColor = null,
Color splashColor = null,
InteractiveInkFeatureFactory splashFactory = null,
double? radius = null,
float? radius = null,
BorderRadius borderRadius = null,
ShapeBorder customBorder = null
) : base(

80
Runtime/material/list_tile.cs


Color color = this._textColor(theme, tileTheme, style.color);
return this._isDenseLayout(tileTheme)
? style.copyWith(fontSize: 13.0, color: color)
? style.copyWith(fontSize: 13.0f, color: color)
: style.copyWith(color: color);
}

return this._isDenseLayout(tileTheme)
? style.copyWith(color: color, fontSize: 12.0)
? style.copyWith(color: color, fontSize: 12.0f)
: style.copyWith(color: color);
}

child: this.trailing);
}
EdgeInsets _defaultContentPadding = EdgeInsets.symmetric(horizontal: 16.0);
EdgeInsets _defaultContentPadding = EdgeInsets.symmetric(horizontal: 16.0f);
EdgeInsets resolvedContentPadding =
this.contentPadding ?? tileTheme?.contentPadding ?? _defaultContentPadding;

this._subtitleBaselineType = subtitleBaselineType;
}
const double _minLeadingWidth = 40.0;
const float _minLeadingWidth = 40.0f;
const double _horizontalTitleGap = 16.0;
const float _horizontalTitleGap = 16.0f;
const double _minVerticalPadding = 4.0;
const float _minVerticalPadding = 4.0f;
public readonly Dictionary<_ListTileSlot, RenderBox> slotToChild = new Dictionary<_ListTileSlot, RenderBox>();
public readonly Dictionary<RenderBox, _ListTileSlot> childToSlot = new Dictionary<RenderBox, _ListTileSlot>();

get { return false; }
}
static double _minWidth(RenderBox box, double height) {
return box == null ? 0.0 : box.getMinIntrinsicWidth(height);
static float _minWidth(RenderBox box, float height) {
return box == null ? 0.0f : box.getMinIntrinsicWidth(height);
static double _maxWidth(RenderBox box, double height) {
return box == null ? 0.0 : box.getMaxIntrinsicWidth(height);
static float _maxWidth(RenderBox box, float height) {
return box == null ? 0.0f : box.getMaxIntrinsicWidth(height);
protected override double computeMinIntrinsicWidth(double height) {
double leadingWidth = this.leading != null
? Math.Max(this.leading.getMinIntrinsicWidth(height), _minLeadingWidth) + _horizontalTitleGap
: 0.0;
return leadingWidth + Math.Max(_minWidth(this.title, height), _minWidth(this.subtitle, height)) +
protected override float computeMinIntrinsicWidth(float height) {
float leadingWidth = this.leading != null
? (float) Math.Max(this.leading.getMinIntrinsicWidth(height), _minLeadingWidth) + _horizontalTitleGap
: 0.0f;
return leadingWidth + (float) Math.Max(_minWidth(this.title, height), _minWidth(this.subtitle, height)) +
protected override double computeMaxIntrinsicWidth(double height) {
double leadingWidth = this.leading != null
? Math.Max(this.leading.getMaxIntrinsicWidth(height), _minLeadingWidth) + _horizontalTitleGap
: 0.0;
return leadingWidth + Math.Max(_maxWidth(this.title, height), _maxWidth(this.subtitle, height)) +
protected override float computeMaxIntrinsicWidth(float height) {
float leadingWidth = this.leading != null
? (float) Math.Max(this.leading.getMaxIntrinsicWidth(height), _minLeadingWidth) + _horizontalTitleGap
: 0.0f;
return leadingWidth + (float) Math.Max(_maxWidth(this.title, height), _maxWidth(this.subtitle, height)) +
double _defaultTileHeight {
float _defaultTileHeight {
get {
bool hasSubtitle = this.subtitle != null;
bool isTwoLine = !this.isThreeLine && hasSubtitle;

return this.isDense ? 48.0 : 56.0;
return this.isDense ? 48.0f : 56.0f;
return this.isDense ? 64.0 : 72.0;
return this.isDense ? 64.0f : 72.0f;
return this.isDense ? 76.0 : 88.0;
return this.isDense ? 76.0f : 88.0f;
protected override double computeMinIntrinsicHeight(double width) {
return Math.Max(
protected override float computeMinIntrinsicHeight(float width) {
return (float) Math.Max(
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
D.assert(this.title != null);
BoxParentData parentData = (BoxParentData) this.title.parentData;
return parentData.offset.dy + this.title.getDistanceToActualBaseline(baseline);

bool isOneLine = !this.isThreeLine && !hasSubtitle;
BoxConstraints looseConstraints = this.constraints.loosen();
double tileWidth = looseConstraints.maxWidth;
float tileWidth = looseConstraints.maxWidth;
double titleStart = hasLeading ? Math.Max(_minLeadingWidth, leadingSize.width) + _horizontalTitleGap : 0.0;
float titleStart = hasLeading
? (float) Math.Max(_minLeadingWidth, leadingSize.width) + _horizontalTitleGap
: 0.0f;
width: tileWidth - titleStart - (hasTrailing ? trailingSize.width + _horizontalTitleGap : 0.0));
width: tileWidth - titleStart - (hasTrailing ? trailingSize.width + _horizontalTitleGap : 0.0f));
Size titleSize = _layoutBox(this.title, textConstraints);
Size subtitleSize = _layoutBox(this.subtitle, textConstraints);

D.assert(isOneLine);
}
double tileHeight = 0.0;
float tileHeight = 0.0f;
tileHeight = Math.Max(this._defaultTileHeight, titleSize.height + 2.0 * _minVerticalPadding);
tileHeight = (float) Math.Max(this._defaultTileHeight, titleSize.height + 2.0 * _minVerticalPadding);
titleY = (tileHeight - titleSize.height) / 2.0;
}
else {

if (titleY < _minVerticalPadding ||
(subtitleY + subtitleSize.height + _minVerticalPadding) > tileHeight) {
tileHeight = titleSize.height + subtitleSize.height + 2.0 * _minVerticalPadding;
tileHeight = titleSize.height + subtitleSize.height + 2.0f * _minVerticalPadding;
titleY = _minVerticalPadding;
subtitleY = titleSize.height + _minVerticalPadding;
}

double trailingY = (tileHeight - trailingSize.height) / 2.0;
if (hasLeading) {
_positionBox(this.leading, new Offset(0.0, leadingY));
_positionBox(this.leading, new Offset(0.0f, (float) leadingY));
_positionBox(this.title, new Offset(titleStart, titleY));
_positionBox(this.title, new Offset((float) titleStart, (float) titleY));
_positionBox(this.subtitle, new Offset(titleStart, subtitleY));
_positionBox(this.subtitle, new Offset((float) titleStart, (float) subtitleY));
_positionBox(this.trailing, new Offset(tileWidth - trailingSize.width, trailingY));
_positionBox(this.trailing, new Offset((float) tileWidth - trailingSize.width, (float) trailingY));
this.size = this.constraints.constrain(new Size(tileWidth, tileHeight));
this.size = this.constraints.constrain(new Size((float) tileWidth, (float) tileHeight));
D.assert(this.size.width == this.constraints.constrainWidth(tileWidth));
D.assert(this.size.height == this.constraints.constrainHeight(tileHeight));
}

6
Runtime/material/material.cs


properties.add(new EnumProperty<BorderRadius>("borderRadius", this.borderRadius, defaultValue: null));
}
public const double defaultSplashRadius = 35.0;
public const float defaultSplashRadius = 35.0f;
}

if (this._inkFeatures != null && this._inkFeatures.isNotEmpty()) {
Canvas canvas = context.canvas;
canvas.save();
canvas.translate(offset.dx, offset.dy);
canvas.translate((float) offset.dx, (float) offset.dy);
canvas.clipRect(Offset.zero & this.size);
foreach (InkFeature inkFeature in this._inkFeatures) {
inkFeature._paint(canvas);

ShapeBorder end = null) : base(begin: begin, end: end) {
}
public override ShapeBorder lerp(double t) {
public override ShapeBorder lerp(float t) {
return ShapeBorder.lerp(this.begin, this.end, t);
}
}

14
Runtime/material/material_button.cs


Color highlightColor = null,
Color splashColor = null,
Brightness? colorBrightness = null,
double? elevation = null,
double? highlightElevation = null,
double? disabledElevation = null,
float? elevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
double? minWidth = null,
double? height = null,
float? minWidth = null,
float? height = null,
Widget child = null
) : base(key: key) {
this.onPressed = onPressed;

public readonly MaterialTapTargetSize? materialTapTargetSize;
public readonly double? minWidth;
public readonly float? minWidth;
public readonly double? height;
public readonly float? height;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);

36
Runtime/material/mergeable_material.cs


public class MaterialGap : MergeableMaterialItem {
public MaterialGap(
LocalKey key = null,
double size = 16.0) : base(key: key) {
float size = 16.0f) : base(key: key) {
public readonly double size;
public readonly float size;
public override string ToString() {
return "MaterialGap(key: " + this.key + ", child: " + this.size + ")";

CurvedAnimation startAnimation = null,
CurvedAnimation endAnimation = null,
CurvedAnimation gapAnimation = null,
double gapStart = 0.0) {
float gapStart = 0.0f) {
this.controller = controller;
this.startAnimation = startAnimation;
this.endAnimation = endAnimation;

public readonly CurvedAnimation gapAnimation;
public double gapStart;
public float gapStart;
}

for (int i = 0; i < this._children.Count; i++) {
if (this._children[i] is MaterialGap) {
this._initGap((MaterialGap) this._children[i]);
this._animationTuples[this._children[i].key].controller.setValue(1.0);
this._animationTuples[this._children[i].key].controller.setValue(1.0f);
}
}

if (newLength > 0) {
if (oldLength > 1 || oldLength == 1 && this._children[startOld] is MaterialSlice) {
if (newLength == 1 && newChildren[startNew] is MaterialGap) {
double gapSizeSum = 0.0;
float gapSizeSum = 0.0f;
while (startOld < j) {
if (this._children[startOld] is MaterialGap) {

this._animationTuples[newChildren[startNew].key].controller.forward();
}
else {
double gapSize = this._getGapSize(startOld);
float gapSize = this._getGapSize(startOld);
this._removeChild(startOld);

j += (newLength - 1);
double gapSizeSum = 0.0;
float gapSizeSum = 0.0f;
for (int k = startNew; k < i; k++) {
if (newChildren[k] is MaterialGap) {

MaterialGap gap = (MaterialGap) newChildren[k];
this._animationTuples[gap.key].gapStart = gapSize * gap.size / gapSizeSum;
this._animationTuples[gap.key].controller.setValue(0.0);
this._animationTuples[gap.key].controller.setValue(0.0f);
this._animationTuples[gap.key].controller.forward();
}
}

}
else {
if (oldLength > 1 || oldLength == 1 && this._children[startOld] is MaterialSlice) {
double gapSizeSum = 0.0;
float gapSizeSum = 0.0f;
while (startOld < j) {
if (this._children[startOld] is MaterialGap) {

if (gapSizeSum != 0.0) {
MaterialGap gap = new MaterialGap(key: new UniqueKey(), size: gapSizeSum);
this._insertChild(startOld, gap);
this._animationTuples[gap.key].gapStart = 0.0;
this._animationTuples[gap.key].controller.setValue(1.0);
this._animationTuples[gap.key].gapStart = 0.0f;
this._animationTuples[gap.key].controller.setValue(1.0f);
this._animationTuples[gap.key].controller.reverse();
j++;
}

this._animationTuples[gap.key].gapStart = 0.0;
this._animationTuples[gap.key].gapStart = 0.0f;
this._animationTuples[gap.key].controller.reverse();
}
}

}
double _getGapSize(int index) {
float _getGapSize(int index) {
return MathUtils.lerpDouble(this._animationTuples[gap.key].gapStart,
return MathUtils.lerpFloat(this._animationTuples[gap.key].gapStart,
gap.size,
this._animationTuples[gap.key].gapAnimation.value);
}

slices = new List<Widget>();
widgets.Add(
new SizedBox(
width: this.widget.mainAxis == Axis.horizontal ? this._getGapSize(i) : (double?) null,
height: this.widget.mainAxis == Axis.vertical ? this._getGapSize(i) : (double?) null)
width: this.widget.mainAxis == Axis.horizontal ? this._getGapSize(i) : (float?) null,
height: this.widget.mainAxis == Axis.vertical ? this._getGapSize(i) : (float?) null)
);
}
else {

Border border;
BorderSide divider = Divider.createBorderSide(
context,
width: 0.5
width: 0.5f
);
if (i == 0) {

20
Runtime/material/raised_button.cs


Color highlightColor = null,
Color splashColor = null,
Brightness? colorBrightness = null,
double? elevation = null,
double? highlightElevation = null,
double? disabledElevation = null,
float? elevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
EdgeInsets padding = null,
ShapeBorder shape = null,
Clip? clipBehavior = Clip.none,

Color highlightColor = null,
Color splashColor = null,
Brightness? colorBrightness = null,
double? elevation = null,
double? highlightElevation = null,
double? disabledElevation = null,
float? elevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
EdgeInsets padding = null,
ShapeBorder shape = null,
Clip? clipBehavior = null,

Color highlightColor = null,
Color splashColor = null,
Brightness? colorBrightness = null,
double? elevation = null,
double? highlightElevation = null,
double? disabledElevation = null,
float? elevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
EdgeInsets padding = null,
ShapeBorder shape = null,
Clip? clipBehavior = Clip.none,

mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
icon,
new SizedBox(width: 8.0),
new SizedBox(width: 8.0f),
label
}
)) {

2
Runtime/material/scrollbar.cs


public Color _themeColor;
public AnimationController _fadeoutAnimationController;
public Animation<double> _FadeoutOpacityAnimation;
public Animation<float> _FadeoutOpacityAnimation;
public Timer _fadeoutTimer;
public override void initState() {

60
Runtime/material/shadows.cs


new Dictionary<int, List<BoxShadow>> {
{
1, new List<BoxShadow> {
new BoxShadow(offset: new Offset(0.0, 2.0), blurRadius: 1.0, spreadRadius: -1.0,
new BoxShadow(offset: new Offset(0.0f, 2.0f), blurRadius: 1.0f, spreadRadius: -1.0f,
new BoxShadow(offset: new Offset(0.0, 1.0), blurRadius: 1.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 1.0f), blurRadius: 1.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 1.0), blurRadius: 3.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 1.0f), blurRadius: 3.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 3.0), blurRadius: 1.0, spreadRadius: -2.0,
new BoxShadow(offset: new Offset(0.0f, 3.0f), blurRadius: 1.0f, spreadRadius: -2.0f,
new BoxShadow(offset: new Offset(0.0, 2.0), blurRadius: 2.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 2.0f), blurRadius: 2.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 1.0), blurRadius: 5.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 1.0f), blurRadius: 5.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 3.0), blurRadius: 3.0, spreadRadius: -2.0,
new BoxShadow(offset: new Offset(0.0f, 3.0f), blurRadius: 3.0f, spreadRadius: -2.0f,
new BoxShadow(offset: new Offset(0.0, 3.0), blurRadius: 4.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 3.0f), blurRadius: 4.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 1.0), blurRadius: 8.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 1.0f), blurRadius: 8.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 2.0), blurRadius: 4.0, spreadRadius: -1.0,
new BoxShadow(offset: new Offset(0.0f, 2.0f), blurRadius: 4.0f, spreadRadius: -1.0f,
new BoxShadow(offset: new Offset(0.0, 4.0), blurRadius: 5.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 4.0f), blurRadius: 5.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 1.0), blurRadius: 10.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 1.0f), blurRadius: 10.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 3.0), blurRadius: 5.0, spreadRadius: -1.0,
new BoxShadow(offset: new Offset(0.0f, 3.0f), blurRadius: 5.0f, spreadRadius: -1.0f,
new BoxShadow(offset: new Offset(0.0, 6.0), blurRadius: 10.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 6.0f), blurRadius: 10.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 1.0), blurRadius: 18.0, spreadRadius: 0.0,
new BoxShadow(offset: new Offset(0.0f, 1.0f), blurRadius: 18.0f, spreadRadius: 0.0f,
new BoxShadow(offset: new Offset(0.0, 5.0), blurRadius: 5.0, spreadRadius: -3.0,
new BoxShadow(offset: new Offset(0.0f, 5.0f), blurRadius: 5.0f, spreadRadius: -3.0f,
new BoxShadow(offset: new Offset(0.0, 8.0), blurRadius: 10.0, spreadRadius: 1.0,
new BoxShadow(offset: new Offset(0.0f, 8.0f), blurRadius: 10.0f, spreadRadius: 1.0f,
new BoxShadow(offset: new Offset(0.0, 3.0), blurRadius: 14.0, spreadRadius: 2.0,
new BoxShadow(offset: new Offset(0.0f, 3.0f), blurRadius: 14.0f, spreadRadius: 2.0f,
new BoxShadow(offset: new Offset(0.0, 5.0), blurRadius: 6.0, spreadRadius: -3.0,
new BoxShadow(offset: new Offset(0.0f, 5.0f), blurRadius: 6.0f, spreadRadius: -3.0f,
new BoxShadow(offset: new Offset(0.0, 9.0), blurRadius: 12.0, spreadRadius: 1.0,
new BoxShadow(offset: new Offset(0.0f, 9.0f), blurRadius: 12.0f, spreadRadius: 1.0f,
new BoxShadow(offset: new Offset(0.0, 3.0), blurRadius: 16.0, spreadRadius: 2.0,
new BoxShadow(offset: new Offset(0.0f, 3.0f), blurRadius: 16.0f, spreadRadius: 2.0f,
new BoxShadow(offset: new Offset(0.0, 7.0), blurRadius: 8.0, spreadRadius: -4.0,
new BoxShadow(offset: new Offset(0.0f, 7.0f), blurRadius: 8.0f, spreadRadius: -4.0f,
new BoxShadow(offset: new Offset(0.0, 12.0), blurRadius: 17.0, spreadRadius: 2.0,
new BoxShadow(offset: new Offset(0.0f, 12.0f), blurRadius: 17.0f, spreadRadius: 2.0f,
new BoxShadow(offset: new Offset(0.0, 5.0), blurRadius: 22.0, spreadRadius: 4.0,
new BoxShadow(offset: new Offset(0.0f, 5.0f), blurRadius: 22.0f, spreadRadius: 4.0f,
new BoxShadow(offset: new Offset(0.0, 8.0), blurRadius: 10.0, spreadRadius: -5.0,
new BoxShadow(offset: new Offset(0.0f, 8.0f), blurRadius: 10.0f, spreadRadius: -5.0f,
new BoxShadow(offset: new Offset(0.0, 16.0), blurRadius: 24.0, spreadRadius: 2.0,
new BoxShadow(offset: new Offset(0.0f, 16.0f), blurRadius: 24.0f, spreadRadius: 2.0f,
new BoxShadow(offset: new Offset(0.0, 6.0), blurRadius: 30.0, spreadRadius: 5.0,
new BoxShadow(offset: new Offset(0.0f, 6.0f), blurRadius: 30.0f, spreadRadius: 5.0f,
new BoxShadow(offset: new Offset(0.0, 11.0), blurRadius: 15.0, spreadRadius: -7.0,
new BoxShadow(offset: new Offset(0.0f, 11.0f), blurRadius: 15.0f, spreadRadius: -7.0f,
new BoxShadow(offset: new Offset(0.0, 24.0), blurRadius: 38.0, spreadRadius: 3.0,
new BoxShadow(offset: new Offset(0.0f, 24.0f), blurRadius: 38.0f, spreadRadius: 3.0f,
new BoxShadow(offset: new Offset(0.0, 9.0), blurRadius: 46.0, spreadRadius: 8.0,
new BoxShadow(offset: new Offset(0.0f, 9.0f), blurRadius: 46.0f, spreadRadius: 8.0f,
color: _kAmbientShadowOpacity)
}
}

16
Runtime/material/text_selection.cs


return new Container(
color: new Color(0xFFEFEFEF),
height: 44.0, child: new Row(mainAxisSize: MainAxisSize.min, children: items));
height: 44.0f, child: new Row(mainAxisSize: MainAxisSize.min, children: items));
}
}

y = this.screenSize.height - childSize.height - _TextSelectionUtils._kToolbarScreenPadding;
}
return new Offset(x, y);
return new Offset((float) x, (float) y);
}
public override bool shouldRelayout(SingleChildLayoutDelegate oldDelegate) {

Paint paint = new Paint();
paint.color = this.color;
double radius = size.width / 2.0;
canvas.drawCircle(new Offset(radius, radius), radius, paint);
canvas.drawRect(Rect.fromLTWH(0.0, 0.0, radius, radius), paint);
canvas.drawCircle(new Offset((float) radius, (float) radius), radius, paint);
canvas.drawRect(Rect.fromLTWH(0.0f, 0.0f, (float) radius, (float) radius), paint);
}

class _MaterialTextSelectionControls : TextSelectionControls {
public override Size handleSize {
get {
return new Size(_TextSelectionUtils._kHandleSize,
_TextSelectionUtils._kHandleSize);
return new Size((float) _TextSelectionUtils._kHandleSize,
(float) _TextSelectionUtils._kHandleSize);
}
}

public override Widget buildHandle(BuildContext context, TextSelectionHandleType type, double textLineHeight) {
Widget handle = new Padding(
padding: EdgeInsets.only(right: 26.0, bottom: 26.0),
padding: EdgeInsets.only(right: 26.0f, bottom: 26.0f),
child: new SizedBox(
width: 20,
height: 20,

Widget child = null
) : base(key: key) {
this.onPressed = onPressed;
this.padding = padding ?? EdgeInsets.all(8.0);
this.padding = padding ?? EdgeInsets.all(8.0f);
this.backgroundColor = backgroundColor ?? new Color(0);
this.child = child;
}

6
Runtime/material/text_theme.cs


public TextTheme apply(
string fontFamily = null,
double fontSizeFactor = 1.0,
double fontSizeDelta = 0.0,
float fontSizeFactor = 1.0f,
float fontSizeDelta = 0.0f,
Color displayColor = null,
Color bodyColor = null,
TextDecoration decoration = null,

);
}
public static TextTheme lerp(TextTheme a, TextTheme b, double t) {
public static TextTheme lerp(TextTheme a, TextTheme b, float t) {
D.assert(a != null);
D.assert(b != null);
return new TextTheme(

2
Runtime/material/theme.cs


) : base(begin: begin, end: end) {
}
public override ThemeData lerp(double t) {
public override ThemeData lerp(float t) {
return ThemeData.lerp(this.begin, this.end, t);
}
}

2
Runtime/material/theme_data.cs


return Brightness.dark;
}
public static ThemeData lerp(ThemeData a, ThemeData b, double t) {
public static ThemeData lerp(ThemeData a, ThemeData b, float t) {
D.assert(a != null);
D.assert(b != null);
return raw(

30
Runtime/material/tooltip.cs


public Tooltip(
Key key = null,
string message = null,
double height = 32.0,
float height = 32.0f,
double verticalOffset = 24.0,
float verticalOffset = 24.0f,
bool preferBelow = true,
Widget child = null
) : base(key: key) {

this.padding = padding ?? EdgeInsets.symmetric(horizontal: 16.0);
this.padding = padding ?? EdgeInsets.symmetric(horizontal: 16.0f);
this.verticalOffset = verticalOffset;
this.preferBelow = preferBelow;
this.child = child;

public readonly string message;
public readonly double height;
public readonly float height;
public readonly double verticalOffset;
public readonly float verticalOffset;
public readonly bool preferBelow;

public _TooltipOverlay(
Key key = null,
string message = null,
double? height = null,
float? height = null,
Animation<double> animation = null,
Animation<float> animation = null,
double? verticalOffset = null,
float? verticalOffset = null,
bool? preferBelow = null
) : base(key: key) {
this.message = message;

public readonly string message;
public readonly double? height;
public readonly float? height;
public readonly Animation<double> animation;
public readonly Animation<float> animation;
public readonly double? verticalOffset;
public readonly float? verticalOffset;
public readonly bool? preferBelow;

child: new Opacity(
opacity: 0.9,
child: new ConstrainedBox(
constraints: new BoxConstraints(minHeight: this.height ?? 0.0),
constraints: new BoxConstraints(minHeight: this.height ?? 0.0f),
borderRadius: BorderRadius.circular(2.0)),
borderRadius: BorderRadius.circular(2.0f)),
widthFactor: 1.0,
heightFactor: 1.0,
widthFactor: 1.0f,
heightFactor: 1.0f,
child: new Text(this.message, style: darkTheme.textTheme.body1)
)
)

188
Runtime/material/typography.cs


tall: tall ?? this.tall);
}
public static Typography lerp(Typography a, Typography b, double t) {
public static Typography lerp(Typography a, Typography b, float t) {
return new Typography(
black: TextTheme.lerp(a.black, b.black, t),
white: TextTheme.lerp(a.white, b.white, t),

public static readonly TextTheme englishLike2014 = new TextTheme(
display4: new TextStyle(debugLabel: "englishLike display4 2014", inherit: false, fontSize: 112.0,
display4: new TextStyle(debugLabel: "englishLike display4 2014", inherit: false, fontSize: 112.0f,
display3: new TextStyle(debugLabel: "englishLike display3 2014", inherit: false, fontSize: 56.0,
display3: new TextStyle(debugLabel: "englishLike display3 2014", inherit: false, fontSize: 56.0f,
display2: new TextStyle(debugLabel: "englishLike display2 2014", inherit: false, fontSize: 45.0,
display2: new TextStyle(debugLabel: "englishLike display2 2014", inherit: false, fontSize: 45.0f,
display1: new TextStyle(debugLabel: "englishLike display1 2014", inherit: false, fontSize: 34.0,
display1: new TextStyle(debugLabel: "englishLike display1 2014", inherit: false, fontSize: 34.0f,
headline: new TextStyle(debugLabel: "englishLike headline 2014", inherit: false, fontSize: 24.0,
headline: new TextStyle(debugLabel: "englishLike headline 2014", inherit: false, fontSize: 24.0f,
title: new TextStyle(debugLabel: "englishLike title 2014", inherit: false, fontSize: 20.0,
title: new TextStyle(debugLabel: "englishLike title 2014", inherit: false, fontSize: 20.0f,
subhead: new TextStyle(debugLabel: "englishLike subhead 2014", inherit: false, fontSize: 16.0,
subhead: new TextStyle(debugLabel: "englishLike subhead 2014", inherit: false, fontSize: 16.0f,
body2: new TextStyle(debugLabel: "englishLike body2 2014", inherit: false, fontSize: 14.0,
body2: new TextStyle(debugLabel: "englishLike body2 2014", inherit: false, fontSize: 14.0f,
body1: new TextStyle(debugLabel: "englishLike body1 2014", inherit: false, fontSize: 14.0,
body1: new TextStyle(debugLabel: "englishLike body1 2014", inherit: false, fontSize: 14.0f,
caption: new TextStyle(debugLabel: "englishLike caption 2014", inherit: false, fontSize: 12.0,
caption: new TextStyle(debugLabel: "englishLike caption 2014", inherit: false, fontSize: 12.0f,
button: new TextStyle(debugLabel: "englishLike button 2014", inherit: false, fontSize: 14.0,
button: new TextStyle(debugLabel: "englishLike button 2014", inherit: false, fontSize: 14.0f,
subtitle: new TextStyle(debugLabel: "englishLike subtitle 2014", inherit: false, fontSize: 14.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1),
overline: new TextStyle(debugLabel: "englishLike overline 2014", inherit: false, fontSize: 10.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5)
subtitle: new TextStyle(debugLabel: "englishLike subtitle 2014", inherit: false, fontSize: 14.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1f),
overline: new TextStyle(debugLabel: "englishLike overline 2014", inherit: false, fontSize: 10.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5f)
display4: new TextStyle(debugLabel: "englishLike display4 2018", fontSize: 96.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5),
display3: new TextStyle(debugLabel: "englishLike display3 2018", fontSize: 60.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: -0.5),
display2: new TextStyle(debugLabel: "englishLike display2 2018", fontSize: 48.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0),
display1: new TextStyle(debugLabel: "englishLike display1 2018", fontSize: 34.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25),
headline: new TextStyle(debugLabel: "englishLike headline 2018", fontSize: 24.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0),
title: new TextStyle(debugLabel: "englishLike title 2018", fontSize: 20.0, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15),
subhead: new TextStyle(debugLabel: "englishLike subhead 2018", fontSize: 16.0, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15),
body2: new TextStyle(debugLabel: "englishLike body2 2018", fontSize: 14.0, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25),
body1: new TextStyle(debugLabel: "englishLike body1 2018", fontSize: 16.0, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.5),
button: new TextStyle(debugLabel: "englishLike button 2018", fontSize: 14.0, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.75),
caption: new TextStyle(debugLabel: "englishLike caption 2018", fontSize: 12.0, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.4),
subtitle: new TextStyle(debugLabel: "englishLike subtitle 2018", fontSize: 14.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1),
overline: new TextStyle(debugLabel: "englishLike overline 2018", fontSize: 10.0,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5)
display4: new TextStyle(debugLabel: "englishLike display4 2018", fontSize: 96.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5f),
display3: new TextStyle(debugLabel: "englishLike display3 2018", fontSize: 60.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: -0.5f),
display2: new TextStyle(debugLabel: "englishLike display2 2018", fontSize: 48.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0f),
display1: new TextStyle(debugLabel: "englishLike display1 2018", fontSize: 34.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25f),
headline: new TextStyle(debugLabel: "englishLike headline 2018", fontSize: 24.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0f),
title: new TextStyle(debugLabel: "englishLike title 2018", fontSize: 20.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15f),
subhead: new TextStyle(debugLabel: "englishLike subhead 2018", fontSize: 16.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15f),
body2: new TextStyle(debugLabel: "englishLike body2 2018", fontSize: 14.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25f),
body1: new TextStyle(debugLabel: "englishLike body1 2018", fontSize: 16.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.5f),
button: new TextStyle(debugLabel: "englishLike button 2018", fontSize: 14.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.75f),
caption: new TextStyle(debugLabel: "englishLike caption 2018", fontSize: 12.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic, letterSpacing: 0.4f),
subtitle: new TextStyle(debugLabel: "englishLike subtitle 2018", fontSize: 14.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1f),
overline: new TextStyle(debugLabel: "englishLike overline 2018", fontSize: 10.0f,
fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5f)
display4: new TextStyle(debugLabel: "dense display4 2014", inherit: false, fontSize: 112.0,
display4: new TextStyle(debugLabel: "dense display4 2014", inherit: false, fontSize: 112.0f,
display3: new TextStyle(debugLabel: "dense display3 2014", inherit: false, fontSize: 56.0,
display3: new TextStyle(debugLabel: "dense display3 2014", inherit: false, fontSize: 56.0f,
display2: new TextStyle(debugLabel: "dense display2 2014", inherit: false, fontSize: 45.0,
display2: new TextStyle(debugLabel: "dense display2 2014", inherit: false, fontSize: 45.0f,
display1: new TextStyle(debugLabel: "dense display1 2014", inherit: false, fontSize: 34.0,
display1: new TextStyle(debugLabel: "dense display1 2014", inherit: false, fontSize: 34.0f,
headline: new TextStyle(debugLabel: "dense headline 2014", inherit: false, fontSize: 24.0,
headline: new TextStyle(debugLabel: "dense headline 2014", inherit: false, fontSize: 24.0f,
title: new TextStyle(debugLabel: "dense title 2014", inherit: false, fontSize: 21.0,
title: new TextStyle(debugLabel: "dense title 2014", inherit: false, fontSize: 21.0f,
subhead: new TextStyle(debugLabel: "dense subhead 2014", inherit: false, fontSize: 17.0,
subhead: new TextStyle(debugLabel: "dense subhead 2014", inherit: false, fontSize: 17.0f,
body2: new TextStyle(debugLabel: "dense body2 2014", inherit: false, fontSize: 15.0,
body2: new TextStyle(debugLabel: "dense body2 2014", inherit: false, fontSize: 15.0f,
body1: new TextStyle(debugLabel: "dense body1 2014", inherit: false, fontSize: 15.0,
body1: new TextStyle(debugLabel: "dense body1 2014", inherit: false, fontSize: 15.0f,
caption: new TextStyle(debugLabel: "dense caption 2014", inherit: false, fontSize: 13.0,
caption: new TextStyle(debugLabel: "dense caption 2014", inherit: false, fontSize: 13.0f,
button: new TextStyle(debugLabel: "dense button 2014", inherit: false, fontSize: 15.0,
button: new TextStyle(debugLabel: "dense button 2014", inherit: false, fontSize: 15.0f,
subtitle: new TextStyle(debugLabel: "dense subtitle 2014", inherit: false, fontSize: 15.0,
subtitle: new TextStyle(debugLabel: "dense subtitle 2014", inherit: false, fontSize: 15.0f,
overline: new TextStyle(debugLabel: "dense overline 2014", inherit: false, fontSize: 11.0,
overline: new TextStyle(debugLabel: "dense overline 2014", inherit: false, fontSize: 11.0f,
display4: new TextStyle(debugLabel: "dense display4 2018", fontSize: 96.0, fontWeight: FontWeight.w400,
display4: new TextStyle(debugLabel: "dense display4 2018", fontSize: 96.0f, fontWeight: FontWeight.w400,
display3: new TextStyle(debugLabel: "dense display3 2018", fontSize: 60.0, fontWeight: FontWeight.w400,
display3: new TextStyle(debugLabel: "dense display3 2018", fontSize: 60.0f, fontWeight: FontWeight.w400,
display2: new TextStyle(debugLabel: "dense display2 2018", fontSize: 48.0, fontWeight: FontWeight.w400,
display2: new TextStyle(debugLabel: "dense display2 2018", fontSize: 48.0f, fontWeight: FontWeight.w400,
display1: new TextStyle(debugLabel: "dense display1 2018", fontSize: 34.0, fontWeight: FontWeight.w400,
display1: new TextStyle(debugLabel: "dense display1 2018", fontSize: 34.0f, fontWeight: FontWeight.w400,
headline: new TextStyle(debugLabel: "dense headline 2018", fontSize: 24.0, fontWeight: FontWeight.w400,
headline: new TextStyle(debugLabel: "dense headline 2018", fontSize: 24.0f, fontWeight: FontWeight.w400,
title: new TextStyle(debugLabel: "dense title 2018", fontSize: 21.0, fontWeight: FontWeight.w400,
title: new TextStyle(debugLabel: "dense title 2018", fontSize: 21.0f, fontWeight: FontWeight.w400,
subhead: new TextStyle(debugLabel: "dense subhead 2018", fontSize: 17.0, fontWeight: FontWeight.w400,
subhead: new TextStyle(debugLabel: "dense subhead 2018", fontSize: 17.0f, fontWeight: FontWeight.w400,
body2: new TextStyle(debugLabel: "dense body2 2018", fontSize: 17.0, fontWeight: FontWeight.w400,
body2: new TextStyle(debugLabel: "dense body2 2018", fontSize: 17.0f, fontWeight: FontWeight.w400,
body1: new TextStyle(debugLabel: "dense body1 2018", fontSize: 15.0, fontWeight: FontWeight.w400,
body1: new TextStyle(debugLabel: "dense body1 2018", fontSize: 15.0f, fontWeight: FontWeight.w400,
caption: new TextStyle(debugLabel: "dense caption 2018", fontSize: 13.0, fontWeight: FontWeight.w400,
caption: new TextStyle(debugLabel: "dense caption 2018", fontSize: 13.0f, fontWeight: FontWeight.w400,
button: new TextStyle(debugLabel: "dense button 2018", fontSize: 15.0, fontWeight: FontWeight.w400,
button: new TextStyle(debugLabel: "dense button 2018", fontSize: 15.0f, fontWeight: FontWeight.w400,
subtitle: new TextStyle(debugLabel: "dense subtitle 2018", fontSize: 15.0, fontWeight: FontWeight.w400,
subtitle: new TextStyle(debugLabel: "dense subtitle 2018", fontSize: 15.0f, fontWeight: FontWeight.w400,
overline: new TextStyle(debugLabel: "dense overline 2018", fontSize: 11.0, fontWeight: FontWeight.w400,
overline: new TextStyle(debugLabel: "dense overline 2018", fontSize: 11.0f, fontWeight: FontWeight.w400,
display4: new TextStyle(debugLabel: "tall display4 2014", inherit: false, fontSize: 112.0,
display4: new TextStyle(debugLabel: "tall display4 2014", inherit: false, fontSize: 112.0f,
display3: new TextStyle(debugLabel: "tall display3 2014", inherit: false, fontSize: 56.0,
display3: new TextStyle(debugLabel: "tall display3 2014", inherit: false, fontSize: 56.0f,
display2: new TextStyle(debugLabel: "tall display2 2014", inherit: false, fontSize: 45.0,
display2: new TextStyle(debugLabel: "tall display2 2014", inherit: false, fontSize: 45.0f,
display1: new TextStyle(debugLabel: "tall display1 2014", inherit: false, fontSize: 34.0,
display1: new TextStyle(debugLabel: "tall display1 2014", inherit: false, fontSize: 34.0f,
headline: new TextStyle(debugLabel: "tall headline 2014", inherit: false, fontSize: 24.0,
headline: new TextStyle(debugLabel: "tall headline 2014", inherit: false, fontSize: 24.0f,
title: new TextStyle(debugLabel: "tall title 2014", inherit: false, fontSize: 21.0,
title: new TextStyle(debugLabel: "tall title 2014", inherit: false, fontSize: 21.0f,
subhead: new TextStyle(debugLabel: "tall subhead 2014", inherit: false, fontSize: 17.0,
subhead: new TextStyle(debugLabel: "tall subhead 2014", inherit: false, fontSize: 17.0f,
body2: new TextStyle(debugLabel: "tall body2 2014", inherit: false, fontSize: 15.0,
body2: new TextStyle(debugLabel: "tall body2 2014", inherit: false, fontSize: 15.0f,
body1: new TextStyle(debugLabel: "tall body1 2014", inherit: false, fontSize: 15.0,
body1: new TextStyle(debugLabel: "tall body1 2014", inherit: false, fontSize: 15.0f,
caption: new TextStyle(debugLabel: "tall caption 2014", inherit: false, fontSize: 13.0,
caption: new TextStyle(debugLabel: "tall caption 2014", inherit: false, fontSize: 13.0f,
button: new TextStyle(debugLabel: "tall button 2014", inherit: false, fontSize: 15.0,
button: new TextStyle(debugLabel: "tall button 2014", inherit: false, fontSize: 15.0f,
subtitle: new TextStyle(debugLabel: "tall subtitle 2014", inherit: false, fontSize: 15.0,
subtitle: new TextStyle(debugLabel: "tall subtitle 2014", inherit: false, fontSize: 15.0f,
overline: new TextStyle(debugLabel: "tall overline 2014", inherit: false, fontSize: 11.0,
overline: new TextStyle(debugLabel: "tall overline 2014", inherit: false, fontSize: 11.0f,
display4: new TextStyle(debugLabel: "tall display4 2018", fontSize: 96.0, fontWeight: FontWeight.w400,
display4: new TextStyle(debugLabel: "tall display4 2018", fontSize: 96.0f, fontWeight: FontWeight.w400,
display3: new TextStyle(debugLabel: "tall display3 2018", fontSize: 60.0, fontWeight: FontWeight.w400,
display3: new TextStyle(debugLabel: "tall display3 2018", fontSize: 60.0f, fontWeight: FontWeight.w400,
display2: new TextStyle(debugLabel: "tall display2 2018", fontSize: 48.0, fontWeight: FontWeight.w400,
display2: new TextStyle(debugLabel: "tall display2 2018", fontSize: 48.0f, fontWeight: FontWeight.w400,
display1: new TextStyle(debugLabel: "tall display1 2018", fontSize: 34.0, fontWeight: FontWeight.w400,
display1: new TextStyle(debugLabel: "tall display1 2018", fontSize: 34.0f, fontWeight: FontWeight.w400,
headline: new TextStyle(debugLabel: "tall headline 2018", fontSize: 24.0, fontWeight: FontWeight.w400,
headline: new TextStyle(debugLabel: "tall headline 2018", fontSize: 24.0f, fontWeight: FontWeight.w400,
title: new TextStyle(debugLabel: "tall title 2018", fontSize: 21.0, fontWeight: FontWeight.w700,
title: new TextStyle(debugLabel: "tall title 2018", fontSize: 21.0f, fontWeight: FontWeight.w700,
subhead: new TextStyle(debugLabel: "tall subhead 2018", fontSize: 17.0, fontWeight: FontWeight.w400,
subhead: new TextStyle(debugLabel: "tall subhead 2018", fontSize: 17.0f, fontWeight: FontWeight.w400,
body2: new TextStyle(debugLabel: "tall body2 2018", fontSize: 17.0, fontWeight: FontWeight.w700,
body2: new TextStyle(debugLabel: "tall body2 2018", fontSize: 17.0f, fontWeight: FontWeight.w700,
body1: new TextStyle(debugLabel: "tall body1 2018", fontSize: 15.0, fontWeight: FontWeight.w400,
body1: new TextStyle(debugLabel: "tall body1 2018", fontSize: 15.0f, fontWeight: FontWeight.w400,
button: new TextStyle(debugLabel: "tall button 2018", fontSize: 15.0, fontWeight: FontWeight.w700,
button: new TextStyle(debugLabel: "tall button 2018", fontSize: 15.0f, fontWeight: FontWeight.w700,
caption: new TextStyle(debugLabel: "tall caption 2018", fontSize: 13.0, fontWeight: FontWeight.w400,
caption: new TextStyle(debugLabel: "tall caption 2018", fontSize: 13.0f, fontWeight: FontWeight.w400,
subtitle: new TextStyle(debugLabel: "tall subtitle 2018", fontSize: 15.0, fontWeight: FontWeight.w400,
subtitle: new TextStyle(debugLabel: "tall subtitle 2018", fontSize: 15.0f, fontWeight: FontWeight.w400,
overline: new TextStyle(debugLabel: "tall overline 2018", fontSize: 11.0, fontWeight: FontWeight.w400,
overline: new TextStyle(debugLabel: "tall overline 2018", fontSize: 11.0f, fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic)
);
}

34
Runtime/material/utils.cs


public static readonly Dictionary<MaterialType, BorderRadius> kMaterialEdges =
new Dictionary<MaterialType, BorderRadius> {
{MaterialType.canvas, null},
{MaterialType.card, BorderRadius.circular(2.0)},
{MaterialType.card, BorderRadius.circular(2.0f)},
{MaterialType.button, BorderRadius.circular(2.0)},
{MaterialType.button, BorderRadius.circular(2.0f)},
{MaterialType.transparency, null}
};
}

public static readonly TimeSpan _kSplashFadeDuration = new TimeSpan(0, 0, 0, 0, 200);
public const double _kSplashInitialSize = 0.0;
public const float _kSplashInitialSize = 0.0f;
public const double _kSplashConfirmedVelocity = 1.0;
public const float _kSplashConfirmedVelocity = 1.0f;
public static RectCallback _getClipCallback(RenderBox referenceBox, bool containedInkWell,
RectCallback rectCallback) {

return null;
}
public static double _getTargetRadius(RenderBox referenceBox, bool containedInkWell, RectCallback rectCallback,
public static float _getTargetRadius(RenderBox referenceBox, bool containedInkWell, RectCallback rectCallback,
Offset position) {
if (containedInkWell) {
Size size = rectCallback != null ? rectCallback().size : referenceBox.size;

return Material.defaultSplashRadius;
}
static double _getSplashRadiusForPositionInSize(Size bounds, Offset position) {
static float _getSplashRadiusForPositionInSize(Size bounds, Offset position) {
double d1 = (position - bounds.topLeft(Offset.zero)).distance;
double d2 = (position - bounds.topRight(Offset.zero)).distance;
double d3 = (position - bounds.bottomLeft(Offset.zero)).distance;

public static readonly TimeSpan _kFadeOutDuration = new TimeSpan(0, 0, 0, 0, 375);
public static readonly TimeSpan _kCancelDuration = new TimeSpan(0, 0, 0, 0, 75);
public const double _kFadeOutIntervalStart = 225.0 / 375.0;
public const float _kFadeOutIntervalStart = 225.0f / 375.0f;
public static RectCallback _getClipCallback(RenderBox referenceBox, bool containedInkWell,
RectCallback rectCallback) {

return null;
}
public static double _getTargetRadius(RenderBox referenceBox, bool containedInkWell, RectCallback rectCallback,
public static float _getTargetRadius(RenderBox referenceBox, bool containedInkWell, RectCallback rectCallback,
return Math.Max(d1, d2) / 2.0;
return (float) (Math.Max(d1, d2) / 2.0);
}
}

public static readonly TimeSpan _kScrollbarTimeToFade = TimeSpan.FromMilliseconds(600);
public const double _kScrollbarThickness = 6.0;
public const float _kScrollbarThickness = 6.0f;
}

}
public static class ExpansionPanelUtils {
public const double _kPanelHeaderCollapsedHeight = 48.0;
public const double _kPanelHeaderExpandedHeight = 64.0;
public const float _kPanelHeaderCollapsedHeight = 48.0f;
public const float _kPanelHeaderExpandedHeight = 64.0f;
public const double _kMinButtonSize = 48.0;
public const float _kMinButtonSize = 48.0f;
public const double _kDrawerHeaderHeight = 160.0 + 1.0;
public const float _kDrawerHeaderHeight = 160.0f + 1.0f;
public const double _kWidth = 304.0;
public const double _kEdgeDragWidth = 20.0;
public const double _kMinFlingVelocity = 365.0;
public const float _kWidth = 304.0f;
public const float _kEdgeDragWidth = 20.0f;
public const float _kMinFlingVelocity = 365.0f;
public static readonly TimeSpan _kBaseSettleDuration = new TimeSpan(0, 0, 0, 0, 246);
}

12
Runtime/painting/alignment.cs


public Offset alongOffset(Offset other) {
double centerX = other.dx / 2.0;
double centerY = other.dy / 2.0;
return new Offset(centerX + this.x * centerX, centerY + this.y * centerY);
return new Offset((float) (centerX + this.x * centerX), (float) (centerY + this.y * centerY));
return new Offset(centerX + this.x * centerX, centerY + this.y * centerY);
return new Offset((float) (centerX + this.x * centerX), (float) (centerY + this.y * centerY));
}
public Offset withinRect(Rect rect) {

rect.left + halfWidth + this.x * halfWidth,
rect.top + halfHeight + this.y * halfHeight
(float) (rect.left + halfWidth + this.x * halfWidth),
(float) (rect.top + halfHeight + this.y * halfHeight)
);
}

return Rect.fromLTWH(
rect.left + halfWidthDelta + this.x * halfWidthDelta,
rect.top + halfHeightDelta + this.y * halfHeightDelta,
(float) (rect.left + halfWidthDelta + this.x * halfWidthDelta),
(float) (rect.top + halfHeightDelta + this.y * halfHeightDelta),
size.width,
size.height
);

32
Runtime/painting/beveled_rectangle_border.cs


get { return EdgeInsets.all(this.side.width); }
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
return new BeveledRectangleBorder(
side: this.side.scale(t),
borderRadius: this.borderRadius * t

public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is BeveledRectangleBorder border) {
return new BeveledRectangleBorder(
side: BorderSide.lerp(border.side, this.side, t),

public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is BeveledRectangleBorder border) {
return new BeveledRectangleBorder(
side: BorderSide.lerp(this.side, border.side, t),

return base.lerpTo(b, t);
}

double brRadiusY = Math.Max(0.0, rrect.brRadiusY);
List<Offset> vertices = new List<Offset> {
new Offset(rrect.left, Math.Min(centerLeft.dy, rrect.top + tlRadiusY)),
new Offset(Math.Min(centerTop.dx, rrect.left + tlRadiusX), rrect.top),
new Offset(Math.Max(centerTop.dx, rrect.right - trRadiusX), rrect.top),
new Offset(rrect.right, Math.Min(centerRight.dy, rrect.top + trRadiusY)),
new Offset(rrect.right, Math.Max(centerRight.dy, rrect.bottom - brRadiusY)),
new Offset(Math.Max(centerBottom.dx, rrect.right - brRadiusX), rrect.bottom),
new Offset(Math.Min(centerBottom.dx, rrect.left + blRadiusX), rrect.bottom),
new Offset(rrect.left, Math.Max(centerLeft.dy, rrect.bottom - blRadiusY)),
new Offset(rrect.left, (float) Math.Min(centerLeft.dy, rrect.top + tlRadiusY)),
new Offset((float) Math.Min(centerTop.dx, rrect.left + tlRadiusX), rrect.top),
new Offset((float) Math.Max(centerTop.dx, rrect.right - trRadiusX), rrect.top),
new Offset(rrect.right, (float) Math.Min(centerRight.dy, rrect.top + trRadiusY)),
new Offset(rrect.right, (float) Math.Max(centerRight.dy, rrect.bottom - brRadiusY)),
new Offset((float) Math.Max(centerBottom.dx, rrect.right - brRadiusX), rrect.bottom),
new Offset((float) Math.Min(centerBottom.dx, rrect.left + blRadiusX), rrect.bottom),
new Offset(rrect.left, (float) Math.Max(centerLeft.dy, rrect.bottom - blRadiusY)),
};
var path = new Path();

if (rect.isEmpty) {
return;
}
switch (this.side.style) {
case BorderStyle.none:
break;

if (ReferenceEquals(null, other)) {
return false;
}
return Equals(this.side, other.side) && Equals(this.borderRadius, other.borderRadius);
}

}
return this.Equals((BeveledRectangleBorder) obj);
}

return $"{this.GetType()}({this.side}, {this.borderRadius})";
}
}
}
}

22
Runtime/painting/border_radius.cs


return only(radius, radius, radius, radius);
}
public static BorderRadius all(double radius) {
public static BorderRadius all(float radius) {
public static BorderRadius circular(double radius) {
public static BorderRadius circular(float radius) {
return all(Radius.circular(radius));
}

public static BorderRadius vertical(double? top = null, double? bottom = null) {
public static BorderRadius vertical(float? top = null, float? bottom = null) {
return only(top, top, bottom, bottom);
}

public static BorderRadius horizontal(double? left = null, double? right = null) {
public static BorderRadius horizontal(float? left = null, float? right = null) {
return only(left, right, right, left);
}

}
public static BorderRadius only(
double? topLeft = null, double? topRight = null,
double? bottomRight = null, double? bottomLeft = null) {
float? topLeft = null, float? topRight = null,
float? bottomRight = null, float? bottomLeft = null) {
var tlRadius = topLeft != null ? Radius.circular(topLeft.Value) : null;
var trRadius = topRight != null ? Radius.circular(topRight.Value) : null;
var brRadius = bottomRight != null ? Radius.circular(bottomRight.Value) : null;

);
}
public static BorderRadius operator *(BorderRadius it, double other) {
public static BorderRadius operator *(BorderRadius it, float other) {
return only(
topLeft: it.topLeft * other,
topRight: it.topRight * other,

}
public static BorderRadius operator /(BorderRadius it, double other) {
public static BorderRadius operator /(BorderRadius it, float other) {
return only(
topLeft: it.topLeft / other,
topRight: it.topRight / other,

}
public static BorderRadius operator %(BorderRadius it, double other) {
public static BorderRadius operator %(BorderRadius it, float other) {
return only(
topLeft: it.topLeft % other,
topRight: it.topRight % other,

}
public static BorderRadius lerp(BorderRadius a, BorderRadius b, double t) {
public static BorderRadius lerp(BorderRadius a, BorderRadius b, float t) {
if (a == null && b == null) {
return null;
}

}
if (b == null) {
return a * (1.0 - t);
return a * (1.0f - t);
}
return only(

38
Runtime/painting/borders.cs


public class BorderSide : IEquatable<BorderSide> {
public BorderSide(
Color color = null,
double width = 1.0,
float width = 1.0f,
BorderStyle style = BorderStyle.solid
) {
this.color = color ?? Color.black;

}
public readonly Color color;
public readonly double width;
public readonly float width;
public static readonly BorderSide none = new BorderSide(width: 0.0);
public static readonly BorderSide none = new BorderSide(width: 0.0f);
double? width = null,
float? width = null,
BorderStyle? style = null
) {
D.assert(width == null || width >= 0.0);

public BorderSide scale(double t) {
return new BorderSide(
color: this.color,
width: Math.Max(0.0, this.width * t),
width: (float) Math.Max(0.0, this.width * t),
style: t <= 0.0 ? BorderStyle.none : this.style
);
}

return a.style == b.style && a.color == b.color;
}
public static BorderSide lerp(BorderSide a, BorderSide b, double t) {
public static BorderSide lerp(BorderSide a, BorderSide b, float t) {
if (t == 0.0) {
if (t == 0.0f) {
if (t == 1.0) {
if (t == 1.0f) {
double width = MathUtils.lerpDouble(a.width, b.width, t);
float width = MathUtils.lerpFloat(a.width, b.width, t);
if (width < 0.0) {
return none;
}

new _CompoundBorder(new List<ShapeBorder> {other, it});
}
public abstract ShapeBorder scale(double t);
public abstract ShapeBorder scale(float t);
public virtual ShapeBorder lerpFrom(ShapeBorder a, double t) {
public virtual ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a == null) {
return this.scale(t);
}

public virtual ShapeBorder lerpTo(ShapeBorder b, double t) {
public virtual ShapeBorder lerpTo(ShapeBorder b, float t) {
return this.scale(1.0 - t);
return this.scale(1.0f - t);
public static ShapeBorder lerp(ShapeBorder a, ShapeBorder b, double t) {
public static ShapeBorder lerp(ShapeBorder a, ShapeBorder b, float t) {
ShapeBorder result = null;
if (b != null) {
result = b.lerpFrom(a, t);

return new _CompoundBorder(mergedBorders);
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
public new static _CompoundBorder lerp(ShapeBorder a, ShapeBorder b, double t) {
public new static _CompoundBorder lerp(ShapeBorder a, ShapeBorder b, float t) {
D.assert(a is _CompoundBorder || b is _CompoundBorder);
List<ShapeBorder> aList = a is _CompoundBorder aBorder ? aBorder.borders : new List<ShapeBorder> {a};
List<ShapeBorder> bList = b is _CompoundBorder bBorder ? bBorder.borders : new List<ShapeBorder> {b};

}
if (localA != null) {
results.Add(localA.scale(1.0 - t));
results.Add(localA.scale(1.0f - t));
}
}

18
Runtime/painting/box_border.cs


public static Border all(
Color color = null,
double width = 1.0,
float width = 1.0f,
BorderStyle style = BorderStyle.solid
) {
BorderSide side = new BorderSide(color: color, width: width, style: style);

return null;
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
return new Border(
top: this.top.scale(t),
right: this.right.scale(t),

}
public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is Border border) {
return lerp(border, this, t);
}

public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is Border border) {
return lerp(this, border, t);
}

public static Border lerp(Border a, Border b, double t) {
public static Border lerp(Border a, Border b, float t) {
if (a == null && b == null) {
return null;
}

}
if (b == null) {
return (Border) a.scale(1.0 - t);
return (Border) a.scale(1.0f - t);
}
return new Border(

};
RRect outer = borderRadius.toRRect(rect);
double width = side.width;
float width = side.width;
if (width == 0.0) {
paint.style = PaintingStyle.stroke;
paint.strokeWidth = 0.0;

static void _paintUniformBorderWithRectangle(Canvas canvas, Rect rect, BorderSide side) {
D.assert(side.style != BorderStyle.none);
double width = side.width;
float width = side.width;
canvas.drawRect(rect.deflate(width / 2.0), paint);
canvas.drawRect(rect.deflate(width / 2.0f), paint);
}
public bool Equals(Border other) {

12
Runtime/painting/box_decoration.cs


get { return this.border?.dimensions; }
}
public BoxDecoration scale(double factor) {
public BoxDecoration scale(float factor) {
return new BoxDecoration(
color: Color.lerp(null, this.color, factor),
image: this.image,

get { return this.boxShadow != null; }
}
public override Decoration lerpFrom(Decoration a, double t) {
public override Decoration lerpFrom(Decoration a, float t) {
if (a == null) {
return this.scale(t);
}

return base.lerpFrom(a, t);
}
public override Decoration lerpTo(Decoration b, double t) {
public override Decoration lerpTo(Decoration b, float t) {
return this.scale(1.0 - t);
return this.scale(1.0f - t);
}
if (b is BoxDecoration boxDecoration) {

return base.lerpTo(b, t);
}
public static BoxDecoration lerp(BoxDecoration a, BoxDecoration b, double t) {
public static BoxDecoration lerp(BoxDecoration a, BoxDecoration b, float t) {
if (a == null && b == null) {
return null;
}

}
if (b == null) {
return a.scale(1.0 - t);
return a.scale(1.0f - t);
}
if (t == 0.0) {

5
Runtime/painting/box_fit.cs


destinationSize = inputSize;
double aspectRatio = inputSize.width / inputSize.height;
if (destinationSize.height > outputSize.height) {
destinationSize = new Size(outputSize.height * aspectRatio, outputSize.height);
destinationSize = new Size((float) (outputSize.height * aspectRatio),
(float) outputSize.height);
destinationSize = new Size(outputSize.width, outputSize.width / aspectRatio);
destinationSize = new Size(outputSize.width, (float) (outputSize.width / aspectRatio));
}
break;

22
Runtime/painting/box_shadow.cs


public BoxShadow(
Color color = null,
Offset offset = null,
double blurRadius = 0.0,
double spreadRadius = 0.0
float blurRadius = 0.0f,
float spreadRadius = 0.0f
) {
this.color = color ?? Color.black;
this.offset = offset ?? Offset.zero;

public readonly Color color;
public readonly Offset offset;
public readonly double blurRadius;
public readonly double spreadRadius;
public readonly float blurRadius;
public readonly float spreadRadius;
public static double convertRadiusToSigma(double radius) {
return radius * 0.57735 + 0.5;

};
}
public BoxShadow scale(double factor) {
public BoxShadow scale(float factor) {
return new BoxShadow(
color: this.color,
offset: this.offset * factor,

}
public static BoxShadow lerp(BoxShadow a, BoxShadow b, double t) {
public static BoxShadow lerp(BoxShadow a, BoxShadow b, float t) {
if (a == null && b == null) {
return null;
}

}
if (b == null) {
return a.scale(1.0 - t);
return a.scale(1.0f - t);
blurRadius: MathUtils.lerpDouble(a.blurRadius, b.blurRadius, t),
spreadRadius: MathUtils.lerpDouble(a.spreadRadius, b.spreadRadius, t)
blurRadius: MathUtils.lerpFloat(a.blurRadius, b.blurRadius, t),
spreadRadius: MathUtils.lerpFloat(a.spreadRadius, b.spreadRadius, t)
public static List<BoxShadow> lerpList(List<BoxShadow> a, List<BoxShadow> b, double t) {
public static List<BoxShadow> lerpList(List<BoxShadow> a, List<BoxShadow> b, float t) {
if (a == null && b == null) {
return null;
}

}
for (int i = commonLength; i < a.Count; i += 1) {
result.Add(a[i].scale(1.0 - t));
result.Add(a[i].scale(1.0f - t));
}
for (int i = commonLength; i < b.Count; i += 1) {

10
Runtime/painting/circle_border.cs


get { return EdgeInsets.all(this.side.width); }
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is CircleBorder border) {
return new CircleBorder(side: BorderSide.lerp(border.side, this.side, t));
}

public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is CircleBorder border) {
return new CircleBorder(side: BorderSide.lerp(this.side, border.side, t));
}

var path = new Path();
path.addOval(Rect.fromCircle(
center: rect.center,
radius: Math.Max(0.0, rect.shortestSide / 2.0 - this.side.width)
radius: (float) Math.Max(0.0, rect.shortestSide / 2.0 - this.side.width)
));
return path;
}

path.addOval(Rect.fromCircle(
center: rect.center,
radius: rect.shortestSide / 2.0
radius: rect.shortestSide / 2.0f
));
return path;
}

15
Runtime/painting/decoration.cs


get { return false; }
}
public virtual Decoration lerpFrom(Decoration a, double t) {
public virtual Decoration lerpFrom(Decoration a, float t) {
public virtual Decoration lerpTo(Decoration b, double t) {
public virtual Decoration lerpTo(Decoration b, float t) {
public static Decoration lerp(Decoration a, Decoration b, double t) {
public static Decoration lerp(Decoration a, Decoration b, float t) {
?? (t < 0.5 ? (a.lerpTo(null, t * 2.0) ?? a) : (b.lerpFrom(null, (t - 0.5) * 2.0) ?? b));
?? (t < 0.5 ? (a.lerpTo(null, t * 2.0f) ?? a) : (b.lerpFrom(null, (t - 0.5f) * 2.0f) ?? b));
}
public virtual bool hitTest(Size size, Offset position) {

public virtual void Dispose() {
}
}
}
}

8
Runtime/painting/decoration_image.cs


Canvas canvas = null,
Rect rect = null,
Image image = null,
double scale = 1.0,
float scale = 1.0f,
ColorFilter colorFilter = null,
BoxFit? fit = null,
Alignment alignment = null,

double halfHeightDelta = (outputSize.height - destinationSize.height) / 2.0;
double dx = halfWidthDelta + alignment.x * halfWidthDelta;
double dy = halfHeightDelta + alignment.y * halfHeightDelta;
Offset destinationPosition = rect.topLeft.translate(dx, dy);
Offset destinationPosition = rect.topLeft.translate((float) dx, (float) dy);
Rect destinationRect = destinationPosition & destinationSize;
bool needSave = repeat != ImageRepeat.noRepeat;
if (needSave) {

int startY = 0;
int stopX = 0;
int stopY = 0;
double strideX = fundamentalRect.width;
double strideY = fundamentalRect.height;
float strideX = fundamentalRect.width;
float strideY = fundamentalRect.height;
if (repeat == ImageRepeat.repeat || repeat == ImageRepeat.repeatX) {
startX = ((outputRect.left - fundamentalRect.left) / strideX).floor();

52
Runtime/painting/edge_insets.cs


namespace Unity.UIWidgets.painting {
public class EdgeInsets : IEquatable<EdgeInsets> {
EdgeInsets(double left, double top, double right, double bottom) {
EdgeInsets(float left, float top, float right, float bottom) {
this.left = left;
this.right = right;
this.top = top;

public readonly double left;
public readonly double right;
public readonly double top;
public readonly double bottom;
public readonly float left;
public readonly float right;
public readonly float top;
public readonly float bottom;
public bool isNonNegative {
get {

}
}
public double horizontal {
public float horizontal {
public double vertical {
public float vertical {
public double along(Axis axis) {
public float along(Axis axis) {
switch (axis) {
case Axis.horizontal:
return this.horizontal;

return new Size(size.width - this.horizontal, size.height - this.vertical);
}
public static EdgeInsets fromLTRB(double left, double top, double right, double bottom) {
public static EdgeInsets fromLTRB(float left, float top, float right, float bottom) {
public static EdgeInsets all(double value) {
public static EdgeInsets all(float value) {
public static EdgeInsets only(double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0) {
public static EdgeInsets only(float left = 0.0f, float top = 0.0f, float right = 0.0f, float bottom = 0.0f) {
public static EdgeInsets symmetric(double vertical = 0.0, double horizontal = 0.0) {
public static EdgeInsets symmetric(float vertical = 0.0f, float horizontal = 0.0f) {
public static EdgeInsets fromWindowPadding(WindowPadding padding, double devicePixelRatio) {
public static EdgeInsets fromWindowPadding(WindowPadding padding, float devicePixelRatio) {
return new EdgeInsets(
left: padding.left / devicePixelRatio,
top: padding.top / devicePixelRatio,

);
}
public static EdgeInsets operator *(EdgeInsets a, double b) {
public static EdgeInsets operator *(EdgeInsets a, float b) {
return fromLTRB(
a.left * b,
a.top * b,

}
public static EdgeInsets operator /(EdgeInsets a, double b) {
public static EdgeInsets operator /(EdgeInsets a, float b) {
return fromLTRB(
a.left / b,
a.top / b,

}
public static EdgeInsets operator %(EdgeInsets a, double b) {
public static EdgeInsets operator %(EdgeInsets a, float b) {
return fromLTRB(
a.left % b,
a.top % b,

}
public static EdgeInsets lerp(EdgeInsets a, EdgeInsets b, double t) {
public static EdgeInsets lerp(EdgeInsets a, EdgeInsets b, float t) {
if (a == null && b == null) {
return null;
}

}
if (b == null) {
return a * (1.0 - t);
return a * (1.0f - t);
MathUtils.lerpDouble(a.left, b.left, t),
MathUtils.lerpDouble(a.top, b.top, t),
MathUtils.lerpDouble(a.right, b.right, t),
MathUtils.lerpDouble(a.bottom, b.bottom, t)
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)
double? left = null,
double? top = null,
double? right = null,
double? bottom = null
float? left = null,
float? top = null,
float? right = null,
float? bottom = null
) {
return only(
left: left ?? this.left,

4
Runtime/painting/geometry.cs


x = (size.width - childSize.width) / 2.0;
}
else {
double normalizedTargetX = target.dx.clamp(margin, size.width - margin);
double normalizedTargetX = target.dx.clamp((float) margin, (float) (size.width - margin));
double edge = margin + childSize.width / 2.0;
if (normalizedTargetX < edge) {
x = margin;

}
}
return new Offset(x, y);
return new Offset((float) x, (float) y);
}
}
}

52
Runtime/painting/gradient.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.painting {
class _ColorsAndStops {
public _ColorsAndStops(List<Color> colors, List<double> stops) {
this.colors = colors;

if (this.stops != null) {
return this.stops;
}
if (this.colors.Count == 2) {
return null;
}

if (b == null) {
return this.scale(1.0 - t);
}
return null;
}

public class LinearGradient : Gradient, IEquatable<LinearGradient> {
public LinearGradient(
Alignment begin = null,
Alignment end = null,

protected override Gradient lerpFrom(Gradient a, double t) {
if (a == null || (a is LinearGradient && a.colors.Count == this.colors.Count)) {
return LinearGradient.lerp((LinearGradient) a, this, t);
return lerp((LinearGradient) a, this, t);
}
return base.lerpFrom(a, t);

if (b == null || (b is LinearGradient && b.colors.Count == this.colors.Count)) {
return LinearGradient.lerp(this, (LinearGradient) b, t);
return lerp(this, (LinearGradient) b, t);
return base.lerpTo(b, t);
}

}
if (b == null) {
return (LinearGradient) a.scale(1.0 - t);
}

if (ReferenceEquals(null, other)) {
return false;
}
return
this.colors.equalsList(other.colors) &&
this.stops.equalsList(other.stops) &&

if (ReferenceEquals(null, obj)) {
return false;
}
return this.Equals((LinearGradient) obj);
}

return !Equals(left, right);
}
public override String ToString() {
public override string ToString() {
return $"{this.GetType()}({this.begin}, {this.end}," +
$"{this.colors.toStringList()}, {this.stops.toStringList()}, {this.tileMode})";
}

public RadialGradient(
Alignment center = null,
double radius = 0.5,

protected override Gradient lerpFrom(Gradient a, double t) {
if (a == null || (a is RadialGradient && a.colors.Count == this.colors.Count)) {
return RadialGradient.lerp((RadialGradient) a, this, t);
return lerp((RadialGradient) a, this, t);
}
return base.lerpFrom(a, t);

if (b == null || (b is RadialGradient && b.colors.Count == this.colors.Count)) {
return RadialGradient.lerp(this, (RadialGradient) b, t);
return lerp(this, (RadialGradient) b, t);
return base.lerpTo(b, t);
}

}
if (b == null) {
return (RadialGradient) a.scale(1.0 - t);
}

if (ReferenceEquals(null, other)) {
return false;
}
return
this.colors.equalsList(other.colors) &&
this.stops.equalsList(other.stops) &&

if (ReferenceEquals(null, obj)) {
return false;
}
return this.Equals((RadialGradient) obj);
}

return !Equals(left, right);
}
public override String ToString() {
public override string ToString() {
public class SweepGradient : Gradient, IEquatable<SweepGradient> {
public class SweepGradient : Gradient, IEquatable<SweepGradient> {
public SweepGradient(
Alignment center = null,
double startAngle = 0.0,

public readonly Alignment center;
public readonly double startAngle;
public readonly double endAngle;
public readonly TileMode tileMode;

protected override Gradient lerpFrom(Gradient a, double t) {
if (a == null || (a is SweepGradient && a.colors.Count == this.colors.Count)) {
return SweepGradient.lerp((SweepGradient) a, this, t);
return lerp((SweepGradient) a, this, t);
}
return base.lerpFrom(a, t);

if (b == null || (b is SweepGradient && b.colors.Count == this.colors.Count)) {
return SweepGradient.lerp(this, (SweepGradient) b, t);
return lerp(this, (SweepGradient) b, t);
return base.lerpTo(b, t);
}

}
if (b == null) {
return (SweepGradient) a.scale(1.0 - t);
}

if (ReferenceEquals(null, other)) {
return false;
}
return
this.colors.equalsList(other.colors) &&
this.stops.equalsList(other.stops) &&

if (ReferenceEquals(null, obj)) {
return false;
}
return this.Equals((SweepGradient) obj);
}

return !Equals(left, right);
}
public override String ToString() {
public override string ToString() {
return $"{this.GetType()}({this.center}, {this.startAngle}, {this.endAngle}, " +
$"{this.colors.toStringList()}, {this.stops.toStringList()}, {this.tileMode})";
}

20
Runtime/painting/image_provider.cs


public AssetBundleImageKey(
AssetBundle bundle,
string name,
double scale
float scale
) {
D.assert(name != null);
D.assert(scale >= 0.0);

public readonly string name;
public readonly double scale;
public readonly float scale;
public bool Equals(AssetBundleImageKey other) {
if (ReferenceEquals(null, other)) {

public class NetworkImage : ImageProvider<NetworkImage>, IEquatable<NetworkImage> {
public NetworkImage(string url,
double scale = 1.0,
float scale = 1.0f,
IDictionary<string, string> headers = null) {
D.assert(url != null);
this.url = url;

public readonly string url;
public readonly double scale;
public readonly float scale;
public readonly IDictionary<string, string> headers;

}
public class FileImage : ImageProvider<FileImage>, IEquatable<FileImage> {
public FileImage(string file, double scale = 1.0) {
public FileImage(string file, float scale = 1.0f) {
D.assert(file != null);
this.file = file;
this.scale = scale;

public readonly double scale;
public readonly float scale;
protected override IPromise<FileImage> obtainKey(ImageConfiguration configuration) {
return Promise<FileImage>.Resolved(this);

}
public class MemoryImage : ImageProvider<MemoryImage>, IEquatable<MemoryImage> {
public MemoryImage(byte[] bytes, double scale = 1.0) {
public MemoryImage(byte[] bytes, float scale = 1.0f) {
D.assert(bytes != null);
this.bytes = bytes;
this.scale = scale;

public readonly double scale;
public readonly float scale;
protected override IPromise<MemoryImage> obtainKey(ImageConfiguration configuration) {
return Promise<MemoryImage>.Resolved(this);

public class ExactAssetImage : AssetBundleImageProvider, IEquatable<ExactAssetImage> {
public ExactAssetImage(
string assetName,
double scale = 1.0,
float scale = 1.0f,
AssetBundle bundle = null
) {
D.assert(assetName != null);

public readonly string assetName;
public readonly double scale;
public readonly float scale;
public readonly AssetBundle bundle;

2
Runtime/painting/image_resolution.cs


yield return new AssetBundleImageKey(
bundle,
this.assetName,
scale: 1.0
scale: 1.0f
);
}

8
Runtime/painting/image_stream.cs


namespace Unity.UIWidgets.painting {
public class ImageInfo : IEquatable<ImageInfo> {
public ImageInfo(Image image, double scale = 1.0) {
public ImageInfo(Image image, float scale = 1.0f) {
D.assert(image != null);
this.image = image;

public readonly Image image;
public readonly double scale;
public readonly float scale;
public bool Equals(ImageInfo other) {
if (ReferenceEquals(null, other)) {

public class MultiFrameImageStreamCompleter : ImageStreamCompleter {
public MultiFrameImageStreamCompleter(
IPromise<Codec> codec,
double scale,
float scale,
InformationCollector informationCollector = null
) {
D.assert(codec != null);

}
Codec _codec;
readonly double _scale;
readonly float _scale;
readonly InformationCollector _informationCollector;
FrameInfo _nextFrame;

7
Runtime/painting/matrix_utils.cs


return result;
}
public static Matrix4x4 toMatrix4x4(this Matrix3 matrix3) {
var matrix = Matrix4x4.identity;

matrix[3, 0] = matrix3[6]; // row 2
matrix[3, 1] = matrix3[7];
matrix[3, 3] = matrix3[8];

}
public class TransformProperty : DiagnosticsProperty<Matrix3> {

44
Runtime/painting/rounded_rectangle_border.cs


get { return EdgeInsets.all(this.side.width); }
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
return new RoundedRectangleBorder(
side: this.side.scale(t),
borderRadius: this.borderRadius * t

public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is RoundedRectangleBorder border) {
return new RoundedRectangleBorder(
side: BorderSide.lerp(border.side, this.side, t),

return new _RoundedRectangleToCircleBorder(
side: BorderSide.lerp(circleBorder.side, this.side, t),
borderRadius: this.borderRadius,
circleness: 1.0 - t
circleness: 1.0f - t
);
}

public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is RoundedRectangleBorder border) {
return new RoundedRectangleBorder(
side: BorderSide.lerp(this.side, border.side, t),

case BorderStyle.none:
break;
case BorderStyle.solid:
double width = this.side.width;
float width = this.side.width;
if (width == 0.0) {
canvas.drawRRect(this.borderRadius.toRRect(rect), this.side.toPaint());
}

public _RoundedRectangleToCircleBorder(
BorderSide side = null,
BorderRadius borderRadius = null,
double circleness = 0.0
float circleness = 0.0f
) {
this.side = side ?? BorderSide.none;
this.borderRadius = borderRadius ?? BorderRadius.zero;

public readonly BorderRadius borderRadius;
public readonly double circleness;
public readonly float circleness;
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
return new _RoundedRectangleToCircleBorder(
side: this.side.scale(t),
borderRadius: this.borderRadius * t,

public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is RoundedRectangleBorder rectBorder) {
return new _RoundedRectangleToCircleBorder(
side: BorderSide.lerp(rectBorder.side, this.side, t),

return new _RoundedRectangleToCircleBorder(
side: BorderSide.lerp(circleBorder.side, this.side, t),
borderRadius: this.borderRadius,
circleness: this.circleness + (1.0 - this.circleness) * (1.0 - t)
circleness: this.circleness + (1.0f - this.circleness) * (1.0f - t)
);
}

borderRadius: BorderRadius.lerp(border.borderRadius, this.borderRadius, t),
circleness: MathUtils.lerpDouble(border.circleness, this.circleness, t)
circleness: MathUtils.lerpFloat(border.circleness, this.circleness, t)
);
}

public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
circleness: this.circleness * (1.0 - t)
circleness: this.circleness * (1.0f - t)
);
}

borderRadius: this.borderRadius,
circleness: this.circleness + (1.0 - this.circleness) * t
circleness: this.circleness + (1.0f - this.circleness) * t
);
}

borderRadius: BorderRadius.lerp(this.borderRadius, border.borderRadius, t),
circleness: MathUtils.lerpDouble(this.circleness, border.circleness, t)
circleness: MathUtils.lerpFloat(this.circleness, border.circleness, t)
);
}

double delta = this.circleness * (rect.height - rect.width) / 2.0;
return Rect.fromLTRB(
rect.left,
rect.top + delta,
(float) (rect.top + delta),
rect.bottom - delta
(float) (rect.bottom - delta)
rect.left + delta,
(float) (rect.left + delta),
rect.right - delta,
(float) (rect.right - delta),
rect.bottom
);
}

BorderRadius resolvedRadius = this.borderRadius;
if (this.circleness == 0.0) {
if (this.circleness == 0.0f) {
return BorderRadius.lerp(resolvedRadius, BorderRadius.circular(rect.shortestSide / 2.0), this.circleness);
return BorderRadius.lerp(resolvedRadius, BorderRadius.circular(rect.shortestSide / 2.0f), this.circleness);
}
public override Path getInnerPath(Rect rect) {

case BorderStyle.none:
break;
case BorderStyle.solid:
double width = this.side.width;
float width = this.side.width;
if (width == 0.0) {
canvas.drawRRect(this._adjustBorderRadius(rect).toRRect(this._adjustRect(rect)),
this.side.toPaint());

46
Runtime/painting/shape_decoration.cs


if (source.border != null) {
D.assert(source.border.isUniform);
shape = new CircleBorder(side: source.border.top);
} else {
}
else {
break;
case BoxShape.rectangle:
if (source.borderRadius != null) {

borderRadius: source.borderRadius
);
} else {
}
else {
return new ShapeDecoration(
color: source.color,
image: source.image,

get { return this.shadows != null; }
}
public override Decoration lerpFrom(Decoration a, double t) {
public override Decoration lerpFrom(Decoration a, float t) {
return ShapeDecoration.lerp(ShapeDecoration.fromBoxDecoration(decoration), this, t);
} else if (a == null || a is ShapeDecoration) {
return ShapeDecoration.lerp(a, this, t);
return lerp(fromBoxDecoration(decoration), this, t);
}
else if (a == null || a is ShapeDecoration) {
return lerp(a, this, t);
public override Decoration lerpTo(Decoration b, double t) {
public override Decoration lerpTo(Decoration b, float t) {
return ShapeDecoration.lerp(this, ShapeDecoration.fromBoxDecoration(decoration), t);
} else if (b == null || b is ShapeDecoration) {
return ShapeDecoration.lerp(this, b, t);
return lerp(this, fromBoxDecoration(decoration), t);
else if (b == null || b is ShapeDecoration) {
return lerp(this, b, t);
}
public static ShapeDecoration lerp(ShapeDecoration a, ShapeDecoration b, double t) {
public static ShapeDecoration lerp(ShapeDecoration a, ShapeDecoration b, float t) {
if (t == 1.0) {
return b;
}

if (ReferenceEquals(null, other)) {
return false;
}
return Equals(this.color, other.color) && Equals(this.image, other.image) &&
Equals(this.gradient, other.gradient) && Equals(this.shadows, other.shadows) &&
Equals(this.shape, other.shape);

if (ReferenceEquals(null, obj)) {
return false;
}
return this.Equals((ShapeDecoration) obj);
}

this._interiorPaint.color = this._decoration.color;
}
}
if (this._decoration.shadows != null) {
if (this._shadowCount == null) {
this._shadowCount = this._decoration.shadows.Count;

this._shadowPaints[index] = this._decoration.shadows[index].toPaint();
}
}
for (int index = 0; index < this._shadowCount; index += 1) {
BoxShadow shadow = this._decoration.shadows[index];
this._shadowPaths[index] = this._decoration.shape.getOuterPath(

if (this._decoration.image != null) {
this._innerPath = this._decoration.shape.getInnerPath(rect);
}

if (this._decoration.image == null) {
return;
}
this._imagePainter = this._imagePainter ?? this._decoration.image.createPainter(this.onChanged);
this._imagePainter.paint(canvas, this._lastRect, this._innerPath, configuration);
}

this._decoration.shape.paint(canvas, rect);
}
}
}
}

90
Runtime/painting/stadium_border.cs


get { return EdgeInsets.all(this.side.width); }
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is CircleBorder circleBorder) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(circleBorder.side, this.side, t),

if (a is RoundedRectangleBorder rectBorder) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(rectBorder.side, this.side, t),

}
public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is StadiumBorder stadiumBorder) {
return new StadiumBorder(side: BorderSide.lerp(this.side, stadiumBorder.side, t));
}

circleness: t
);
}
if (b is RoundedRectangleBorder rectBorder) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(this.side, rectBorder.side, t),

}
Radius radius = Radius.circular(rect.shortestSide / 2.0);
Radius radius = Radius.circular(rect.shortestSide / 2.0f);
var path = new Path();
path.addRRect(RRect.fromRectAndRadius(rect, radius).deflate(this.side.width));
return path;

Radius radius = Radius.circular(rect.shortestSide / 2.0);
Radius radius = Radius.circular(rect.shortestSide / 2.0f);
var path = new Path();
path.addRRect(RRect.fromRectAndRadius(rect, radius));
return path;

case BorderStyle.none:
break;
case BorderStyle.solid:
Radius radius = Radius.circular(rect.shortestSide / 2.0);
Radius radius = Radius.circular(rect.shortestSide / 2.0f);
RRect.fromRectAndRadius(rect, radius).deflate(this.side.width / 2.0),
RRect.fromRectAndRadius(rect, radius).deflate(this.side.width / 2.0f),
this.side.toPaint()
);
break;

if (ReferenceEquals(null, other)) {
return false;
}
return Equals(this.side, other.side);
}

}
return this.Equals((StadiumBorder) obj);
}

get { return EdgeInsets.all(this.side.width); }
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
return new _StadiumToCircleBorder(
side: this.side.scale(t),
circleness: t

public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is StadiumBorder stadiumBorder) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(stadiumBorder.side, this.side, t),

if (a is CircleBorder circleBorder) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(circleBorder.side, this.side, t),

if (a is _StadiumToCircleBorder border) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(border.side, this.side, t),

public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is StadiumBorder stadiumBorder) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(this.side, stadiumBorder.side, t),

if (b is CircleBorder circleBorder) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(this.side, circleBorder.side, t),

if (b is _StadiumToCircleBorder border) {
return new _StadiumToCircleBorder(
side: BorderSide.lerp(this.side, border.side, t),

return base.lerpTo(b, t);
}

}
rect.top + delta,
(float) (rect.top + delta),
rect.bottom - delta
(float) (rect.bottom - delta)
} else {
}
else {
rect.left + delta,
(float) (rect.left + delta),
rect.right - delta,
(float) (rect.right - delta),
rect.bottom
);
}

return BorderRadius.circular(rect.shortestSide / 2.0);
return BorderRadius.circular(rect.shortestSide / 2.0f);
}
public override Path getInnerPath(Rect rect) {

case BorderStyle.none:
break;
case BorderStyle.solid:
double width = this.side.width;
float width = this.side.width;
} else {
}
else {
RRect outer = this._adjustBorderRadius(rect).toRRect(this._adjustRect(rect));
RRect inner = outer.deflate(width);
Paint paint = new Paint {

}
break;
}
}

return false;
}
return Equals(this.side, other.side) && this.circleness.Equals(other.circleness);
}

}
return this.Equals((_StadiumToCircleBorder) obj);
}

get { return EdgeInsets.all(this.side.width); }
}
public override ShapeBorder scale(double t) {
public override ShapeBorder scale(float t) {
return new _StadiumToRoundedRectangleBorder(
side: this.side.scale(t),
borderRadius: this.borderRadius * t,

public override ShapeBorder lerpFrom(ShapeBorder a, double t) {
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
if (a is StadiumBorder stadiumBorder) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(stadiumBorder.side, this.side, t),

}
if (a is RoundedRectangleBorder rectBorder) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(rectBorder.side, this.side, t),

}
if (a is _StadiumToRoundedRectangleBorder border) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(border.side, this.side, t),

}
public override ShapeBorder lerpTo(ShapeBorder b, double t) {
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
if (b is StadiumBorder stadiumBorder) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(this.side, stadiumBorder.side, t),

}
if (b is RoundedRectangleBorder rectBorder) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(this.side, rectBorder.side, t),

}
if (b is _StadiumToRoundedRectangleBorder border) {
return new _StadiumToRoundedRectangleBorder(
side: BorderSide.lerp(this.side, border.side, t),

}
return base.lerpTo(b, t);
}

BorderRadius.all(Radius.circular(rect.shortestSide / 2.0)),
1.0 - this.rectness
BorderRadius.all(Radius.circular(rect.shortestSide / 2.0f)),
(float) (1.0 - this.rectness)
);
}

case BorderStyle.none:
break;
case BorderStyle.solid:
double width = this.side.width;
float width = this.side.width;
} else {
}
else {
RRect outer = this._adjustBorderRadius(rect).toRRect(rect);
RRect inner = outer.deflate(width);
Paint paint = new Paint {

}
break;
}
}

return false;
}
return Equals(this.side, other.side) && Equals(this.borderRadius, other.borderRadius) &&
this.rectness.Equals(other.rectness);
}

return false;
}
return this.Equals((_StadiumToRoundedRectangleBorder) obj);
}

"RoundedRectangleBorder)";
}
}
}
}

38
Runtime/painting/text_painter.cs


TextSpan _text;
TextAlign _textAlign;
TextDirection? _textDirection;
double _textScaleFactor;
float _textScaleFactor;
double _lastMinWidth;
double _lastMaxWidth;
float _lastMinWidth;
float _lastMaxWidth;
double textScaleFactor = 1.0,
float textScaleFactor = 1.0f,
int? maxLines = null,
string ellipsis = "") {
this._text = text;

}
public double textScaleFactor {
public float textScaleFactor {
get { return this._textScaleFactor; }
set {
if (this._textScaleFactor == value) {

}
}
public double minIntrinsicWidth {
public float minIntrinsicWidth {
get {
Debug.Assert(!this._needsLayout);
return this._applyFloatingPointHack(this._paragraph.minIntrinsicWidth);

public double maxIntrinsicWidth {
public float maxIntrinsicWidth {
get {
Debug.Assert(!this._needsLayout);
return this._applyFloatingPointHack(this._paragraph.maxIntrinsicWidth);

public double height {
public float height {
get {
Debug.Assert(!this._needsLayout);
return this._applyFloatingPointHack(this._paragraph.height);

public double width {
public float width {
get {
Debug.Assert(!this._needsLayout);
return this._applyFloatingPointHack(this._paragraph.width);

public double computeDistanceToActualBaseline(TextBaseline baseline) {
public float computeDistanceToActualBaseline(TextBaseline baseline) {
Debug.Assert(!this._needsLayout);
switch (baseline) {
case TextBaseline.alphabetic:

}
return 0.0;
return 0.0f;
public void layout(double minWidth = 0.0, double maxWidth = double.PositiveInfinity) {
public void layout(float minWidth = 0.0f, float maxWidth = float.PositiveInfinity) {
Debug.Assert(this.text != null,
"TextPainter.text must be set to a non-null value before using the TextPainter.");
Debug.Assert(this.textDirection != null,

this.ellipsis, this.maxLines, this.textScaleFactor);
}
public double preferredLineHeight {
public float preferredLineHeight {
get {
if (this._layoutTemplate == null) {
var builder = new ParagraphBuilder(this._createParagraphStyle(TextDirection.ltr)

builder.addText(" ");
this._layoutTemplate = builder.build();
this._layoutTemplate.layout(new ParagraphConstraints(double.PositiveInfinity));
this._layoutTemplate.layout(new ParagraphConstraints(float.PositiveInfinity));
}
return this._layoutTemplate.height;

double _applyFloatingPointHack(double layoutValue) {
return Math.Ceiling(layoutValue);
float _applyFloatingPointHack(double layoutValue) {
return (float) Math.Ceiling(layoutValue);
}

case TextAlign.left:
return Offset.zero;
case TextAlign.right:
return new Offset(this.width, 0.0);
return new Offset(this.width, 0.0f);
return new Offset(this.width / 2.0, 0.0);
return new Offset(this.width / 2.0f, 0.0f);
return new Offset(this.width, 0.0);
return new Offset(this.width, 0.0f);
}
return Offset.zero;

52
Runtime/painting/text_style.cs


namespace Unity.UIWidgets.painting {
public class TextStyle : Diagnosticable, IEquatable<TextStyle>, ParagraphBuilder.ITextStyleProvider {
public static readonly double _defaultFontSize = 14.0;
public static readonly float _defaultFontSize = 14.0f;
public readonly double? fontSize;
public readonly float? fontSize;
public readonly double? letterSpacing;
public readonly double? wordSpacing;
public readonly float? letterSpacing;
public readonly float? wordSpacing;
public readonly double? height;
public readonly float? height;
public readonly TextDecoration decoration;
public readonly Color decorationColor;
public readonly TextDecorationStyle? decorationStyle;

const string _kDefaultDebugLabel = "unknown";
public TextStyle(bool inherit = true, Color color = null, double? fontSize = null,
public TextStyle(bool inherit = true, Color color = null, float? fontSize = null,
FontStyle? fontStyle = null, double? letterSpacing = null, double? wordSpacing = null,
TextBaseline? textBaseline = null, double? height = null, Paint background = null,
FontStyle? fontStyle = null, float? letterSpacing = null, float? wordSpacing = null,
TextBaseline? textBaseline = null, float? height = null, Paint background = null,
TextDecoration decoration = null,
Color decorationColor = null, TextDecorationStyle? decorationStyle = null,
string fontFamily = null, string debugLabel = null) {

}
public ParagraphStyle getParagraphStyle(TextAlign textAlign,
TextDirection textDirection, string ellipsis, int? maxLines, double textScaleFactor = 1.0) {
TextDirection textDirection, string ellipsis, int? maxLines, float textScaleFactor = 1.0f) {
return new ParagraphStyle(
textAlign, textDirection, this.fontWeight, this.fontStyle,
maxLines, (this.fontSize ?? _defaultFontSize) * textScaleFactor, this.fontFamily, this.height,

Color decorationColor = null,
TextDecorationStyle? decorationStyle = null,
string fontFamily = null,
double fontSizeFactor = 1.0,
double fontSizeDelta = 0.0,
float fontSizeFactor = 1.0f,
float fontSizeDelta = 0.0f,
double letterSpacingFactor = 1.0,
double letterSpacingDelta = 0.0,
double wordSpacingFactor = 1.0,
double wordSpacingDelta = 0.0,
double heightFactor = 1.0,
double heightDelta = 0.0
float letterSpacingFactor = 1.0f,
float letterSpacingDelta = 0.0f,
float wordSpacingFactor = 1.0f,
float wordSpacingDelta = 0.0f,
float heightFactor = 1.0f,
float heightDelta = 0.0f
) {
D.assert(this.fontSize != null || (fontSizeFactor == 1.0 && fontSizeDelta == 0.0));
D.assert(this.fontWeight != null || fontWeightDelta == 0.0);

public TextStyle copyWith(Color color = null,
string fontFamily = null,
double? fontSize = null,
float? fontSize = null,
double? letterSpacing = null,
double? wordSpacing = null,
float? letterSpacing = null,
float? wordSpacing = null,
double? height = null,
float? height = null,
Paint background = null,
TextDecoration decoration = null,
Color decorationColor = null,

);
}
public static TextStyle lerp(TextStyle a, TextStyle b, double t) {
public static TextStyle lerp(TextStyle a, TextStyle b, float t) {
D.assert(a == null || b == null || a.inherit == b.inherit);
if (a == null && b == null) {
return null;

inherit: b.inherit,
color: Color.lerp(a.color, b.color, t),
fontFamily: t < 0.5 ? a.fontFamily : b.fontFamily,
fontSize: MathUtils.lerpNullableDouble(a.fontSize ?? b.fontSize, b.fontSize ?? a.fontSize, t),
fontSize: MathUtils.lerpNullableFloat(a.fontSize ?? b.fontSize, b.fontSize ?? a.fontSize, t),
letterSpacing: MathUtils.lerpNullableDouble(a.letterSpacing ?? b.letterSpacing,
letterSpacing: MathUtils.lerpNullableFloat(a.letterSpacing ?? b.letterSpacing,
wordSpacing: MathUtils.lerpNullableDouble(a.wordSpacing ?? b.wordSpacing,
wordSpacing: MathUtils.lerpNullableFloat(a.wordSpacing ?? b.wordSpacing,
height: MathUtils.lerpNullableDouble(a.height ?? b.height, b.height ?? a.height, t),
height: MathUtils.lerpNullableFloat(a.height ?? b.height, b.height ?? a.height, t),
background: t < 0.5 ? a.background : b.background,
decoration: t < 0.5 ? a.decoration : b.decoration,
decorationColor: Color.lerp(a.decorationColor, b.decorationColor, t),

22
Runtime/physics/clamped_simulation.cs


namespace Unity.UIWidgets.physics {
public class ClampedSimulation : Simulation {
public ClampedSimulation(Simulation simulation,
double xMin = double.NegativeInfinity,
double xMax = double.PositiveInfinity,
double dxMin = double.NegativeInfinity,
double dxMax = double.PositiveInfinity
float xMin = float.NegativeInfinity,
float xMax = float.PositiveInfinity,
float dxMin = float.NegativeInfinity,
float dxMax = float.PositiveInfinity
) {
D.assert(simulation != null);
D.assert(xMax >= xMin);

public readonly Simulation simulation;
public readonly double xMin;
public readonly float xMin;
public readonly double xMax;
public readonly float xMax;
public readonly double dxMin;
public readonly float dxMin;
public readonly double dxMax;
public readonly float dxMax;
public override double x(double time) {
public override float x(float time) {
public override double dx(double time) {
public override float dx(float time) {
public override bool isDone(double time) {
public override bool isDone(float time) {
return this.simulation.isDone(time);
}
}

58
Runtime/physics/friction_simulation.cs


namespace Unity.UIWidgets.physics {
public class FrictionSimulation : Simulation {
public FrictionSimulation(
double drag, double position, double velocity,
float drag, float position, float velocity,
this._dragLog = Math.Log(drag);
this._dragLog = (float) Math.Log(drag);
public static FrictionSimulation through(double startPosition, double endPosition, double startVelocity,
double endVelocity) {
public static FrictionSimulation through(float startPosition, float endPosition, float startVelocity,
float endVelocity) {
D.assert(startVelocity == 0.0 || endVelocity == 0.0 || startVelocity.sign() == endVelocity.sign());
D.assert(startVelocity.abs() >= endVelocity.abs());
D.assert((endPosition - startPosition).sign() == startVelocity.sign());

);
}
readonly double _drag;
readonly double _dragLog;
readonly double _x;
readonly double _v;
readonly float _drag;
readonly float _dragLog;
readonly float _x;
readonly float _v;
static double _dragFor(double startPosition, double endPosition, double startVelocity, double endVelocity) {
return Math.Pow(Math.E, (startVelocity - endVelocity) / (startPosition - endPosition));
static float _dragFor(float startPosition, float endPosition, float startVelocity, float endVelocity) {
return (float) Math.Pow(Math.E, (startVelocity - endVelocity) / (startPosition - endPosition));
public override double x(double time) {
return this._x + this._v * Math.Pow(this._drag, time) / this._dragLog - this._v / this._dragLog;
public override float x(float time) {
return this._x + this._v * (float) Math.Pow(this._drag, time) / this._dragLog - this._v / this._dragLog;
public override double dx(double time) {
return this._v * Math.Pow(this._drag, time);
public override float dx(float time) {
return this._v * (float) Math.Pow(this._drag, time);
public double finalX {
public float finalX {
public double timeAtX(double x) {
public float timeAtX(float x) {
return 0.0;
return 0.0f;
return double.PositiveInfinity;
return float.PositiveInfinity;
return Math.Log(this._dragLog * (x - this._x) / this._v + 1.0) / this._dragLog;
return (float) Math.Log(this._dragLog * (x - this._x) / this._v + 1.0) / this._dragLog;
public override bool isDone(double time) {
public override bool isDone(float time) {
return this.dx(time).abs() < this.tolerance.velocity;
}
}

double drag,
double position,
double velocity,
double _minX,
double _maxX
float drag,
float position,
float velocity,
float _minX,
float _maxX
) : base(drag, position, velocity) {
D.assert(position.clamp(_minX, _maxX) == position);
this._minX = _minX;

readonly double _minX;
readonly float _minX;
readonly double _maxX;
readonly float _maxX;
public override double x(double time) {
public override float x(float time) {
public override bool isDone(double time) {
public override bool isDone(float time) {
return base.isDone(time) ||
(this.x(time) - this._minX).abs() < this.tolerance.distance ||
(this.x(time) - this._maxX).abs() < this.tolerance.distance;

24
Runtime/physics/gravity_simulation.cs


namespace Unity.UIWidgets.physics {
public class GravitySimulation : Simulation {
public GravitySimulation(
double acceleration,
double distance,
double endDistance,
double velocity
float acceleration,
float distance,
float endDistance,
float velocity
) {
D.assert(endDistance >= 0);
this._a = acceleration;

}
readonly double _x;
readonly double _v;
readonly double _a;
readonly double _end;
readonly float _x;
readonly float _v;
readonly float _a;
readonly float _end;
public override double x(double time) {
return this._x + this._v * time + 0.5 * this._a * time * time;
public override float x(float time) {
return this._x + this._v * time + 0.5f * this._a * time * time;
public override double dx(double time) {
public override float dx(float time) {
public override bool isDone(double time) {
public override bool isDone(float time) {
return this.x(time).abs() >= this._end;
}
}

6
Runtime/physics/simulation.cs


this.tolerance = tolerance ?? Tolerance.defaultTolerance;
}
public abstract double x(double time);
public abstract float x(float time);
public abstract double dx(double time);
public abstract float dx(float time);
public abstract bool isDone(double time);
public abstract bool isDone(float time);
public Tolerance tolerance;
}

64
Runtime/physics/spring_simulation.cs


public class SpringSimulation : Simulation {
public SpringSimulation(
SpringDescription spring,
double start,
double end,
double velocity,
float start,
float end,
float velocity,
Tolerance tolerance = null
) : base(tolerance: tolerance) {
this._endPosition = end;

protected readonly double _endPosition;
protected readonly float _endPosition;
readonly _SpringSolution _solution;
public SpringType type {

public override double x(double time) {
public override float x(float time) {
public override double dx(double time) {
public override float dx(float time) {
public override bool isDone(double time) {
public override bool isDone(float time) {
return PhysicsUtils.nearZero(this._solution.x(time), this.tolerance.distance) &&
PhysicsUtils.nearZero(this._solution.dx(time), this.tolerance.velocity);
}

public class ScrollSpringSimulation : SpringSimulation {
public ScrollSpringSimulation(
SpringDescription spring,
double start,
double end,
double velocity,
float start,
float end,
float velocity,
public override double x(double time) {
public override float x(float time) {
return this.isDone(time) ? this._endPosition : base.x(time);
}
}

}
if (cmk > 0.0) {
return _OverdampedSolution.create(spring, initialPosition, initialVelocity);
return create(spring, initialPosition, initialVelocity);
public abstract double x(double time);
public abstract double dx(double time);
public abstract float x(float time);
public abstract float dx(float time);
public abstract SpringType type { get; }
}

readonly double _r, _c1, _c2;
public override double x(double time) {
return (this._c1 + this._c2 * time) * Math.Pow(Math.E, this._r * time);
public override float x(float time) {
return (float) ((this._c1 + this._c2 * time) * Math.Pow(Math.E, this._r * time));
public override double dx(double time) {
public override float dx(float time) {
return this._r * (this._c1 + this._c2 * time) * power + this._c2 * power;
return (float) (this._r * (this._c1 + this._c2 * time) * power + this._c2 * power);
}
public override SpringType type {

class _OverdampedSolution : _SpringSolution {
internal new static _OverdampedSolution create(
SpringDescription spring,
double distance,
double velocity
float distance,
float velocity
) {
double cmk = spring.damping * spring.damping - 4 * spring.mass * spring.stiffness;
double r1 = (-spring.damping - Math.Sqrt(cmk)) / (2.0 * spring.mass);

readonly double _r1, _r2, _c1, _c2;
public override double x(double time) {
return this._c1 * Math.Pow(Math.E, this._r1 * time) +
this._c2 * Math.Pow(Math.E, this._r2 * time);
public override float x(float time) {
return (float) (this._c1 * Math.Pow(Math.E, this._r1 * time) +
this._c2 * Math.Pow(Math.E, this._r2 * time));
public override double dx(double time) {
return this._c1 * this._r1 * Math.Pow(Math.E, this._r1 * time) +
this._c2 * this._r2 * Math.Pow(Math.E, this._r2 * time);
public override float dx(float time) {
return (float) (this._c1 * this._r1 * Math.Pow(Math.E, this._r1 * time) +
this._c2 * this._r2 * Math.Pow(Math.E, this._r2 * time));
}
public override SpringType type {

readonly double _w, _r, _c1, _c2;
public override double x(double time) {
return Math.Pow(Math.E, this._r * time) *
(this._c1 * Math.Cos(this._w * time) + this._c2 * Math.Sin(this._w * time));
public override float x(float time) {
return (float) (Math.Pow(Math.E, this._r * time) *
(this._c1 * Math.Cos(this._w * time) + this._c2 * Math.Sin(this._w * time)));
public override double dx(double time) {
public override float dx(float time) {
return power * (this._c2 * this._w * cosine - this._c1 * this._w * sine) +
this._r * power * (this._c2 * sine + this._c1 * cosine);
return (float) (power * (this._c2 * this._w * cosine - this._c1 * this._w * sine) +
this._r * power * (this._c2 * sine + this._c1 * cosine));
}
public override SpringType type {

14
Runtime/physics/tolerance.cs


namespace Unity.UIWidgets.physics {
public class Tolerance {
public Tolerance(
double distance = _epsilonDefault,
double time = _epsilonDefault,
double velocity = _epsilonDefault
float distance = _epsilonDefault,
float time = _epsilonDefault,
float velocity = _epsilonDefault
) {
this.distance = distance;
this.time = time;

const double _epsilonDefault = 1e-3;
const float _epsilonDefault = 1e-3f;
public readonly double distance;
public readonly float distance;
public readonly double time;
public readonly float time;
public readonly double velocity;
public readonly float velocity;
public override string ToString() {
return $"Tolerance(distance: ±{this.distance}, time: ±{this.time}, velocity: ±{this.velocity})";

2
Runtime/rendering/animated_size.cs


void _restartAnimation() {
this._lastValue = 0.0;
this._controller.forward(from: 0.0);
this._controller.forward(from: 0.0f);
}
void _layoutStart() {

186
Runtime/rendering/box.cs


public class BoxConstraints : Constraints, IEquatable<BoxConstraints> {
public BoxConstraints(
double minWidth = 0.0,
double maxWidth = double.PositiveInfinity,
double minHeight = 0.0,
double maxHeight = double.PositiveInfinity) {
float minWidth = 0.0f,
float maxWidth = float.PositiveInfinity,
float minHeight = 0.0f,
float maxHeight = float.PositiveInfinity) {
this.minWidth = minWidth;
this.maxWidth = maxWidth;
this.minHeight = minHeight;

public readonly double minWidth;
public readonly double maxWidth;
public readonly double minHeight;
public readonly double maxHeight;
public readonly float minWidth;
public readonly float maxWidth;
public readonly float minHeight;
public readonly float maxHeight;
public static BoxConstraints tight(Size size) {
return new BoxConstraints(

}
public static BoxConstraints tightFor(
double? width = null,
double? height = null
float? width = null,
float? height = null
width ?? 0.0,
width ?? double.PositiveInfinity,
height ?? 0.0,
height ?? double.PositiveInfinity
width ?? 0.0f,
width ?? float.PositiveInfinity,
height ?? 0.0f,
height ?? float.PositiveInfinity
double width = double.PositiveInfinity,
double height = double.PositiveInfinity
float width = float.PositiveInfinity,
float height = float.PositiveInfinity
!double.IsPositiveInfinity(width) ? width : 0.0,
!double.IsPositiveInfinity(width) ? width : double.PositiveInfinity,
!double.IsPositiveInfinity(height) ? height : 0.0,
!double.IsPositiveInfinity(height) ? height : double.PositiveInfinity
!double.IsPositiveInfinity(width) ? width : 0.0f,
!double.IsPositiveInfinity(width) ? width : float.PositiveInfinity,
!double.IsPositiveInfinity(height) ? height : 0.0f,
!double.IsPositiveInfinity(height) ? height : float.PositiveInfinity
);
}

}
public static BoxConstraints expand(
double? width = null,
double? height = null
float? width = null,
float? height = null
width ?? double.PositiveInfinity,
width ?? double.PositiveInfinity,
height ?? double.PositiveInfinity,
height ?? double.PositiveInfinity
width ?? float.PositiveInfinity,
width ?? float.PositiveInfinity,
height ?? float.PositiveInfinity,
height ?? float.PositiveInfinity
double? minWidth = null,
double? maxWidth = null,
double? minHeight = null,
double? maxHeight = null
float? minWidth = null,
float? maxWidth = null,
float? minHeight = null,
float? maxHeight = null
) {
return new BoxConstraints(
minWidth ?? this.minWidth,

public BoxConstraints deflate(EdgeInsets edges) {
D.assert(edges != null);
D.assert(this.debugAssertIsValid());
double horizontal = edges.horizontal;
double vertical = edges.vertical;
double deflatedMinWidth = Math.Max(0.0, this.minWidth - horizontal);
double deflatedMinHeight = Math.Max(0.0, this.minHeight - vertical);
float horizontal = edges.horizontal;
float vertical = edges.vertical;
float deflatedMinWidth = (float) Math.Max(0.0, this.minWidth - horizontal);
float deflatedMinHeight = (float) Math.Max(0.0, this.minHeight - vertical);
return new BoxConstraints(
minWidth: deflatedMinWidth,
maxWidth: Math.Max(deflatedMinWidth, this.maxWidth - horizontal),

public BoxConstraints loosen() {
D.assert(this.debugAssertIsValid());
return new BoxConstraints(
minWidth: 0.0,
minWidth: 0.0f,
minHeight: 0.0,
minHeight: 0.0f,
maxHeight: this.maxHeight
);
}

}
public BoxConstraints tighten(
double? width = null,
double? height = null
float? width = null,
float? height = null
) {
return new BoxConstraints(
minWidth: width == null ? this.minWidth : width.Value.clamp(this.minWidth, this.maxWidth),

return new BoxConstraints(minHeight: this.minHeight, maxHeight: this.maxHeight);
}
public double constrainWidth(double width = double.PositiveInfinity) {
public float constrainWidth(float width = float.PositiveInfinity) {
public double constrainHeight(double height = double.PositiveInfinity) {
public float constrainHeight(float height = float.PositiveInfinity) {
D.assert(this.debugAssertIsValid());
return height.clamp(this.minHeight, this.maxHeight);
}

return result;
}
public Size constrainDimensions(double width, double height) {
public Size constrainDimensions(float width, float height) {
return new Size(this.constrainWidth(width), this.constrainHeight(height));
}

return result1;
}
double width = size.width;
double height = size.height;
float width = size.width;
float height = size.height;
double aspectRatio = width / height;
float aspectRatio = width / height;
if (width > this.maxWidth) {
width = this.maxWidth;

}
public Size smallest {
get { return new Size(this.constrainWidth(0.0), this.constrainHeight(0.0)); }
get { return new Size(this.constrainWidth(0.0f), this.constrainHeight(0.0f)); }
}
public bool hasTightWidth {

this.minHeight <= size.height && size.height <= this.maxHeight;
}
public static BoxConstraints operator *(BoxConstraints it, double factor) {
public static BoxConstraints operator *(BoxConstraints it, float factor) {
return new BoxConstraints(
minWidth: it.minWidth * factor,
maxWidth: it.maxWidth * factor,

}
public static BoxConstraints operator /(BoxConstraints it, double factor) {
public static BoxConstraints operator /(BoxConstraints it, float factor) {
return new BoxConstraints(
minWidth: it.minWidth / factor,
maxWidth: it.maxWidth / factor,

}
public static BoxConstraints operator %(BoxConstraints it, double value) {
public static BoxConstraints operator %(BoxConstraints it, float value) {
return new BoxConstraints(
minWidth: it.minWidth % value,
maxWidth: it.maxWidth % value,

}
public static BoxConstraints lerp(BoxConstraints a, BoxConstraints b, double t) {
public static BoxConstraints lerp(BoxConstraints a, BoxConstraints b, float t) {
if (a == null && b == null) {
return null;
}

}
if (b == null) {
return a * (1.0 - t);
return a * (1.0f - t);
}
D.assert(a.debugAssertIsValid());

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

return this;
}
var minWidth = this.minWidth >= 0.0 ? this.minWidth : 0.0;
var minHeight = this.minHeight >= 0.0 ? this.minHeight : 0.0;
var minWidth = this.minWidth >= 0.0 ? this.minWidth : 0.0f;
var minHeight = this.minHeight >= 0.0 ? this.minHeight : 0.0f;
return new BoxConstraints(
minWidth,

}
}
Dictionary<_IntrinsicDimensionsCacheEntry, double> _cachedIntrinsicDimensions;
Dictionary<_IntrinsicDimensionsCacheEntry, float> _cachedIntrinsicDimensions;
double _computeIntrinsicDimension(_IntrinsicDimension dimension, double argument,
Func<double, double> computer) {
float _computeIntrinsicDimension(_IntrinsicDimension dimension, float argument,
Func<float, float> computer) {
D.assert(debugCheckingIntrinsics || !this.debugDoingThisResize);
bool shouldCache = true;
D.assert(() => {

if (shouldCache) {
this._cachedIntrinsicDimensions =
this._cachedIntrinsicDimensions
?? new Dictionary<_IntrinsicDimensionsCacheEntry, double>();
?? new Dictionary<_IntrinsicDimensionsCacheEntry, float>();
return this._cachedIntrinsicDimensions.putIfAbsent(
new _IntrinsicDimensionsCacheEntry(dimension, argument),
() => computer(argument));

}
public double getMinIntrinsicWidth(double height) {
public float getMinIntrinsicWidth(float height) {
D.assert(() => {
if (height < 0.0) {
throw new UIWidgetsError(

return this._computeIntrinsicDimension(_IntrinsicDimension.minWidth, height, this.computeMinIntrinsicWidth);
}
protected virtual double computeMinIntrinsicWidth(double height) {
return 0.0;
protected virtual float computeMinIntrinsicWidth(float height) {
return 0.0f;
public double getMaxIntrinsicWidth(double height) {
public float getMaxIntrinsicWidth(float height) {
D.assert(() => {
if (height < 0.0) {
throw new UIWidgetsError(

return this._computeIntrinsicDimension(_IntrinsicDimension.maxWidth, height, this.computeMaxIntrinsicWidth);
}
protected virtual double computeMaxIntrinsicWidth(double height) {
return 0.0;
protected virtual float computeMaxIntrinsicWidth(float height) {
return 0.0f;
public double getMinIntrinsicHeight(double width) {
public float getMinIntrinsicHeight(float width) {
D.assert(() => {
if (width < 0.0) {
throw new UIWidgetsError(

this.computeMinIntrinsicHeight);
}
protected virtual double computeMinIntrinsicHeight(double width) {
return 0.0;
protected virtual float computeMinIntrinsicHeight(float width) {
return 0.0f;
public double getMaxIntrinsicHeight(double width) {
public float getMaxIntrinsicHeight(float width) {
D.assert(() => {
if (width < 0.0) {
throw new UIWidgetsError(

this.computeMaxIntrinsicHeight);
}
protected virtual double computeMaxIntrinsicHeight(double width) {
return 0.0;
protected virtual float computeMaxIntrinsicHeight(float width) {
return 0.0f;
}
public bool hasSize {

this.size = this.size;
}
Dictionary<TextBaseline, double?> _cachedBaselines;
Dictionary<TextBaseline, float?> _cachedBaselines;
static bool _debugDoingBaseline = false;
static bool _debugSetDoingBaseline(bool value) {

public double? getDistanceToBaseline(TextBaseline baseline, bool onlyReal = false) {
public float? getDistanceToBaseline(TextBaseline baseline, bool onlyReal = false) {
D.assert(!_debugDoingBaseline,
"Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
D.assert(!this.debugNeedsLayout);

});
D.assert(_debugSetDoingBaseline(true));
double? result = this.getDistanceToActualBaseline(baseline);
float? result = this.getDistanceToActualBaseline(baseline);
D.assert(_debugSetDoingBaseline(false));
if (result == null && !onlyReal) {

return result;
}
public virtual double? getDistanceToActualBaseline(TextBaseline baseline) {
public virtual float? getDistanceToActualBaseline(TextBaseline baseline) {
this._cachedBaselines = this._cachedBaselines ?? new Dictionary<TextBaseline, double?>();
this._cachedBaselines = this._cachedBaselines ?? new Dictionary<TextBaseline, float?>();
protected virtual double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected virtual float? computeDistanceToActualBaseline(TextBaseline baseline) {
D.assert(_debugDoingBaseline,
"Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");

var failures = new StringBuilder();
int failureCount = 0;
var testIntrinsic = new Func<Func<double, double>, string, double, double>(
var testIntrinsic = new Func<Func<float, float>, string, float, float>(
double result = function(constraint);
float result = function(constraint);
if (result < 0) {
failures.AppendLine(" * " + name + "(" + constraint + ") returned a negative value: " +
result);

if (!result.isFinite()) {
if (float.IsInfinity(result)) {
return result;
return (float) result;
new Action<Func<double, double>, Func<double, double>, string, double>(
new Action<Func<float, float>, Func<float, float>, string, float>(
double min = testIntrinsic(getMin, "getMinIntrinsic" + name, constraint);
double max = testIntrinsic(getMax, "getMaxIntrinsic" + name, constraint);
float min = testIntrinsic(getMin, "getMinIntrinsic" + name, constraint);
float max = testIntrinsic(getMax, "getMaxIntrinsic" + name, constraint);
if (min > max) {
failures.AppendLine(
" * getMinIntrinsic" + name + "(" + constraint + ") returned a larger value (" +

});
testIntrinsicsForValues(this.getMinIntrinsicWidth, this.getMaxIntrinsicWidth, "Width",
double.PositiveInfinity);
float.PositiveInfinity);
double.PositiveInfinity);
float.PositiveInfinity);
this.constraints.maxWidth);
(float) this.constraints.maxWidth);
this.constraints.maxHeight);
(float) this.constraints.maxHeight);
}
debugCheckingIntrinsics = false;

12
Runtime/rendering/box.mixin.gen.cs


: ContainerRenderObjectMixinRenderBox<ChildType, ParentDataType>
where ChildType : RenderBox
where ParentDataType : ContainerParentDataMixinBoxParentData<ChildType> {
public double? defaultComputeDistanceToFirstActualBaseline(TextBaseline baseline) {
public float? defaultComputeDistanceToFirstActualBaseline(TextBaseline baseline) {
double? result = child.getDistanceToActualBaseline(baseline);
float? result = child.getDistanceToActualBaseline(baseline);
if (result != null) {
return result.Value + childParentData.offset.dy;
}

return null;
}
public double? defaultComputeDistanceToHighestActualBaseline(TextBaseline baseline) {
double? result = null;
public float? defaultComputeDistanceToHighestActualBaseline(TextBaseline baseline) {
float? result = null;
double? candidate = child.getDistanceToActualBaseline(baseline);
float? candidate = child.getDistanceToActualBaseline(baseline);
result = Math.Min(result.Value, candidate.Value);
result = (float) Math.Min(result.Value, candidate.Value);
}
else {
result = candidate;

32
Runtime/rendering/custom_layout.cs


return constraints.constrain(this._delegate.getSize(constraints));
}
protected override double computeMinIntrinsicWidth(double height) {
double width = this._getSize(BoxConstraints.tightForFinite(height: height)).width;
if (width.isFinite()) {
protected override float computeMinIntrinsicWidth(float height) {
float width = (float) this._getSize(BoxConstraints.tightForFinite(height: height)).width;
if (!float.IsInfinity(width)) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicWidth(double height) {
double width = this._getSize(BoxConstraints.tightForFinite(height: height)).width;
if (width.isFinite()) {
protected override float computeMaxIntrinsicWidth(float height) {
float width = (float) this._getSize(BoxConstraints.tightForFinite(height: height)).width;
if (!float.IsInfinity(width)) {
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
double height = this._getSize(BoxConstraints.tightForFinite(width: width)).height;
if (height.isFinite()) {
protected override float computeMinIntrinsicHeight(float width) {
float height = (float) this._getSize(BoxConstraints.tightForFinite(width: width)).height;
if (!float.IsInfinity(height)) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
double height = this._getSize(BoxConstraints.tightForFinite(width: width)).height;
if (height.isFinite()) {
protected override float computeMaxIntrinsicHeight(float width) {
float height = (float) this._getSize(BoxConstraints.tightForFinite(width: width)).height;
if (!float.IsInfinity(height)) {
return 0.0;
return 0.0f;
}
protected override void performLayout() {

2
Runtime/rendering/custom_paint.cs


return true;
});
if (offset != Offset.zero) {
canvas.translate(offset.dx, offset.dy);
canvas.translate((float) offset.dx, (float) offset.dy);
}
painter.paint(canvas, this.size);

82
Runtime/rendering/editable.cs


public class RenderEditable : RenderBox {
public static readonly char obscuringCharacter = '•';
static readonly double _kCaretGap = 1.0;
static readonly double _kCaretHeightOffset = 2.0;
static readonly double _kCaretWidth = 1.0;
static readonly float _kCaretGap = 1.0f;
static readonly float _kCaretHeightOffset = 2.0f;
static readonly float _kCaretWidth = 1.0f;
TextPainter _textPainter;
Color _cursorColor;

public SelectionChangedHandler onSelectionChanged;
public CaretChangedHandler onCaretChanged;
Rect _lastCaretRect;
double? _textLayoutLastWidth;
float? _textLayoutLastWidth;
List<TextBox> _selectionRects;
Rect _caretPrototype;
bool _hasVisualOverflow = false;

ValueNotifier<bool> showCursor,
TextAlign textAlign = TextAlign.left, double textScaleFactor = 1.0, Color cursorColor = null,
TextAlign textAlign = TextAlign.left, float textScaleFactor = 1.0f, Color cursorColor = null,
bool? hasFocus = null, int? maxLines = 1, Color selectionColor = null,
TextSelection selection = null, bool obscureText = false, SelectionChangedHandler onSelectionChanged = null,
CaretChangedHandler onCaretChanged = null, bool ignorePointer = false) {

}
}
public double textScaleFactor {
public float textScaleFactor {
get { return this._textPainter.textScaleFactor; }
set {
if (this._textPainter.textScaleFactor == value) {

}
}
public double preferredLineHeight {
public float preferredLineHeight {
get { return this._textPainter.preferredLineHeight; }
}

///
public List<TextSelectionPoint> getEndpointsForSelection(TextSelection selection) {
D.assert(this.constraints != null);
this._layoutText(this.constraints.maxWidth);
this._layoutText((float) this.constraints.maxWidth);
var start = new Offset(0.0, this.preferredLineHeight) + caretOffset + paintOffset;
var start = new Offset(0.0f, this.preferredLineHeight) + caretOffset + paintOffset;
return new List<TextSelectionPoint> {new TextSelectionPoint(start, null)};
}
else {

}
public TextPosition getPositionForPoint(Offset globalPosition) {
this._layoutText(this.constraints.maxWidth);
this._layoutText((float) this.constraints.maxWidth);
this._layoutText(this.constraints.maxWidth);
this._layoutText((float) this.constraints.maxWidth);
return Rect.fromLTWH(0.0, 0.0, _kCaretWidth, this.preferredLineHeight)
return Rect.fromLTWH(0.0f, 0.0f, _kCaretWidth, this.preferredLineHeight)
.shift(caretOffset + this._paintOffset);
}

return new TextPosition(line.start, affinity ?? position.affinity);
}
protected override double computeMinIntrinsicWidth(double height) {
this._layoutText(double.PositiveInfinity);
protected override float computeMinIntrinsicWidth(float height) {
this._layoutText(float.PositiveInfinity);
protected override double computeMaxIntrinsicWidth(double height) {
this._layoutText(double.PositiveInfinity);
protected override float computeMaxIntrinsicWidth(float height) {
this._layoutText(float.PositiveInfinity);
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
this._layoutText(this.constraints.maxWidth);
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
this._layoutText((float) this.constraints.maxWidth);
return this._textPainter.computeDistanceToActualBaseline(baseline);
}

}
public void handleTap() {
this._layoutText(this.constraints.maxWidth);
this._layoutText((float) this.constraints.maxWidth);
D.assert(this._lastTapDownPosition != null);
if (this.onSelectionChanged != null) {
var position = this._textPainter.getPositionForOffset(this.globalToLocal(this._lastTapDownPosition));

}
void selectWord(SelectionChangedCause? cause = null) {
this._layoutText(this.constraints.maxWidth);
this._layoutText((float) this.constraints.maxWidth);
D.assert(this._lastTapDownPosition != null);
if (this.onSelectionChanged != null) {
TextPosition position =

}
protected override void performLayout() {
this._layoutText(this.constraints.maxWidth);
this._caretPrototype = Rect.fromLTWH(0.0, _kCaretHeightOffset, _kCaretWidth,
this.preferredLineHeight - 2.0 * _kCaretHeightOffset);
this._layoutText((float) this.constraints.maxWidth);
this._caretPrototype = Rect.fromLTWH(0.0f, _kCaretHeightOffset, _kCaretWidth,
this.preferredLineHeight - 2.0f * _kCaretHeightOffset);
this.constraints.constrainHeight(this._preferredHeight(this.constraints.maxWidth)));
this.constraints.constrainHeight(this._preferredHeight((float) this.constraints.maxWidth)));
this.offset.applyContentDimensions(0.0, _maxScrollExtent);
this.offset.applyContentDimensions(0.0f, _maxScrollExtent);
this._layoutText(this.constraints.maxWidth);
this._layoutText((float) this.constraints.maxWidth);
if (this._hasVisualOverflow) {
context.pushClipRect(this.needsCompositing, offset, Offset.zero & this.size, this._paintContents);
}

// todo
}
double _preferredHeight(double width) {
float _preferredHeight(float width) {
if (this.maxLines != null) {
return this.preferredLineHeight * this.maxLines.Value;
}

}
this._layoutText(width);
return Math.Max(this.preferredLineHeight, this._textPainter.height);
return (float) Math.Max(this.preferredLineHeight, this._textPainter.height);
void _layoutText(double constraintWidth) {
void _layoutText(float constraintWidth) {
var avialableWidth = Math.Max(0.0, constraintWidth - caretMargin);
var maxWidth = this._isMultiline ? avialableWidth : double.PositiveInfinity;
var avialableWidth = (float) Math.Max(0.0, constraintWidth - caretMargin);
var maxWidth = this._isMultiline ? avialableWidth : float.PositiveInfinity;
this._textPainter.layout(minWidth: avialableWidth, maxWidth: maxWidth);
this._textLayoutLastWidth = constraintWidth;
}

get {
switch (this._viewportAxis) {
case Axis.horizontal:
return new Offset(-this.offset.pixels, 0.0);
return new Offset(-this.offset.pixels, 0.0f);
return new Offset(0.0, -this.offset.pixels);
return new Offset(0.0f, -this.offset.pixels);
}
return null;

double _viewportExtend {
float _viewportExtend {
get {
D.assert(this.hasSize);
switch (this._viewportAxis) {

return this.size.height;
}
return 0.0;
return 0.0f;
double _getMaxScrollExtend(Size contentSize) {
float _getMaxScrollExtend(Size contentSize) {
return Math.Max(0.0, contentSize.width - this.size.width);
return (float) Math.Max(0.0, contentSize.width - this.size.width);
return Math.Max(0.0, contentSize.height - this.size.height);
return (float) Math.Max(0.0, contentSize.height - this.size.height);
return 0.0;
return 0.0f;
}

4
Runtime/rendering/error.cs


static TextStyle textStyle = new TextStyle(
color: new Color(0xFFFFFF66),
fontFamily: "monospace",
fontSize: 14.0,
fontSize: 14.0f,
lineHeight: 1.0
lineHeight: 1.0f
);
}
}

90
Runtime/rendering/flex.cs


baseline,
}
public delegate double _ChildSizingFunction(RenderBox child, double extent);
public delegate float _ChildSizingFunction(RenderBox child, float extent);
public class RenderFlex : RenderBoxContainerDefaultsMixinContainerRenderObjectMixinRenderBox<RenderBox,
FlexParentData> {

}
}
public double _getIntrinsicSize(
public float _getIntrinsicSize(
double extent,
float extent,
double totalFlex = 0.0;
double inflexibleSpace = 0.0;
double maxFlexFractionSoFar = 0.0;
float totalFlex = 0.0f;
float inflexibleSpace = 0.0f;
float maxFlexFractionSoFar = 0.0f;
RenderBox child = this.firstChild;
while (child != null) {

double flexFraction = childSize(child, extent) / this._getFlex(child);
maxFlexFractionSoFar = Math.Max(maxFlexFractionSoFar, flexFraction);
} else {
maxFlexFractionSoFar = (float) Math.Max(maxFlexFractionSoFar, flexFraction);
}
else {
inflexibleSpace += childSize(child, extent);
}

return maxFlexFractionSoFar * totalFlex + inflexibleSpace;
} else {
}
else {
double inflexibleSpace = 0.0;
double maxCrossSize = 0.0;
float inflexibleSpace = 0.0f;
float maxCrossSize = 0.0f;
double mainSize = 0.0;
double crossSize = 0.0;
float mainSize = 0.0f;
float crossSize = 0.0f;
mainSize = child.getMaxIntrinsicWidth(double.PositiveInfinity);
mainSize = child.getMaxIntrinsicWidth(float.PositiveInfinity);
mainSize = child.getMaxIntrinsicHeight(double.PositiveInfinity);
mainSize = child.getMaxIntrinsicHeight(float.PositiveInfinity);
crossSize = childSize(child, mainSize);
break;
}

child = childParentData.nextSibling;
}
double spacePerFlex = Math.Max(0.0, (availableMainSpace - inflexibleSpace) / totalFlex);
float spacePerFlex = (float) Math.Max(0.0, (availableMainSpace - inflexibleSpace) / totalFlex);
child = this.firstChild;
while (child != null) {

}
}
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
childSize: (RenderBox child, double extent) => child.getMinIntrinsicWidth(extent)
childSize: (RenderBox child, float extent) => child.getMinIntrinsicWidth(extent)
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
childSize: (RenderBox child, double extent) => child.getMaxIntrinsicWidth(extent)
childSize: (RenderBox child, float extent) => child.getMaxIntrinsicWidth(extent)
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
childSize: (RenderBox child, double extent) => child.getMinIntrinsicHeight(extent)
childSize: (RenderBox child, float extent) => child.getMinIntrinsicHeight(extent)
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
childSize: (RenderBox child, double extent) => child.getMaxIntrinsicHeight(extent)
childSize: (RenderBox child, float extent) => child.getMaxIntrinsicHeight(extent)
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
if (this._direction == Axis.horizontal) {
return this.defaultComputeDistanceToHighestActualBaseline(baseline);
}

if (flex > 0) {
totalFlex += childParentData.flex;
lastFlexChild = child;
} else {
}
else {
BoxConstraints innerConstraints = null;
if (this.crossAxisAlignment == CrossAxisAlignment.stretch) {
switch (this._direction) {

maxWidth: this.constraints.maxWidth);
break;
}
} else {
}
else {
switch (this._direction) {
case Axis.horizontal:
innerConstraints = new BoxConstraints(

switch (this._direction) {
case Axis.horizontal:
innerConstraints = new BoxConstraints(
minWidth: minChildExtent,
maxWidth: maxChildExtent,
minWidth: (float) minChildExtent,
maxWidth: (float) maxChildExtent,
minHeight: this.constraints.maxHeight,
maxHeight: this.constraints.maxHeight);
break;

maxWidth: this.constraints.maxWidth,
minHeight: minChildExtent,
maxHeight: maxChildExtent);
minHeight: (float) minChildExtent,
maxHeight: (float) maxChildExtent);
} else {
}
else {
minWidth: minChildExtent,
maxWidth: maxChildExtent,
minWidth: (float) minChildExtent,
maxWidth: (float) maxChildExtent,
minHeight: minChildExtent,
maxHeight: maxChildExtent);
minHeight: (float) minChildExtent,
maxHeight: (float) maxChildExtent);
break;
}
}

double actualSizeDelta = 0.0;
switch (this._direction) {
case Axis.horizontal:
this.size = this.constraints.constrain(new Size(idealSize, crossSize));
this.size = this.constraints.constrain(new Size((float) idealSize, (float) crossSize));
this.size = this.constraints.constrain(new Size(crossSize, idealSize));
this.size = this.constraints.constrain(new Size((float) crossSize, (float) idealSize));
actualSize = this.size.height;
crossSize = this.size.width;
break;

switch (this._direction) {
case Axis.horizontal:
childParentData.offset = new Offset(childMainPosition, childCrossPosition);
childParentData.offset = new Offset((float) childMainPosition, (float) childCrossPosition);
childParentData.offset = new Offset(childCrossPosition, childMainPosition);
childParentData.offset = new Offset((float) childCrossPosition, (float) childMainPosition);
} else {
}
else {
childMainPosition += this._getMainSize(child) + betweenSpace;
}

return this.defaultHitTestChildren(result, position: position);
}
}
}
}

44
Runtime/rendering/image.cs


class RenderImage : RenderBox {
public RenderImage(
Image image = null,
double? width = null,
double? height = null,
double scale = 1.0,
float? width = null,
float? height = null,
float scale = 1.0f,
Color color = null,
BlendMode colorBlendMode = BlendMode.srcIn,
BoxFit? fit = null,

}
}
double? _width;
float? _width;
public double? width {
public float? width {
get { return this._width; }
set {
if (value == this._width) {

}
}
double? _height;
float? _height;
public double? height {
public float? height {
get { return this._height; }
set {
if (value == this._height) {

}
}
double _scale;
float _scale;
public double scale {
public float scale {
get { return this._scale; }
set {
if (value == this._scale) {

}
return constraints.constrainSizeAndAttemptToPreserveAspectRatio(new Size(
this._image.width / this._scale,
this._image.height / this._scale
(float) (this._image.width / this._scale),
(float) (this._image.height / this._scale)
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
return this._sizeForConstraints(BoxConstraints.tightForFinite(height: height)).width;
return (float) this._sizeForConstraints(BoxConstraints.tightForFinite(height: height)).width;
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
return this._sizeForConstraints(BoxConstraints.tightForFinite(height: height)).width;
return (float) this._sizeForConstraints(BoxConstraints.tightForFinite(height: height)).width;
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
return this._sizeForConstraints(BoxConstraints.tightForFinite(width: width)).height;
return (float) this._sizeForConstraints(BoxConstraints.tightForFinite(width: width)).height;
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
return this._sizeForConstraints(BoxConstraints.tightForFinite(width: width)).height;
return (float) this._sizeForConstraints(BoxConstraints.tightForFinite(width: width)).height;
}
protected override bool hitTestSelf(Offset position) {

properties.add(new EnumProperty<FilterMode>("filterMode", this.filterMode));
}
}
}
}

46
Runtime/rendering/list_body.cs


public class ListBodyParentData : ContainerParentDataMixinBoxParentData<RenderBox> {
}
delegate double __ChildSizingFunction(RenderBox child);
delegate float __ChildSizingFunction(RenderBox child);
public class RenderListBody : RenderBoxContainerDefaultsMixinContainerRenderObjectMixinRenderBox<RenderBox,

while (child != null) {
child.layout(innerConstraints, parentUsesSize: true);
ListBodyParentData childParentData = (ListBodyParentData) child.parentData;
childParentData.offset = new Offset(mainAxisExtent, 0.0);
childParentData.offset = new Offset((float) mainAxisExtent, 0.0f);
this.size = this.constraints.constrain(new Size(mainAxisExtent, this.constraints.maxHeight));
this.size = this.constraints.constrain(new Size((float) mainAxisExtent,
this.constraints.maxHeight));
break;
case AxisDirection.left:
innerConstraints = BoxConstraints.tightFor(height: this.constraints.maxHeight);

while (child != null) {
ListBodyParentData childParentData = (ListBodyParentData) child.parentData;
position += child.size.width;
childParentData.offset = new Offset(mainAxisExtent - position, 0.0);
childParentData.offset = new Offset((float) (mainAxisExtent - position), 0.0f);
this.size = this.constraints.constrain(new Size(mainAxisExtent, this.constraints.maxHeight));
this.size = this.constraints.constrain(new Size((float) mainAxisExtent,
this.constraints.maxHeight));
break;
case AxisDirection.down:
innerConstraints = BoxConstraints.tightFor(width: this.constraints.maxWidth);

childParentData.offset = new Offset(0.0, mainAxisExtent);
childParentData.offset = new Offset(0.0f, (float) mainAxisExtent);
this.size = this.constraints.constrain(new Size(this.constraints.maxWidth, mainAxisExtent));
this.size = this.constraints.constrain(new Size(this.constraints.maxWidth, (float) mainAxisExtent));
break;
case AxisDirection.up:
innerConstraints = BoxConstraints.tightFor(width: this.constraints.maxWidth);

while (child != null) {
ListBodyParentData childParentData = (ListBodyParentData) child.parentData;
position += child.size.height;
childParentData.offset = new Offset(0.0, mainAxisExtent - position);
childParentData.offset = new Offset(0.0f, (float) (mainAxisExtent - position));
this.size = this.constraints.constrain(new Size(this.constraints.maxWidth, mainAxisExtent));
this.size = this.constraints.constrain(new Size(this.constraints.maxWidth, (float) mainAxisExtent));
break;
}

properties.add(new EnumProperty<AxisDirection>("axisDirection", this.axisDirection));
}
double _getIntrinsicCrossAxis(__ChildSizingFunction childSize) {
double extent = 0.0;
float _getIntrinsicCrossAxis(__ChildSizingFunction childSize) {
float extent = 0.0f;
RenderBox child = this.firstChild;
while (child != null) {
extent = Math.Max(extent, childSize(child));

return extent;
}
double _getIntrinsicMainAxis(__ChildSizingFunction childSize) {
double extent = 0.0;
float _getIntrinsicMainAxis(__ChildSizingFunction childSize) {
float extent = 0.0f;
RenderBox child = this.firstChild;
while (child != null) {
extent += childSize(child);

}
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
switch (this.mainAxis) {
case Axis.horizontal:
return this._getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicWidth(height));

D.assert(false);
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
switch (this.mainAxis) {
case Axis.horizontal:
return this._getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicWidth(height));

D.assert(false);
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
switch (this.mainAxis) {
case Axis.horizontal:
return this._getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicHeight(width));

D.assert(false);
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
switch (this.mainAxis) {
case Axis.horizontal:
return this._getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicHeight(width));

D.assert(false);
return 0.0;
return 0.0f;
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
return this.defaultComputeDistanceToFirstActualBaseline(baseline);
}

22
Runtime/rendering/paragraph.cs


TextDirection textDirection = TextDirection.ltr,
bool softWrap = true,
TextOverflow overflow = TextOverflow.clip,
double textScaleFactor = 1.0,
float textScaleFactor = 1.0f,
int? maxLines = null
) {
D.assert(maxLines == null || maxLines > 0);

}
}
public double textScaleFactor {
public float textScaleFactor {
get { return this._textPainter.textScaleFactor; }
set {
if (Math.Abs(this._textPainter.textScaleFactor - value) < 0.00000001) {

get { return this._textPainter.size; }
}
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
double _computeIntrinsicHeight(double width) {
float _computeIntrinsicHeight(float width) {
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
this._layoutTextWithConstraints(this.constraints);
return this._textPainter.computeDistanceToActualBaseline(baseline);
}

}
}
void _layoutText(double minWidth = 0.0, double maxWidth = double.PositiveInfinity) {
void _layoutText(float minWidth = 0.0f, float maxWidth = float.PositiveInfinity) {
this._textPainter.layout(minWidth, widthMatters ? maxWidth : double.PositiveInfinity);
this._textPainter.layout(minWidth, widthMatters ? maxWidth : float.PositiveInfinity);
this._layoutText(minWidth: constraints.minWidth, maxWidth: constraints.maxWidth);
this._layoutText(minWidth: (float) constraints.minWidth, maxWidth: (float) constraints.maxWidth);
}
public override List<DiagnosticsNode> debugDescribeChildren() {

116
Runtime/rendering/proxy_box.cs


BoxConstraints _additionalConstraints;
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
return this._additionalConstraints.minWidth;
return (float) this._additionalConstraints.minWidth;
double width = base.computeMinIntrinsicWidth(height);
D.assert(width.isFinite());
float width = base.computeMinIntrinsicWidth(height);
D.assert(!float.IsInfinity(width));
return this._additionalConstraints.constrainWidth(width);
return (float) this._additionalConstraints.constrainWidth(width);
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
return this._additionalConstraints.minWidth;
return (float) this._additionalConstraints.minWidth;
double width = base.computeMaxIntrinsicWidth(height);
D.assert(width.isFinite());
float width = base.computeMaxIntrinsicWidth(height);
D.assert(!float.IsInfinity(width));
return this._additionalConstraints.constrainWidth(width);
return (float) this._additionalConstraints.constrainWidth(width);
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
return this._additionalConstraints.minHeight;
return (float) this._additionalConstraints.minHeight;
double height = base.computeMinIntrinsicHeight(width);
D.assert(height.isFinite());
float height = base.computeMinIntrinsicHeight(width);
D.assert(!float.IsInfinity(height));
return this._additionalConstraints.constrainHeight(height);
return (float) this._additionalConstraints.constrainHeight(height);
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
return this._additionalConstraints.minHeight;
return (float) this._additionalConstraints.minHeight;
double height = base.computeMaxIntrinsicHeight(width);
D.assert(height.isFinite());
float height = base.computeMaxIntrinsicHeight(width);
D.assert(!float.IsInfinity(height));
return this._additionalConstraints.constrainHeight(height);
return (float) this._additionalConstraints.constrainHeight(height);
}
return height;

public class RenderLimitedBox : RenderProxyBox {
public RenderLimitedBox(
RenderBox child = null,
double maxWidth = double.PositiveInfinity,
double maxHeight = double.PositiveInfinity
float maxWidth = float.PositiveInfinity,
float maxHeight = float.PositiveInfinity
) : base(child) {
D.assert(maxWidth >= 0.0);
D.assert(maxHeight >= 0.0);

}
public double maxWidth {
public float maxWidth {
get { return this._maxWidth; }
set {
D.assert(value >= 0.0);

}
}
double _maxWidth;
float _maxWidth;
public double maxHeight {
public float maxHeight {
get { return this._maxHeight; }
set {
D.assert(value >= 0.0);

}
}
double _maxHeight;
float _maxHeight;
BoxConstraints _limitConstraints(BoxConstraints constraints) {
return new BoxConstraints(

}
public class RenderAspectRatio : RenderProxyBox {
public RenderAspectRatio(double aspectRatio, RenderBox child = null) : base(child) {
public RenderAspectRatio(float aspectRatio, RenderBox child = null) : base(child) {
public double aspectRatio {
public float aspectRatio {
get { return this._aspectRatio; }
set {
if (this._aspectRatio == value) {

}
}
double _aspectRatio;
float _aspectRatio;
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
if (!double.IsInfinity(height)) {
return height * this._aspectRatio;
}

}
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
if (!double.IsInfinity(height)) {
return height * this._aspectRatio;
}

}
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
if (!double.IsInfinity(width)) {
return width / this._aspectRatio;
}

}
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
if (!double.IsInfinity(width)) {
return width / this._aspectRatio;
}

}
return 0.0;
return 0.0f;
}
Size _applyAspectRatio(BoxConstraints constraints) {

width = height * this._aspectRatio;
}
return constraints.constrain(new Size(width, height));
return constraints.constrain(new Size((float) width, (float) height));
}
protected override void performLayout() {

public class RenderAnimatedOpacity : RenderProxyBox {
public RenderAnimatedOpacity(
Animation<double> opacity = null,
Animation<float> opacity = null,
RenderBox child = null
) : base(child) {
D.assert(opacity != null);

bool _currentlyNeedsCompositing;
Animation<double> _opacity;
Animation<float> _opacity;
public Animation<double> opacity {
public Animation<float> opacity {
get { return this._opacity; }
set {
D.assert(value != null);

public void _updateOpacity() {
var oldAlpha = this._alpha;
this._alpha = RenderOpacity._getAlphaFromOpacity(this._opacity.value.clamp(0.0, 1.0));
this._alpha = RenderOpacity._getAlphaFromOpacity(this._opacity.value.clamp(0.0f, 1.0f));
if (oldAlpha != this._alpha) {
bool didNeedCompositing = this._currentlyNeedsCompositing;
this._currentlyNeedsCompositing = this._alpha > 0 && this._alpha < 255;

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Animation<double>>("opacity", this.opacity));
properties.add(new DiagnosticsProperty<Animation<float>>("opacity", this.opacity));
}
}

base.debugPaintSize(context, offset);
context.canvas.drawRect(this._clip.shift(offset), this._debugPaint);
this._debugText.paint(context.canvas,
offset + new Offset(this._clip.width / 8.0,
-(this._debugText.text.style.fontSize ?? 0.0) * 1.1));
offset + new Offset(this._clip.width / 8.0f,
-(this._debugText.text.style.fontSize ?? 0.0f) * 1.1f));
}
return true;

bool _offstage;
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
}
return base.computeMinIntrinsicWidth(height);

protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
if (this.offstage) {
return null;
}

base.paint,
Offset.zero,
childPaintBounds: Rect.fromLTRB(
double.NegativeInfinity,
double.NegativeInfinity,
double.PositiveInfinity,
double.PositiveInfinity
float.NegativeInfinity,
float.NegativeInfinity,
float.PositiveInfinity,
float.PositiveInfinity
)
);
}

18
Runtime/rendering/proxy_box.mixin.gen.cs


}
}
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
if (this.child != null) {
return this.child.getDistanceToActualBaseline(baseline);
}

188
Runtime/rendering/shifted_box.cs


this.child = child;
}
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
return 0.0;
return 0.0f;
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
double? result;
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
float? result;
if (this.child != null) {
D.assert(!this.debugNeedsLayout);

EdgeInsets _padding;
protected override double computeMinIntrinsicWidth(double height) {
protected override float computeMinIntrinsicWidth(float height) {
return this.child.getMinIntrinsicWidth(Math.Max(0.0, height - this._padding.vertical)) +
return this.child.getMinIntrinsicWidth((float) Math.Max(0.0, height - this._padding.vertical)) +
this._padding.horizontal;
}

protected override double computeMaxIntrinsicWidth(double height) {
protected override float computeMaxIntrinsicWidth(float height) {
return this.child.getMaxIntrinsicWidth(Math.Max(0.0, height - this._padding.vertical)) +
return this.child.getMaxIntrinsicWidth((float) Math.Max(0.0, height - this._padding.vertical)) +
this._padding.horizontal;
}

protected override double computeMinIntrinsicHeight(double width) {
protected override float computeMinIntrinsicHeight(float width) {
return this.child.getMinIntrinsicHeight(Math.Max(0.0, width - this._padding.horizontal)) +
return this.child.getMinIntrinsicHeight((float) Math.Max(0.0, width - this._padding.horizontal)) +
this._padding.vertical;
}

protected override double computeMaxIntrinsicHeight(double width) {
protected override float computeMaxIntrinsicHeight(float width) {
return this.child.getMaxIntrinsicHeight(Math.Max(0.0, width - this._padding.horizontal)) +
return this.child.getMaxIntrinsicHeight((float) Math.Max(0.0, width - this._padding.horizontal)) +
this._padding.vertical;
}

public class RenderPositionedBox : RenderAligningShiftedBox {
public RenderPositionedBox(
RenderBox child = null,
double? widthFactor = null,
double? heightFactor = null,
float? widthFactor = null,
float? heightFactor = null,
Alignment alignment = null
) : base(alignment, child) {
D.assert(widthFactor == null || widthFactor >= 0.0);

this._heightFactor = heightFactor;
}
public double? widthFactor {
public float? widthFactor {
get { return this._widthFactor; }
set {
D.assert(value == null || value >= 0.0);

}
}
double? _widthFactor;
float? _widthFactor;
public double? heightFactor {
public float? heightFactor {
get { return this._heightFactor; }
set {
D.assert(value == null || value >= 0.0);

}
}
double? _heightFactor;
float? _heightFactor;
protected override void performLayout() {
bool shrinkWrapWidth = this._widthFactor != null || double.IsPositiveInfinity(this.constraints.maxWidth);

this.child.layout(this.constraints.loosen(), parentUsesSize: true);
this.size = this.constraints.constrain(new Size(
shrinkWrapWidth ? this.child.size.width * (this._widthFactor ?? 1.0) : double.PositiveInfinity,
shrinkWrapHeight ? this.child.size.height * (this._heightFactor ?? 1.0) : double.PositiveInfinity));
shrinkWrapWidth ? this.child.size.width * (this._widthFactor ?? 1.0f) : float.PositiveInfinity,
shrinkWrapHeight ? this.child.size.height * (this._heightFactor ?? 1.0f) : float.PositiveInfinity));
shrinkWrapWidth ? 0.0 : double.PositiveInfinity,
shrinkWrapHeight ? 0.0 : double.PositiveInfinity));
shrinkWrapWidth ? 0.0f : float.PositiveInfinity,
shrinkWrapHeight ? 0.0f : float.PositiveInfinity));
}
}

public class RenderConstrainedOverflowBox : RenderAligningShiftedBox {
public RenderConstrainedOverflowBox(
RenderBox child = null,
double? minWidth = null,
double? maxWidth = null,
double? minHeight = null,
double? maxHeight = null,
float? minWidth = null,
float? maxWidth = null,
float? minHeight = null,
float? maxHeight = null,
Alignment alignment = null
) : base(alignment, child) {
this._minWidth = minWidth;

}
public double? minWidth {
public float? minWidth {
get { return this._minWidth; }
set {
if (this._minWidth == value) {

}
}
public double? _minWidth;
public float? _minWidth;
public double? maxWidth {
public float? maxWidth {
get { return this._maxWidth; }
set {
if (this._maxWidth == value) {

}
}
public double? _maxWidth;
public float? _maxWidth;
public double? minHeight {
public float? minHeight {
get { return this._minHeight; }
set {
if (this._minHeight == value) {

}
}
public double? _minHeight;
public float? _minHeight;
public double? maxHeight {
public float? maxHeight {
get { return this._maxHeight; }
set {
if (this._maxHeight == value) {

}
}
public double? _maxHeight;
public float? _maxHeight;
public BoxConstraints _getInnerConstraints(BoxConstraints constraints) {
return new BoxConstraints(

public Size _requestedSize;
protected override double computeMinIntrinsicWidth(double height) {
return this._requestedSize.width;
protected override float computeMinIntrinsicWidth(float height) {
return (float) this._requestedSize.width;
protected override double computeMaxIntrinsicWidth(double height) {
return this._requestedSize.width;
protected override float computeMaxIntrinsicWidth(float height) {
return (float) this._requestedSize.width;
protected override double computeMinIntrinsicHeight(double width) {
return this._requestedSize.height;
protected override float computeMinIntrinsicHeight(float width) {
return (float) this._requestedSize.height;
protected override double computeMaxIntrinsicHeight(double width) {
return this._requestedSize.height;
protected override float computeMaxIntrinsicHeight(float width) {
return (float) this._requestedSize.height;
protected override double? computeDistanceToActualBaseline(TextBaseline baseline) {
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
if (this.child != null) {
return this.child.getDistanceToActualBaseline(baseline);
}

public class RenderFractionallySizedOverflowBox : RenderAligningShiftedBox {
public RenderFractionallySizedOverflowBox(
RenderBox child = null,
double? widthFactor = null,
double? heightFactor = null,
float? widthFactor = null,
float? heightFactor = null,
Alignment alignment = null
) : base(alignment, child) {
this._widthFactor = widthFactor;

public double? widthFactor {
public float? widthFactor {
get { return this._widthFactor; }
set {
if (this._widthFactor != value) {

}
}
public double? _widthFactor;
public float? _widthFactor;
public double? heightFactor {
public float? heightFactor {
get { return this._heightFactor; }
set {
if (this._heightFactor != value) {

}
}
public double? _heightFactor;
public float? _heightFactor;
public BoxConstraints _getInnerConstraints(BoxConstraints constraints) {
double minWidth = constraints.minWidth;

}
return new BoxConstraints(
minWidth: minWidth,
maxWidth: maxWidth,
minHeight: minHeight,
maxHeight: maxHeight
minWidth: (float) minWidth,
maxWidth: (float) maxWidth,
minHeight: (float) minHeight,
maxHeight: (float) maxHeight
protected override double computeMinIntrinsicWidth(double height) {
double result;
protected override float computeMinIntrinsicWidth(float height) {
float result;
result = this.child.getMinIntrinsicWidth(height * (this._heightFactor ?? 1.0));
result = this.child.getMinIntrinsicWidth(height * (this._heightFactor ?? 1.0f));
return result / (this._widthFactor ?? 1.0);
return result / (this._widthFactor ?? 1.0f);
protected override double computeMaxIntrinsicWidth(double height) {
double result;
protected override float computeMaxIntrinsicWidth(float height) {
float result;
result = this.child.getMaxIntrinsicWidth(height * (this._heightFactor ?? 1.0));
result = this.child.getMaxIntrinsicWidth(height * (this._heightFactor ?? 1.0f));
return result / (this._widthFactor ?? 1.0);
return result / (this._widthFactor ?? 1.0f);
protected override double computeMinIntrinsicHeight(double width) {
double result;
protected override float computeMinIntrinsicHeight(float width) {
float result;
result = this.child.getMinIntrinsicHeight(width * (this._widthFactor ?? 1.0));
result = this.child.getMinIntrinsicHeight(width * (this._widthFactor ?? 1.0f));
return result / (this._heightFactor ?? 1.0);
return result / (this._heightFactor ?? 1.0f);
protected override double computeMaxIntrinsicHeight(double width) {
double result;
protected override float computeMaxIntrinsicHeight(float width) {
float result;
result = this.child.getMaxIntrinsicHeight(width * (this._widthFactor ?? 1.0));
result = this.child.getMaxIntrinsicHeight(width * (this._widthFactor ?? 1.0f));
return result / (this._heightFactor ?? 1.0);
return result / (this._heightFactor ?? 1.0f);
}
protected override void performLayout() {

}
protected override double computeMinIntrinsicWidth(double height) {
double width = this._getSize(BoxConstraints.tightForFinite(height: height)).width;
protected override float computeMinIntrinsicWidth(float height) {
float width = (float) this._getSize(BoxConstraints.tightForFinite(height: height)).width;
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicWidth(double height) {
double width = this._getSize(BoxConstraints.tightForFinite(height: height)).width;
protected override float computeMaxIntrinsicWidth(float height) {
float width = (float) this._getSize(BoxConstraints.tightForFinite(height: height)).width;
return 0.0;
return 0.0f;
protected override double computeMinIntrinsicHeight(double width) {
double height = this._getSize(BoxConstraints.tightForFinite(width: width)).height;
protected override float computeMinIntrinsicHeight(float width) {
float height = (float) this._getSize(BoxConstraints.tightForFinite(width: width)).height;
return 0.0;
return 0.0f;
protected override double computeMaxIntrinsicHeight(double width) {
double height = this._getSize(BoxConstraints.tightForFinite(width: width)).height;
protected override float computeMaxIntrinsicHeight(float width) {
float height = (float) this._getSize(BoxConstraints.tightForFinite(width: width)).height;
return 0.0;
return 0.0f;
}
protected override void performLayout() {

public class RenderBaseline : RenderShiftedBox {
public RenderBaseline(
RenderBox child = null,
double baseline = 0.0,
float baseline = 0.0f,
TextBaseline baselineType = TextBaseline.alphabetic
) : base(child) {
this._baseline = baseline;

public double baseline {
public float baseline {
get { return this._baseline; }
set {
if (this._baseline != value) {

}
}
public double _baseline;
public float _baseline;
public TextBaseline baselineType {

protected override void performLayout() {
if (this.child != null) {
this.child.layout(this.constraints.loosen(), parentUsesSize: true);
double? childBaseline = this.child.getDistanceToBaseline(this.baselineType);
double actualBaseline = this.baseline;
double top = actualBaseline - childBaseline.Value;
float? childBaseline = this.child.getDistanceToBaseline(this.baselineType);
float actualBaseline = this.baseline;
float top = actualBaseline - childBaseline.Value;
childParentData.offset = new Offset(0.0, top);
childParentData.offset = new Offset(0.0f, top);
Size childSize = this.child.size;
this.size = this.constraints.constrain(new Size(childSize.width, top + childSize.height));
}

214
Runtime/rendering/sliver.cs


AxisDirection axisDirection,
GrowthDirection growthDirection,
ScrollDirection userScrollDirection,
double scrollOffset,
double overlap,
double remainingPaintExtent,
double crossAxisExtent,
float scrollOffset,
float overlap,
float remainingPaintExtent,
float crossAxisExtent,
double viewportMainAxisExtent,
double remainingCacheExtent,
double cacheOrigin
float viewportMainAxisExtent,
float remainingCacheExtent,
float cacheOrigin
) {
this.axisDirection = axisDirection;
this.growthDirection = growthDirection;

AxisDirection? axisDirection = null,
GrowthDirection? growthDirection = null,
ScrollDirection? userScrollDirection = null,
double? scrollOffset = null,
double? overlap = null,
double? remainingPaintExtent = null,
double? crossAxisExtent = null,
float? scrollOffset = null,
float? overlap = null,
float? remainingPaintExtent = null,
float? crossAxisExtent = null,
double? viewportMainAxisExtent = null,
double? remainingCacheExtent = null,
double? cacheOrigin = null
float? viewportMainAxisExtent = null,
float? remainingCacheExtent = null,
float? cacheOrigin = null
) {
return new SliverConstraints(
axisDirection: axisDirection ?? this.axisDirection,

public readonly ScrollDirection userScrollDirection;
public readonly double scrollOffset;
public readonly float scrollOffset;
public readonly double overlap;
public readonly float overlap;
public readonly double remainingPaintExtent;
public readonly float remainingPaintExtent;
public readonly double crossAxisExtent;
public readonly float crossAxisExtent;
public readonly double viewportMainAxisExtent;
public readonly float viewportMainAxisExtent;
public readonly double cacheOrigin;
public readonly float cacheOrigin;
public readonly double remainingCacheExtent;
public readonly float remainingCacheExtent;
public Axis axis {
get { return AxisUtils.axisDirectionToAxis(this.axisDirection); }

}
public BoxConstraints asBoxConstraints(
double minExtent = 0.0,
double maxExtent = double.PositiveInfinity,
double? crossAxisExtent = null
float minExtent = 0.0f,
float maxExtent = float.PositiveInfinity,
float? crossAxisExtent = null
) {
crossAxisExtent = crossAxisExtent ?? this.crossAxisExtent;
switch (this.axis) {

if (ReferenceEquals(null, other)) {
return false;
}
return this.axisDirection == other.axisDirection
&& this.growthDirection == other.growthDirection
&& this.userScrollDirection == other.userScrollDirection

if (ReferenceEquals(null, obj)) {
return false;
}
return this.Equals((SliverConstraints) obj);
}

public class SliverGeometry : Diagnosticable {
public SliverGeometry(
double scrollExtent = 0.0,
double paintExtent = 0.0,
double paintOrigin = 0.0,
double? layoutExtent = null,
double maxPaintExtent = 0.0,
double maxScrollObstructionExtent = 0.0,
double? hitTestExtent = null,
float scrollExtent = 0.0f,
float paintExtent = 0.0f,
float paintOrigin = 0.0f,
float? layoutExtent = null,
float maxPaintExtent = 0.0f,
float maxScrollObstructionExtent = 0.0f,
float? hitTestExtent = null,
double? scrollOffsetCorrection = null,
double? cacheExtent = null
float? scrollOffsetCorrection = null,
float? cacheExtent = null
) {
D.assert(scrollOffsetCorrection != 0.0);

public static readonly SliverGeometry zero = new SliverGeometry();
public readonly double scrollExtent;
public readonly double paintOrigin;
public readonly double paintExtent;
public readonly double layoutExtent;
public readonly double maxPaintExtent;
public readonly double maxScrollObstructionExtent;
public readonly double hitTestExtent;
public readonly float scrollExtent;
public readonly float paintOrigin;
public readonly float paintExtent;
public readonly float layoutExtent;
public readonly float maxPaintExtent;
public readonly float maxScrollObstructionExtent;
public readonly float hitTestExtent;
public readonly double? scrollOffsetCorrection;
public readonly double cacheExtent;
public readonly float? scrollOffsetCorrection;
public readonly float cacheExtent;
internal static string _debugCompareFloats(string labelA, double valueA, string labelB, double valueB) {
if (valueA.ToString("F1") != valueB.ToString("F1")) {

if (check) {
return;
}
var information = new StringBuilder();
if (informationCollector != null) {
informationCollector(information);

if (this.paintExtent > 0.0) {
properties.add(new DoubleProperty("paintExtent", this.paintExtent,
unit: this.visible ? null : " but not painting"));
} else if (this.paintExtent == 0.0) {
}
else if (this.paintExtent == 0.0) {
if (this.visible) {
properties.add(new DoubleProperty("paintExtent", this.paintExtent,
unit: this.visible ? null : " but visible"));

} else {
}
else {
properties.add(new DoubleProperty("paintExtent", this.paintExtent, tooltip: "!"));
}

}
public class SliverLogicalParentData : ParentData {
public double layoutOffset = 0.0;
public float layoutOffset = 0.0f;
public override string ToString() {
return "layoutOffset=" + this.layoutOffset.ToString("F1");

D.assert(this.sizedByParent);
violation = "It appears that the geometry setter was called from performLayout().";
hint = "";
} else {
}
else {
violation =
"The geometry setter was called from outside layout (neither performResize() nor performLayout() were being run for this object).";
if (this.owner != null && this.owner.debugDoingLayout) {

if (this.sizedByParent) {
contract =
"Because this RenderSliver has sizedByParent set to true, it must set its geometry in performResize().";
} else {
}
else {
contract =
"Because this RenderSliver has sizedByParent set to false, it must set its geometry in performLayout().";
}

switch (this.constraints.axis) {
case Axis.horizontal:
return Rect.fromLTWH(
0.0, 0.0,
this.geometry.paintExtent,
0.0f, 0.0f,
(float) this.geometry.paintExtent,
0.0, 0.0,
0.0f, 0.0f,
this.geometry.paintExtent
(float) this.geometry.paintExtent
);
}

D.assert(false);
}
public double centerOffsetAdjustment {
get { return 0.0; }
public float centerOffsetAdjustment {
get { return 0.0f; }
public bool hitTest(HitTestResult result, double mainAxisPosition = 0, double crossAxisPosition = 0) {
public bool hitTest(HitTestResult result, float mainAxisPosition = 0, float crossAxisPosition = 0) {
if (mainAxisPosition >= 0.0 && mainAxisPosition < this.geometry.hitTestExtent &&
crossAxisPosition >= 0.0 && crossAxisPosition < this.constraints.crossAxisExtent) {
if (this.hitTestChildren(result, mainAxisPosition: mainAxisPosition,

return false;
}
protected virtual bool hitTestSelf(double mainAxisPosition = 0, double crossAxisPosition = 0) {
protected virtual bool hitTestSelf(double mainAxisPosition = 0, float crossAxisPosition = 0) {
protected virtual bool hitTestChildren(HitTestResult result, double mainAxisPosition = 0,
double crossAxisPosition = 0) {
protected virtual bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0,
float crossAxisPosition = 0) {
public double calculatePaintOffset(SliverConstraints constraints, double from, double to) {
public float calculatePaintOffset(SliverConstraints constraints, float from, float to) {
double a = constraints.scrollOffset;
double b = constraints.scrollOffset + constraints.remainingPaintExtent;
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0, constraints.remainingPaintExtent);
float a = constraints.scrollOffset;
float b = constraints.scrollOffset + constraints.remainingPaintExtent;
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0f, constraints.remainingPaintExtent);
public double calculateCacheOffset(SliverConstraints constraints, double from, double to) {
public float calculateCacheOffset(SliverConstraints constraints, float from, float to) {
double a = constraints.scrollOffset + constraints.cacheOrigin;
double b = constraints.scrollOffset + constraints.remainingCacheExtent;
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0, constraints.remainingCacheExtent);
float a = constraints.scrollOffset + constraints.cacheOrigin;
float b = constraints.scrollOffset + constraints.remainingCacheExtent;
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0f, constraints.remainingCacheExtent);
public virtual double childMainAxisPosition(RenderObject child) {
public virtual float childMainAxisPosition(RenderObject child) {
return 0.0;
return 0.0f;
public virtual double childCrossAxisPosition(RenderObject child) {
return 0.0;
public virtual float childCrossAxisPosition(RenderObject child) {
return 0.0f;
public virtual double childScrollOffset(RenderObject child) {
public virtual float childScrollOffset(RenderObject child) {
return 0.0;
return 0.0f;
}
public override void applyPaintTransform(RenderObject child, Matrix3 transform) {

switch (GrowthDirectionUtils.applyGrowthDirectionToAxisDirection(
this.constraints.axisDirection, this.constraints.growthDirection)) {
case AxisDirection.up:
return new Size(this.constraints.crossAxisExtent, -this.geometry.paintExtent);
return new Size(this.constraints.crossAxisExtent, (float) -this.geometry.paintExtent);
return new Size(this.geometry.paintExtent, this.constraints.crossAxisExtent);
return new Size((float) this.geometry.paintExtent, this.constraints.crossAxisExtent);
return new Size(this.constraints.crossAxisExtent, this.geometry.paintExtent);
return new Size(this.constraints.crossAxisExtent, (float) this.geometry.paintExtent);
return new Size(-this.geometry.paintExtent, this.constraints.crossAxisExtent);
return new Size((float) -this.geometry.paintExtent, this.constraints.crossAxisExtent);
}
D.assert(false);

if (p0.dx == p1.dx) {
dx2 = -dx2;
} else {
}
else {
dy2 = -dy2;
}

this._debugDrawArrow(
canvas,
paint,
offset.translate(this.constraints.crossAxisExtent * 1.0 / 4.0, padding),
offset.translate(this.constraints.crossAxisExtent * 1.0 / 4.0, arrowExtent - padding),
offset.translate(this.constraints.crossAxisExtent * 1.0f / 4.0f, (float) padding),
offset.translate(this.constraints.crossAxisExtent * 1.0f / 4.0f,
(float) (arrowExtent - padding)),
offset.translate(this.constraints.crossAxisExtent * 3.0 / 4.0, padding),
offset.translate(this.constraints.crossAxisExtent * 3.0 / 4.0, arrowExtent - padding),
offset.translate(this.constraints.crossAxisExtent * 3.0f / 4.0f, (float) padding),
offset.translate(this.constraints.crossAxisExtent * 3.0f / 4.0f,
(float) (arrowExtent - padding)),
this.constraints.normalizedGrowthDirection
);
break;

this._debugDrawArrow(
canvas,
paint,
offset.translate(padding, this.constraints.crossAxisExtent * 1.0 / 4.0),
offset.translate(arrowExtent - padding, this.constraints.crossAxisExtent * 1.0 / 4.0),
offset.translate((float) padding, this.constraints.crossAxisExtent * 1.0f / 4.0f),
offset.translate((float) (arrowExtent - padding),
this.constraints.crossAxisExtent * 1.0f / 4.0f),
offset.translate(padding, this.constraints.crossAxisExtent * 3.0 / 4.0),
offset.translate(arrowExtent - padding, this.constraints.crossAxisExtent * 3.0 / 4.0),
offset.translate((float) padding, this.constraints.crossAxisExtent * 3.0f / 4.0f),
offset.translate((float) (arrowExtent - padding),
this.constraints.crossAxisExtent * 3.0f / 4.0f),
this.constraints.normalizedGrowthDirection
);
break;

absolutePosition = child.size.width - absolutePosition;
}
return child.hitTest(result, position: new Offset(absolutePosition, absoluteCrossAxisPosition));
return child.hitTest(result,
position: new Offset((float) absolutePosition, (float) absoluteCrossAxisPosition));
return child.hitTest(result, position: new Offset(absoluteCrossAxisPosition, absolutePosition));
return child.hitTest(result,
position: new Offset((float) absoluteCrossAxisPosition, (float) absolutePosition));
}
return false;

switch (GrowthDirectionUtils.applyGrowthDirectionToAxisDirection(constraints.axisDirection,
constraints.growthDirection)) {
case AxisDirection.up:
childParentData.paintOffset = new Offset(0.0,
-(geometry.scrollExtent - (geometry.paintExtent + constraints.scrollOffset)));
childParentData.paintOffset = new Offset(0.0f,
-(float) (geometry.scrollExtent - (geometry.paintExtent + constraints.scrollOffset)));
childParentData.paintOffset = new Offset(-constraints.scrollOffset, 0.0);
childParentData.paintOffset = new Offset(-constraints.scrollOffset, 0.0f);
childParentData.paintOffset = new Offset(0.0, -constraints.scrollOffset);
childParentData.paintOffset = new Offset(0.0f, -constraints.scrollOffset);
new Offset(-(geometry.scrollExtent - (geometry.paintExtent + constraints.scrollOffset)), 0.0);
new Offset(-(float) (geometry.scrollExtent - (geometry.paintExtent + constraints.scrollOffset)),
0.0f);
protected override bool hitTestChildren(HitTestResult result, double mainAxisPosition = 0.0,
double crossAxisPosition = 0.0) {
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
float crossAxisPosition = 0.0f) {
D.assert(this.geometry.hitTestExtent > 0.0);
if (this.child != null) {
return this.hitTestBoxChild(result, this.child, mainAxisPosition: mainAxisPosition,

return false;
}
public override double childMainAxisPosition(RenderObject child) {
public override float childMainAxisPosition(RenderObject child) {
return -this.constraints.scrollOffset;
}

this.child.layout(this.constraints.asBoxConstraints(), parentUsesSize: true);
double childExtent = 0.0;
float childExtent = 0.0f;
switch (this.constraints.axis) {
case Axis.horizontal:
childExtent = this.child.size.width;

break;
}
double paintedChildSize = this.calculatePaintOffset(this.constraints, from: 0.0, to: childExtent);
double cacheExtent = this.calculateCacheOffset(this.constraints, from: 0.0, to: childExtent);
float paintedChildSize = this.calculatePaintOffset(this.constraints, from: 0.0f, to: childExtent);
float cacheExtent = this.calculateCacheOffset(this.constraints, from: 0.0f, to: childExtent);
D.assert(paintedChildSize.isFinite());
D.assert(paintedChildSize >= 0.0);

this.setChildParentData(this.child, this.constraints, this.geometry);
}
}
}
}

34
Runtime/rendering/sliver_fill.cs


public class RenderSliverFillViewport : RenderSliverFixedExtentBoxAdaptor {
public RenderSliverFillViewport(
RenderSliverBoxChildManager childManager = null,
double viewportFraction = 1.0
float viewportFraction = 1.0f
) :
base(childManager: childManager) {
D.assert(viewportFraction > 0.0);

public override double itemExtent {
public override float itemExtent {
double _viewportFraction;
float _viewportFraction;
public double viewportFraction {
public float viewportFraction {
get { return this._viewportFraction; }
set {
if (this._viewportFraction == value) {

}
double _padding {
get { return (1.0 - this.viewportFraction) * this.constraints.viewportMainAxisExtent * 0.5; }
float _padding {
get { return (1.0f - this.viewportFraction) * this.constraints.viewportMainAxisExtent * 0.5f; }
protected override double indexToLayoutOffset(double itemExtent, int index) {
protected override float indexToLayoutOffset(float itemExtent, int index) {
protected override int getMinChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
return base.getMinChildIndexForScrollOffset(Math.Max(scrollOffset - this._padding, 0.0), itemExtent);
protected override int getMinChildIndexForScrollOffset(float scrollOffset, float itemExtent) {
return base.getMinChildIndexForScrollOffset(Math.Max(scrollOffset - this._padding, 0.0f), itemExtent);
protected override int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
return base.getMaxChildIndexForScrollOffset(Math.Max(scrollOffset - this._padding, 0.0), itemExtent);
protected override int getMaxChildIndexForScrollOffset(float scrollOffset, float itemExtent) {
return base.getMaxChildIndexForScrollOffset(Math.Max(scrollOffset - this._padding, 0.0f), itemExtent);
protected override double estimateMaxScrollOffset(SliverConstraints constraints,
protected override float estimateMaxScrollOffset(SliverConstraints constraints,
double leadingScrollOffset = 0.0,
double trailingScrollOffset = 0.0
float leadingScrollOffset = 0.0f,
float trailingScrollOffset = 0.0f
double padding = this._padding;
float padding = this._padding;
return this.childManager.estimateMaxScrollOffset(
constraints,
firstIndex: firstIndex,

}
protected override void performLayout() {
double extent = this.constraints.remainingPaintExtent - Math.Min(this.constraints.overlap, 0.0);
float extent = this.constraints.remainingPaintExtent - Math.Min(this.constraints.overlap, 0.0f);
double paintedChildSize = this.calculatePaintOffset(this.constraints, from: 0.0, to: extent);
float paintedChildSize = this.calculatePaintOffset(this.constraints, from: 0.0f, to: extent);
Debug.Log("size" + paintedChildSize);
D.assert(paintedChildSize.isFinite());
D.assert(paintedChildSize >= 0.0);

52
Runtime/rendering/sliver_fixed_extent_list.cs


) : base(childManager: childManager) {
}
public abstract double itemExtent { get; set; }
public abstract float itemExtent { get; set; }
protected virtual double indexToLayoutOffset(double itemExtent, int index) {
protected virtual float indexToLayoutOffset(float itemExtent, int index) {
protected virtual int getMinChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
protected virtual int getMinChildIndexForScrollOffset(float scrollOffset, float itemExtent) {
protected virtual int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
protected virtual int getMaxChildIndexForScrollOffset(float scrollOffset, float itemExtent) {
protected virtual double estimateMaxScrollOffset(SliverConstraints constraints,
protected virtual float estimateMaxScrollOffset(SliverConstraints constraints,
double leadingScrollOffset = 0.0,
double trailingScrollOffset = 0.0
float leadingScrollOffset = 0.0f,
float trailingScrollOffset = 0.0f
) {
return this.childManager.estimateMaxScrollOffset(
constraints,

);
}
protected double computeMaxScrollOffset(SliverConstraints constraints, double itemExtent) {
protected float computeMaxScrollOffset(SliverConstraints constraints, float itemExtent) {
return this.childManager.childCount.Value * itemExtent;
}

double itemExtent = this.itemExtent;
float itemExtent = this.itemExtent;
double scrollOffset = this.constraints.scrollOffset + this.constraints.cacheOrigin;
float scrollOffset = this.constraints.scrollOffset + this.constraints.cacheOrigin;
double remainingExtent = this.constraints.remainingCacheExtent;
float remainingExtent = this.constraints.remainingCacheExtent;
double targetEndScrollOffset = scrollOffset + remainingExtent;
float targetEndScrollOffset = scrollOffset + remainingExtent;
BoxConstraints childConstraints = this.constraints.asBoxConstraints(
minExtent: itemExtent,

if (this.firstChild == null) {
if (!this.addInitialChild(index: firstIndex,
layoutOffset: this.indexToLayoutOffset(itemExtent, firstIndex))) {
double max = this.computeMaxScrollOffset(this.constraints, itemExtent);
float max = this.computeMaxScrollOffset(this.constraints, itemExtent);
this.geometry = new SliverGeometry(
scrollExtent: max,
maxPaintExtent: max

}
int lastIndex = this.indexOf(this.lastChild);
double leadingScrollOffset = this.indexToLayoutOffset(itemExtent, firstIndex);
double trailingScrollOffset = this.indexToLayoutOffset(itemExtent, lastIndex + 1);
float leadingScrollOffset = this.indexToLayoutOffset(itemExtent, firstIndex);
float trailingScrollOffset = this.indexToLayoutOffset(itemExtent, lastIndex + 1);
D.assert(firstIndex == 0 || this.childScrollOffset(this.firstChild) <= scrollOffset);
D.assert(this.debugAssertChildListIsNonEmptyAndContiguous());

double estimatedMaxScrollOffset = this.estimateMaxScrollOffset(
float estimatedMaxScrollOffset = this.estimateMaxScrollOffset(
this.constraints,
firstIndex: firstIndex,
lastIndex: lastIndex,

double paintExtent = this.calculatePaintOffset(
float paintExtent = this.calculatePaintOffset(
from: leadingScrollOffset,
to: trailingScrollOffset
from: (float) leadingScrollOffset,
to: (float) trailingScrollOffset
double cacheExtent = this.calculateCacheOffset(
float cacheExtent = this.calculateCacheOffset(
from: leadingScrollOffset,
to: trailingScrollOffset
from: (float) leadingScrollOffset,
to: (float) trailingScrollOffset
double targetEndScrollOffsetForPaint =
float targetEndScrollOffsetForPaint =
this.constraints.scrollOffset + this.constraints.remainingPaintExtent;
int? targetLastIndexForPaint = !double.IsInfinity(targetEndScrollOffsetForPaint)
? this.getMaxChildIndexForScrollOffset(targetEndScrollOffsetForPaint, itemExtent)

public class RenderSliverFixedExtentList : RenderSliverFixedExtentBoxAdaptor {
public RenderSliverFixedExtentList(
RenderSliverBoxChildManager childManager = null,
double itemExtent = 0.0
float itemExtent = 0.0f
public override double itemExtent {
public override float itemExtent {
get { return this._itemExtent; }
set {
if (this._itemExtent == value) {

}
}
double _itemExtent;
float _itemExtent;
}
}

26
Runtime/rendering/sliver_list.cs


this.childManager.didStartLayout();
this.childManager.setDidUnderflow(false);
double scrollOffset = this.constraints.scrollOffset + this.constraints.cacheOrigin;
float scrollOffset = this.constraints.scrollOffset + this.constraints.cacheOrigin;
D.assert(scrollOffset >= 0.0);
double remainingExtent = this.constraints.remainingCacheExtent;
D.assert(remainingExtent >= 0.0);

RenderBox leadingChildWithLayout = null, trailingChildWithLayout = null;
RenderBox earliestUsefulChild = this.firstChild;
for (double earliestScrollOffset = this.childScrollOffset(earliestUsefulChild);
for (float earliestScrollOffset = this.childScrollOffset(earliestUsefulChild);
earliestScrollOffset > scrollOffset;
earliestScrollOffset = this.childScrollOffset(earliestUsefulChild)) {
earliestUsefulChild = this.insertAndLayoutLeadingChild(childConstraints, parentUsesSize: true);

childParentData.layoutOffset = 0.0;
childParentData.layoutOffset = 0.0f;
if (scrollOffset == 0.0) {
earliestUsefulChild = this.firstChild;

}
}
else {
double firstChildScrollOffset = earliestScrollOffset - this.paintExtentOf(this.firstChild);
float firstChildScrollOffset = earliestScrollOffset - this.paintExtentOf(this.firstChild);
double correction = 0.0;
float correction = 0.0f;
while (earliestUsefulChild != null) {
D.assert(this.firstChild == earliestUsefulChild);
correction += this.paintExtentOf(this.firstChild);

scrollOffsetCorrection: correction - earliestScrollOffset
);
var childParentData = (SliverMultiBoxAdaptorParentData) this.firstChild.parentData;
childParentData.layoutOffset = 0.0;
childParentData.layoutOffset = 0.0f;
return;
}
else {

bool inLayoutRange = true;
RenderBox child = earliestUsefulChild;
int index = this.indexOf(child);
double endScrollOffset = this.childScrollOffset(child) + this.paintExtentOf(child);
float endScrollOffset = this.childScrollOffset(child) + this.paintExtentOf(child);
Func<bool> advance = () => {
D.assert(child != null);

this.collectGarbage(leadingGarbage - 1, 0);
D.assert(this.firstChild == this.lastChild);
double extent = this.childScrollOffset(this.lastChild) + this.paintExtentOf(this.lastChild);
float extent = this.childScrollOffset(this.lastChild) + this.paintExtentOf(this.lastChild);
paintExtent: 0.0,
paintExtent: 0.0f,
maxPaintExtent: extent
);
return;

D.assert(this.debugAssertChildListIsNonEmptyAndContiguous());
double? estimatedMaxScrollOffset;
float? estimatedMaxScrollOffset;
if (reachedEnd) {
estimatedMaxScrollOffset = endScrollOffset;
}

D.assert(estimatedMaxScrollOffset >= endScrollOffset - this.childScrollOffset(this.firstChild));
}
double paintExtent = this.calculatePaintOffset(
float paintExtent = this.calculatePaintOffset(
double cacheExtent = this.calculateCacheOffset(
float cacheExtent = this.calculateCacheOffset(
double targetEndScrollOffsetForPaint =
float targetEndScrollOffsetForPaint =
this.constraints.scrollOffset + this.constraints.remainingPaintExtent;
this.geometry = new SliverGeometry(
scrollExtent: estimatedMaxScrollOffset.Value,

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存