浏览代码

Fix some mistakes.

/main
Yuncong Zhang 6 年前
当前提交
f15dae0f
共有 51 个文件被更改,包括 233 次插入331 次删除
  1. 8
      Runtime/animation/animation_controller.cs
  2. 3
      Runtime/animation/curves.cs
  3. 9
      Runtime/animation/tween.cs
  4. 6
      Runtime/foundation/debug.cs
  5. 74
      Runtime/foundation/diagnostics.cs
  6. 6
      Runtime/gestures/constants.cs
  7. 48
      Runtime/gestures/multitap.cs
  8. 6
      Runtime/material/arc.cs
  9. 4
      Runtime/material/button_theme.cs
  10. 2
      Runtime/material/ink_splash.cs
  11. 26
      Runtime/material/ink_well.cs
  12. 10
      Runtime/material/material.cs
  13. 2
      Runtime/material/mergeable_material.cs
  14. 2
      Runtime/material/tooltip.cs
  15. 18
      Runtime/painting/alignment.cs
  16. 4
      Runtime/painting/box_fit.cs
  17. 24
      Runtime/painting/gradient.cs
  18. 8
      Runtime/painting/rounded_rectangle_border.cs
  19. 8
      Runtime/painting/shape_decoration.cs
  20. 10
      Runtime/painting/stadium_border.cs
  21. 2
      Runtime/physics/spring_simulation.cs
  22. 10
      Runtime/rendering/box.cs
  23. 8
      Runtime/rendering/custom_layout.cs
  24. 24
      Runtime/rendering/editable.cs
  25. 6
      Runtime/rendering/image.cs
  26. 2
      Runtime/rendering/list_body.cs
  27. 2
      Runtime/rendering/paragraph.cs
  28. 32
      Runtime/rendering/proxy_box.cs
  29. 4
      Runtime/rendering/shifted_box.cs
  30. 20
      Runtime/rendering/sliver.cs
  31. 2
      Runtime/rendering/sliver_fixed_extent_list.cs
  32. 2
      Runtime/rendering/view.cs
  33. 2
      Runtime/rendering/viewport.cs
  34. 16
      Runtime/ui/geometry.cs
  35. 28
      Runtime/ui/matrix.cs
  36. 8
      Runtime/ui/painting/painting.cs
  37. 16
      Runtime/ui/painting/path.cs
  38. 2
      Runtime/ui/text.cs
  39. 10
      Runtime/ui/txt/paragraph.cs
  40. 34
      Runtime/widgets/basic.cs
  41. 2
      Runtime/widgets/editable_text.cs
  42. 16
      Runtime/widgets/gesture_detector.cs
  43. 4
      Runtime/widgets/icon_theme_data.cs
  44. 4
      Runtime/widgets/image.cs
  45. 8
      Runtime/widgets/implicit_animations.cs
  46. 2
      Runtime/widgets/scroll_view.cs
  47. 2
      Runtime/widgets/sliver.cs
  48. 2
      Runtime/widgets/text.cs
  49. 2
      Runtime/widgets/viewport.cs
  50. 8
      Tests/Editor/Gestures.cs
  51. 6
      Tests/Editor/Paragraph.cs

8
Runtime/animation/animation_controller.cs


return 0.0f;
}
return this._simulation.dx(this.lastElapsedDuration.Value.Ticks / TimeSpan.TicksPerSecond);
return this._simulation.dx((float) this.lastElapsedDuration.Value.Ticks / TimeSpan.TicksPerSecond);
}
}

void _tick(TimeSpan elapsed) {
this._lastElapsedDuration = elapsed;
float elapsedInSeconds = elapsed.Ticks / TimeSpan.TicksPerSecond;
float elapsedInSeconds = (float) 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)) {

this._curve = curve;
D.assert(duration.Ticks > 0);
this._durationInSeconds = duration.Ticks / TimeSpan.TicksPerSecond;
this._durationInSeconds = (float) duration.Ticks / TimeSpan.TicksPerSecond;
}
readonly float _durationInSeconds;

internal _RepeatingSimulation(float min, float max, TimeSpan period) {
this._min = min;
this._max = max;
this._periodInSeconds = period.Ticks / TimeSpan.TicksPerSecond;
this._periodInSeconds = (float) period.Ticks / TimeSpan.TicksPerSecond;
D.assert(this._periodInSeconds > 0.0f);
}

3
Runtime/animation/curves.cs


public override float transform(float t) {
D.assert(t >= 0.0 && t <= 1.0);
if (t.isNaN()) {
return float.NaN;
}
float start = 0.0f;
float end = 1.0f;

9
Runtime/animation/tween.cs


}
}
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 class FloatTween : Tween<float> {
public FloatTween(float begin, float end) : base(begin: begin, end: end) {
}

6
Runtime/foundation/debug.cs


// public static Color debugCurrentRepaintColor = Color.fromfromAHSV(0.4, 60.0, 1.0, 1.0);;
public static void _debugDrawfloatRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
// final Path path = new Path()
// ..fillType = PathFillType.evenOdd
// ..addRect(outerRect)

public static void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, float outlineWidth = 2.0f) {
assert(() => {
if (innerRect != null && !innerRect.isEmpty) {
_debugDrawfloatRect(canvas, outerRect, innerRect, new Color(0x900090FF));
_debugDrawDoubleRect(canvas, outerRect, innerRect, new Color(0x900090FF));
_debugDrawfloatRect(canvas, innerRect.inflate(outlineWidth).intersect(outerRect), innerRect,
_debugDrawDoubleRect(canvas, innerRect.inflate(outlineWidth).intersect(outerRect), innerRect,
new Color(0xFF0090FF));
Paint paint = new Paint();
paint.color = new Color(0x90909090);

74
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 FloatProperty : _NumProperty<float?> {
public FloatProperty(string name, float? value,
string ifNull = null,

}
}
public class PercentProperty : floatProperty {
public class PercentProperty : FloatProperty {
public PercentProperty(string name, float fraction,
string ifNull = null,
bool showName = true,

6
Runtime/gestures/constants.cs


public static class Constants {
public const float kTouchSlop = 18.0f;
public const float kfloatTapTouchSlop = kTouchSlop;
public const float kDoubleTapTouchSlop = kTouchSlop;
public const float kfloatTapSlop = 100.0f;
public const float kDoubleTapSlop = 100.0f;
public static readonly TimeSpan kfloatTapTimeout = new TimeSpan(0, 0, 0, 0, 300);
public static readonly TimeSpan kDoubleTapTimeout = new TimeSpan(0, 0, 0, 0, 300);
public static readonly TimeSpan kLongPressTimeout = new TimeSpan(0, 0, 0, 0, 500);

48
Runtime/gestures/multitap.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.gestures {
public delegate void GesturefloatTapCallback(floatTapDetails details);
public delegate void GestureDoubleTapCallback(DoubleTapDetails details);
public class floatTapDetails {
public floatTapDetails(Offset firstGlobalPosition = null) {
public class DoubleTapDetails {
public DoubleTapDetails(Offset firstGlobalPosition = null) {
this.firstGlobalPosition = firstGlobalPosition ?? Offset.zero;
}

}
public class floatTapGestureRecognizer : GestureRecognizer {
public floatTapGestureRecognizer(object debugOwner = null)
public class DoubleTapGestureRecognizer : GestureRecognizer {
public DoubleTapGestureRecognizer(object debugOwner = null)
public GesturefloatTapCallback onfloatTap;
public GestureDoubleTapCallback onDoubleTap;
Timer _floatTapTimer;
Timer _doubleTapTimer;
!this._firstTap.isWithinTolerance(evt, Constants.kfloatTapSlop)) {
!this._firstTap.isWithinTolerance(evt, Constants.kDoubleTapSlop)) {
this._stopfloatTapTimer();
this._stopDoubleTapTimer();
_TapTracker tracker = new _TapTracker(
evt: evt,
entry: GestureBinding.instance.gestureArena.add(evt.pointer, this)

}
}
else if (evt is PointerMoveEvent) {
if (!tracker.isWithinTolerance(evt, Constants.kfloatTapTouchSlop)) {
if (!tracker.isWithinTolerance(evt, Constants.kDoubleTapTouchSlop)) {
this._reject(tracker);
}
}

}
void _reset() {
this._stopfloatTapTimer();
this._stopDoubleTapTimer();
if (this._firstTap != null) {
_TapTracker tracker = this._firstTap;
this._firstTap = null;

}
void _registerFirstTap(_TapTracker tracker) {
this._startfloatTapTimer();
this._startDoubleTapTimer();
GestureBinding.instance.gestureArena.hold(tracker.pointer);
this._freezeTracker(tracker);
this._trackers.Remove(tracker.pointer);

tracker.entry.resolve(GestureDisposition.accepted);
this._freezeTracker(tracker);
this._trackers.Remove(tracker.pointer);
if (this.onfloatTap != null) {
this.invokeCallback<object>("onfloatTap", () => {
this.onfloatTap(new floatTapDetails(initialPosition));
if (this.onDoubleTap != null) {
this.invokeCallback<object>("onDoubleTap", () => {
this.onDoubleTap(new DoubleTapDetails(initialPosition));
return null;
});
}

tracker.stopTrackingPointer(this._handleEvent);
}
void _startfloatTapTimer() {
this._floatTapTimer =
this._floatTapTimer
?? Window.instance.run(Constants.kfloatTapTimeout, this._reset);
void _startDoubleTapTimer() {
this._doubleTapTimer =
this._doubleTapTimer
?? Window.instance.run(Constants.kDoubleTapTimeout, this._reset);
void _stopfloatTapTimer() {
if (this._floatTapTimer != null) {
this._floatTapTimer.cancel();
this._floatTapTimer = null;
void _stopDoubleTapTimer() {
if (this._doubleTapTimer != null) {
this._doubleTapTimer.cancel();
this._doubleTapTimer = null;
get { return "float tap"; }
get { return "double tap"; }
}
}
}

6
Runtime/material/arc.cs


return Offset.lerp(this.begin, this.end, t);
}
float angle = MathUtils.lerpNullablefloat(this._beginAngle, this._endAngle, t) ?? 0.0f;
float angle = MathUtils.lerpNullableFloat(this._beginAngle, this._endAngle, t) ?? 0.0f;
float x = Mathf.Cos(angle) * this._radius;
float y = Mathf.Sin(angle) * this._radius;
return this._center + new Offset(x, y);

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

4
Runtime/material/button_theme.cs


ButtonThemeData defaultTheme = new ButtonThemeData();
properties.add(new EnumProperty<ButtonTextTheme>("textTheme", this.textTheme,
defaultValue: defaultTheme.textTheme));
properties.add(new floatProperty("minWidth", this.minWidth, defaultValue: defaultTheme.minWidth));
properties.add(new floatProperty("height", this.height, defaultValue: defaultTheme.height));
properties.add(new FloatProperty("minWidth", this.minWidth, defaultValue: defaultTheme.minWidth));
properties.add(new FloatProperty("height", this.height, defaultValue: defaultTheme.height));
properties.add(new DiagnosticsProperty<EdgeInsets>("padding", this.padding,
defaultValue: defaultTheme.padding));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape, defaultValue: defaultTheme.shape));

2
Runtime/material/ink_splash.cs


vsync: controller.vsync);
this._radiusController.addListener(controller.markNeedsPaint);
this._radiusController.forward();
this._radius = this._radiusController.drive(new floatTween(
this._radius = this._radiusController.drive(new FloatTween(
begin: InkSplashUtils._kSplashInitialSize,
end: this._targetRadius));

26
Runtime/material/ink_well.cs


GestureTapCallback onTap = null,
GestureTapDownCallback onTapDown = null,
GestureTapCallback onTapCancel = null,
GestureTapCallback onfloatTap = null,
GestureTapCallback onDoubleTap = null,
GestureLongPressCallback onLongPress = null,
ValueChanged<bool> onHighlightChanged = null,
bool containedInkWell = false,

this.onTap = onTap;
this.onTapDown = onTapDown;
this.onTapCancel = onTapCancel;
this.onfloatTap = onfloatTap;
this.onDoubleTap = onDoubleTap;
this.onLongPress = onLongPress;
this.onHighlightChanged = onHighlightChanged;
this.containedInkWell = containedInkWell;

public readonly GestureTapCallback onTapCancel;
public readonly GestureTapCallback onfloatTap;
public readonly GestureTapCallback onDoubleTap;
public readonly GestureLongPressCallback onLongPress;

gestures.Add("tap");
}
if (this.onfloatTap != null) {
gestures.Add("float tap");
if (this.onDoubleTap != null) {
gestures.Add("double tap");
}
if (this.onLongPress != null) {

this.updateHighlight(false);
}
void _handlefloatTap() {
void _handleDoubleTap() {
if (this.widget.onfloatTap != null) {
this.widget.onfloatTap();
if (this.widget.onDoubleTap != null) {
this.widget.onDoubleTap();
}
}

this._currentSplash.color = this.widget.splashColor ?? themeData.splashColor;
}
bool enabled = this.widget.onTap != null || this.widget.onfloatTap != null ||
bool enabled = this.widget.onTap != null || this.widget.onDoubleTap != null ||
this.widget.onLongPress != null;
return new GestureDetector(

onfloatTap: this.widget.onfloatTap != null
? (GesturefloatTapCallback) (details => this._handlefloatTap())
onDoubleTap: this.widget.onDoubleTap != null
? (GestureDoubleTapCallback) (details => this._handleDoubleTap())
: null,
onLongPress: this.widget.onLongPress != null
? (GestureLongPressCallback) (() => this._handleLongPress(context))

Key key = null,
Widget child = null,
GestureTapCallback onTap = null,
GestureTapCallback onfloatTap = null,
GestureTapCallback onDoubleTap = null,
GestureLongPressCallback onLongPress = null,
GestureTapDownCallback onTapDown = null,
GestureTapCancelCallback onTapCancel = null,

key: key,
child: child,
onTap: onTap,
onfloatTap: onfloatTap,
onDoubleTap: onDoubleTap,
onLongPress: onLongPress,
onTapDown: onTapDown,
onTapCancel: () => {

10
Runtime/material/material.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<MaterialType>("type", this.type));
properties.add(new floatProperty("elevation", this.elevation, defaultValue: 0.0));
properties.add(new FloatProperty("elevation", this.elevation, defaultValue: 0.0));
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null));
properties.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor,
defaultValue: new Color(0xFF000000)));

public override void debugFillProperties(DiagnosticPropertiesBuilder description) {
base.debugFillProperties(description);
description.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape));
description.add(new floatProperty("elevation", this.elevation));
description.add(new FloatProperty("elevation", this.elevation));
description.add(new DiagnosticsProperty<Color>("color", this.color));
description.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor));
}

floatTween _elevation;
FloatTween _elevation;
this._elevation = (floatTween) visitor.visit(this, this._elevation, this.widget.elevation,
(float value) => new floatTween(begin: value, end: value));
this._elevation = (FloatTween) visitor.visit(this, this._elevation, this.widget.elevation,
(float value) => new FloatTween(begin: value, end: value));
this._shadowColor = (ColorTween) visitor.visit(this, this._shadowColor, this.widget.shadowColor,
(Color value) => new ColorTween(begin: value));
this._border = (ShapeBorderTween) visitor.visit(this, this._border, this.widget.shape,

2
Runtime/material/mergeable_material.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<Axis>("mainAxis", this.mainAxis));
properties.add(new floatProperty("elevation", this.elevation));
properties.add(new FloatProperty("elevation", this.elevation));
}
public override State createState() {

2
Runtime/material/tooltip.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new StringProperty("message", this.message, showName: false));
properties.add(new floatProperty("vertical offset", this.verticalOffset));
properties.add(new FloatProperty("vertical offset", this.verticalOffset));
properties.add(new FlagProperty("position", value: this.preferBelow, ifTrue: "below", ifFalse: "above",
showName: true));
}

18
Runtime/painting/alignment.cs


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

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

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

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

4
Runtime/painting/box_fit.cs


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

24
Runtime/painting/gradient.cs


D.assert(aStops.Count == bStops.Count);
interpolatedStops = new List<float>();
for (int i = 0; i < aStops.Count; i += 1) {
interpolatedStops.Add(MathUtils.lerpfloat(aStops[i], bStops[i], t).clamp(0.0f, 1.0f));
interpolatedStops.Add(MathUtils.lerpFloat(aStops[i], bStops[i], t).clamp(0.0f, 1.0f));
}
}

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

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

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})";
}

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

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

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

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

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

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

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})";
}

8
Runtime/painting/rounded_rectangle_border.cs


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

8
Runtime/painting/shape_decoration.cs


public override Decoration lerpFrom(Decoration a, float t) {
if (a is BoxDecoration decoration) {
return lerp(fromBoxDecoration(decoration), this, t);
return ShapeDecoration.lerp(ShapeDecoration.fromBoxDecoration(decoration), this, t);
return lerp(a, this, t);
return ShapeDecoration.lerp(a, this, t);
}
return base.lerpFrom(a, t);

if (b is BoxDecoration decoration) {
return lerp(this, fromBoxDecoration(decoration), t);
return ShapeDecoration.lerp(this, fromBoxDecoration(decoration), t);
return lerp(this, b, t);
return ShapeDecoration.lerp(this, b, t);
}
return base.lerpTo(b, t);

10
Runtime/painting/stadium_border.cs


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

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

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

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

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

2
Runtime/physics/spring_simulation.cs


}
if (cmk > 0.0) {
return create(spring, initialPosition, initialVelocity);
return _OverdampedSolution.create(spring, initialPosition, initialVelocity);
}
return _UnderdampedSolution.create(spring, initialPosition, initialVelocity);

10
Runtime/rendering/box.cs


"The height argument to getMinIntrinsicWidth was negative.\n" +
"The argument to getMinIntrinsicWidth must not be negative. " +
"If you perform computations on another height before passing it to " +
"getMinIntrinsicWidth, consider using mathf.max() or float.clamp() " +
"getMinIntrinsicWidth, consider using Mathf.Max() or float.clamp() " +
"to force the value into the valid range."
);
}

"The height argument to getMaxIntrinsicWidth was negative.\n" +
"The argument to getMaxIntrinsicWidth must not be negative. " +
"If you perform computations on another height before passing it to " +
"getMaxIntrinsicWidth, consider using mathf.max() or float.clamp() " +
"getMaxIntrinsicWidth, consider using Mathf.Max() or float.clamp() " +
"to force the value into the valid range."
);
}

"The width argument to getMinIntrinsicHeight was negative.\n" +
"The argument to getMinIntrinsicHeight must not be negative. " +
"If you perform computations on another width before passing it to " +
"getMinIntrinsicHeight, consider using mathf.max() or float.clamp() " +
"getMinIntrinsicHeight, consider using Mathf.Max() or float.clamp() " +
"to force the value into the valid range."
);
}

"The width argument to getMaxIntrinsicHeight was negative.\n" +
"The argument to getMaxIntrinsicHeight must not be negative. " +
"If you perform computations on another width before passing it to " +
"getMaxIntrinsicHeight, consider using mathf.max() or float.clamp() " +
"getMaxIntrinsicHeight, consider using Mathf.Max() or float.clamp() " +
"to force the value into the valid range."
);
}

failureCount += 1;
}
if (float.IsInfinity(result)) {
if (result.isInfinite()) {
failures.AppendLine(" * " + name + "(" + constraint +
") returned a non-finite value: " + result);
failureCount += 1;

8
Runtime/rendering/custom_layout.cs


protected override float computeMinIntrinsicWidth(float height) {
float width = this._getSize(BoxConstraints.tightForFinite(height: height)).width;
if (!float.IsInfinity(width)) {
if (width.isFinite()) {
return width;
}

protected override float computeMaxIntrinsicWidth(float height) {
float width = this._getSize(BoxConstraints.tightForFinite(height: height)).width;
if (!float.IsInfinity(width)) {
if (width.isFinite()) {
return width;
}

protected override float computeMinIntrinsicHeight(float width) {
float height = this._getSize(BoxConstraints.tightForFinite(width: width)).height;
if (!float.IsInfinity(height)) {
if (height.isFinite()) {
return height;
}

protected override float computeMaxIntrinsicHeight(float width) {
float height = this._getSize(BoxConstraints.tightForFinite(width: width)).height;
if (!float.IsInfinity(height)) {
if (height.isFinite()) {
return height;
}

24
Runtime/rendering/editable.cs


public enum SelectionChangedCause {
tap,
floatTap,
doubleTap,
longPress,
keyboard,
}

}
}
/*
this._floatTapGesture = new floatTapGestureRecognizer(this.rendererBindings.rendererBinding);
this._floatTapGesture.onfloatTap = () => { Debug.Log("onfloatTap"); };*/
this._doubleTapGesture = new DoubleTapGestureRecognizer(this.rendererBindings.rendererBinding);
this._doubleTapGesture.onDoubleTap = () => { Debug.Log("onDoubleTap"); };*/
public class RenderEditable : RenderBox {
public static readonly char obscuringCharacter = '•';

bool _obscureText;
TapGestureRecognizer _tap;
LongPressGestureRecognizer _longPress;
floatTapGestureRecognizer _floatTap;
DoubleTapGestureRecognizer _doubleTap;
public bool ignorePointer;
public SelectionChangedHandler onSelectionChanged;
public CaretChangedHandler onCaretChanged;

D.assert(!this._showCursor.value || cursorColor != null);
this._tap = new TapGestureRecognizer(this);
this._floatTap = new floatTapGestureRecognizer(this);
this._doubleTap = new DoubleTapGestureRecognizer(this);
this._floatTap.onfloatTap = this._handlefloatTap;
this._doubleTap.onDoubleTap = this._handleDoubleTap;
this._longPress = new LongPressGestureRecognizer(debugOwner: this);
this._longPress.onLongPress = this._handleLongPress;
}

D.assert(this.debugHandleEvent(evt, entry));
if (evt is PointerDownEvent && this.onSelectionChanged != null) {
this._tap.addPointer((PointerDownEvent) evt);
this._floatTap.addPointer((PointerDownEvent) evt);
this._doubleTap.addPointer((PointerDownEvent) evt);
this._longPress.addPointer((PointerDownEvent) evt);
}
}

}
}
public void handlefloatTap(floatTapDetails details) {
public void handleDoubleTap(DoubleTapDetails details) {
this.selectWord(cause: SelectionChangedCause.floatTap);
this.selectWord(cause: SelectionChangedCause.doubleTap);
}
public void handleLongPress() {

this.handleTap();
}
void _handlefloatTap(floatTapDetails details) {
void _handleDoubleTap(DoubleTapDetails details) {
this.handlefloatTap(details);
this.handleDoubleTap(details);
}
void _handleLongPress() {

return this.preferredLineHeight * this.maxLines.Value;
}
if (float.IsInfinity(width)) {
if (!width.isFinite()) {
var text = this._textPainter.text.text;
int lines = 1;
for (int index = 0; index < text.Length; ++index) {

6
Runtime/rendering/image.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Image>("image", this.image));
properties.add(new floatProperty("width", this.width, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("height", this.height, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("scale", this.scale, defaultValue: 1.0));
properties.add(new FloatProperty("width", this.width, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new FloatProperty("height", this.height, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new FloatProperty("scale", this.scale, defaultValue: 1.0));
properties.add(new DiagnosticsProperty<Color>("color", this.color,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new EnumProperty<BlendMode>("colorBlendMode", this.colorBlendMode,

2
Runtime/rendering/list_body.cs


while (child != null) {
ListBodyParentData childParentData = (ListBodyParentData) child.parentData;
position += child.size.height;
childParentData.offset = new Offset(0.0f, (mainAxisExtent - position));
childParentData.offset = new Offset(0.0f, mainAxisExtent - position);
D.assert(child.parentData == childParentData);
child = childParentData.nextSibling;
}

2
Runtime/rendering/paragraph.cs


properties.add(new FlagProperty("softWrap", value: this.softWrap, ifTrue: "wrapping at box width",
ifFalse: "no wrapping except at line break characters", showName: true));
properties.add(new EnumProperty<TextOverflow>("overflow", this.overflow));
properties.add(new floatProperty("textScaleFactor", this.textScaleFactor, defaultValue: 1.0));
properties.add(new FloatProperty("textScaleFactor", this.textScaleFactor, defaultValue: 1.0));
properties.add(new IntProperty("maxLines", this.maxLines, ifNull: "unlimited"));
}
}

32
Runtime/rendering/proxy_box.cs


}
float width = base.computeMinIntrinsicWidth(height);
D.assert(!float.IsInfinity(width));
D.assert(width.isFinite());
if (!this._additionalConstraints.hasInfiniteWidth) {
return this._additionalConstraints.constrainWidth(width);

}
float width = base.computeMaxIntrinsicWidth(height);
D.assert(!float.IsInfinity(width));
D.assert(width.isFinite());
if (!this._additionalConstraints.hasInfiniteWidth) {
return this._additionalConstraints.constrainWidth(width);

}
float height = base.computeMinIntrinsicHeight(width);
D.assert(!float.IsInfinity(height));
D.assert(height.isFinite());
if (!this._additionalConstraints.hasInfiniteHeight) {
return this._additionalConstraints.constrainHeight(height);

}
float height = base.computeMaxIntrinsicHeight(width);
D.assert(!float.IsInfinity(height));
D.assert(height.isFinite());
if (!this._additionalConstraints.hasInfiniteHeight) {
return this._additionalConstraints.constrainHeight(height);

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("maxWidth", this.maxWidth, defaultValue: float.PositiveInfinity));
properties.add(new floatProperty("maxHeight", this.maxHeight, defaultValue: float.PositiveInfinity));
properties.add(new FloatProperty("maxWidth", this.maxWidth, defaultValue: float.PositiveInfinity));
properties.add(new FloatProperty("maxHeight", this.maxHeight, defaultValue: float.PositiveInfinity));
}
}

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

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

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

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

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("aspectRatio", this.aspectRatio));
properties.add(new FloatProperty("aspectRatio", this.aspectRatio));
}
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("opacity", this.opacity));
properties.add(new FloatProperty("opacity", this.opacity));
}
}

public override void debugFillProperties(DiagnosticPropertiesBuilder description) {
base.debugFillProperties(description);
description.add(new floatProperty("elevation", this.elevation));
description.add(new FloatProperty("elevation", this.elevation));
description.add(new DiagnosticsProperty<Color>("color", this.color));
description.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor));
}

}
public override void applyPaintTransform(RenderObject child, Matrix3 transform) {
transform.preTranslate((this.translation.dx * this.size.width),
(this.translation.dy * this.size.height));
transform.preTranslate(this.translation.dx * this.size.width,
this.translation.dy * this.size.height);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

properties.add(new MessageProperty("usefulness ratio", "no metrics collected yet (never painted)"));
}
else {
float fraction = this.debugAsymmetricPaintCount /
float fraction = (float) this.debugAsymmetricPaintCount /
(this.debugSymmetricPaintCount + this.debugAsymmetricPaintCount);
string diagnosis;

4
Runtime/rendering/shifted_box.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("widthFactor", this._widthFactor, ifNull: "expand"));
properties.add(new floatProperty("heightFactor", this._heightFactor, ifNull: "expand"));
properties.add(new FloatProperty("widthFactor", this._widthFactor, ifNull: "expand"));
properties.add(new FloatProperty("heightFactor", this._heightFactor, ifNull: "expand"));
}
}

20
Runtime/rendering/sliver.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("scrollExtent", this.scrollExtent));
properties.add(new FloatProperty("scrollExtent", this.scrollExtent));
properties.add(new floatProperty("paintExtent", this.paintExtent,
properties.add(new FloatProperty("paintExtent", this.paintExtent,
properties.add(new floatProperty("paintExtent", this.paintExtent,
properties.add(new FloatProperty("paintExtent", this.paintExtent,
unit: this.visible ? null : " but visible"));
}

properties.add(new floatProperty("paintExtent", this.paintExtent, tooltip: "!"));
properties.add(new FloatProperty("paintExtent", this.paintExtent, tooltip: "!"));
properties.add(new floatProperty("paintOrigin", this.paintOrigin,
properties.add(new FloatProperty("paintOrigin", this.paintOrigin,
properties.add(new floatProperty("layoutExtent", this.layoutExtent,
properties.add(new FloatProperty("layoutExtent", this.layoutExtent,
properties.add(new floatProperty("maxPaintExtent", this.maxPaintExtent));
properties.add(new floatProperty("hitTestExtent", this.hitTestExtent,
properties.add(new FloatProperty("maxPaintExtent", this.maxPaintExtent));
properties.add(new FloatProperty("hitTestExtent", this.hitTestExtent,
properties.add(new floatProperty("scrollOffsetCorrection", this.scrollOffsetCorrection,
properties.add(new FloatProperty("scrollOffsetCorrection", this.scrollOffsetCorrection,
properties.add(new floatProperty("cacheExtent", this.cacheExtent,
properties.add(new FloatProperty("cacheExtent", this.cacheExtent,
defaultValue: 0.0f));
}
}

2
Runtime/rendering/sliver_fixed_extent_list.cs


float targetEndScrollOffsetForPaint =
this.constraints.scrollOffset + this.constraints.remainingPaintExtent;
int? targetLastIndexForPaint = !float.IsInfinity(targetEndScrollOffsetForPaint)
int? targetLastIndexForPaint = targetEndScrollOffsetForPaint.isFinite()
? this.getMaxChildIndexForScrollOffset(targetEndScrollOffsetForPaint, itemExtent)
: (int?) null;
this.geometry = new SliverGeometry(

2
Runtime/rendering/view.cs


});
properties.add(new DiagnosticsProperty<Size>("window size", Window.instance.physicalSize,
tooltip: "in physical pixels"));
properties.add(new floatProperty("device pixel ratio", Window.instance.devicePixelRatio,
properties.add(new FloatProperty("device pixel ratio", Window.instance.devicePixelRatio,
tooltip: "physical pixels per logical pixel"));
properties.add(new DiagnosticsProperty<ViewConfiguration>("configuration", this.configuration,
tooltip: "in logical pixels"));

2
Runtime/rendering/viewport.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("anchor", this.anchor));
properties.add(new FloatProperty("anchor", this.anchor));
}
}

16
Runtime/ui/geometry.cs


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

a = a ?? b;
b = b ?? a;
return a + (b - a) * t;
}
public static float lerpFloat(float a, float b, float t) {
return a + (b - a) * t;
}

28
Runtime/ui/matrix.cs


}
static float muladdmul(float a, float b, float c, float d) {
return (a * b + c * d);
return (float) ((double) a * b + (double) c * d);
}
public void setConcat(Matrix3 a, Matrix3 b) {

}
else {
// not perspective
dst[kMScaleX] = (src[kMScaleY] * invDet);
dst[kMSkewX] = (-src[kMSkewX] * invDet);
dst[kMScaleX] = src[kMScaleY] * invDet;
dst[kMSkewX] = -src[kMSkewX] * invDet;
dst[kMSkewY] = (-src[kMSkewY] * invDet);
dst[kMScaleY] = (src[kMScaleX] * invDet);
dst[kMSkewY] = -src[kMSkewY] * invDet;
dst[kMScaleY] = src[kMScaleX] * invDet;
dst[kMTransY] =
ScalarUtils.dcross_dscale(src[kMSkewY], src[kMTransX], src[kMScaleX],
src[kMTransY], invDet);

return a * b - c * d;
}
public static float dcross(float a, float b, float c, float d) {
public static double dcross(double a, double b, double c, double d) {
float c, float d, float scale) {
return (scross(a, b, c, d) * scale);
float c, float d, double scale) {
return (float) (scross(a, b, c, d) * scale);
public static float dcross_dscale(float a, float b,
float c, float d, float scale) {
return (dcross(a, b, c, d) * scale);
public static float dcross_dscale(double a, double b,
double c, double d, double scale) {
return (float) (dcross(a, b, c, d) * scale);
}
public static bool is_degenerate_2x2(

}
public static float inv_determinant(float[] mat, int isPerspective) {
float det;
double det;
if (isPerspective != 0) {
det = mat[Matrix3.kMScaleX] *

// Since the determinant is on the order of the cube of the matrix members,
// compare to the cube of the default nearly-zero constant (although an
// estimate of the condition number would be better if it wasn't so expensive).
if (ScalarNearlyZero(det,
if (ScalarNearlyZero((float) det,
return 1.0f / det;
return 1.0f / (float) det;
}
}
}

8
Runtime/ui/painting/painting.cs


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

16
Runtime/ui/painting/path.cs


return converged;
}
static void _flatten_float_cubic_extrema(Offset[] dst, int dstBase) {
static void _flatten_double_cubic_extrema(Offset[] dst, int dstBase) {
var dy = dst[dstBase + 3].dy;
dst[dstBase + 2] = new Offset(dst[dstBase + 2].dx, dy);
dst[dstBase + 4] = new Offset(dst[dstBase + 4].dx, dy);

_chopCubicAt(src, dst, tValues, roots);
if (dst != null && roots > 0) {
// we do some cleanup to ensure our Y extrema are flat
_flatten_float_cubic_extrema(dst, 0);
_flatten_double_cubic_extrema(dst, 0);
_flatten_float_cubic_extrema(dst, 3);
_flatten_double_cubic_extrema(dst, 3);
}
}

int r = 0;
// use floats so we don't overflow temporarily trying to compute R
float dr = B * B - 4 * A * C;
// use doubles so we don't overflow temporarily trying to compute R
double dr = (double) B * B - 4 * (double) A * C;
dr = Mathf.Sqrt(dr);
float R = dr;
dr = Math.Sqrt(dr);
float R = (float) dr;
if (float.IsInfinity(R)) {
return _return_check_zero(0);

}
else if (roots[0] == roots[1]) {
// nearly-equal?
r -= 1; // skip the float root
r -= 1; // skip the double root
}
}

2
Runtime/ui/text.cs


public enum TextDecorationStyle {
solid,
floatLine,
doubleLine,
}
public class TextDecoration : IEquatable<TextDecoration> {

10
Runtime/ui/txt/paragraph.cs


float _width;
const float kfloatDecorationSpacing = 3.0f;
const float kFloatDecorationSpacing = 3.0f;
public float height {
get { return this._lineHeights.Count == 0 ? 0 : this._lineHeights[this._lineHeights.Count - 1]; }

int decorationCount = 1;
switch (record.style.decorationStyle) {
case TextDecorationStyle.floatLine:
case TextDecorationStyle.doubleLine:
decorationCount = 2;
break;
}

for (int i = 0; i < decorationCount; i++) {
float yOffset = i * underLineThickness * kfloatDecorationSpacing;
float yOffset = i * underLineThickness * kFloatDecorationSpacing;
float yOffsetOriginal = yOffset;
if (decoration != null && decoration.contains(TextDecoration.underline)) {
// underline

}
if (decoration != null && decoration.contains(TextDecoration.lineThrough)) {
yOffset += (decorationCount - 1.0f) * underLineThickness * kfloatDecorationSpacing / -2.0f;
yOffset += (decorationCount - 1.0f) * underLineThickness * kFloatDecorationSpacing / -2.0f;
yOffset += metrics.strikeoutPosition ?? (metrics.fxHeight ?? 0) / -2.0f;
canvas.drawLine(new Offset(x, y + yOffset), new Offset(x + width, y + yOffset), paint);
yOffset = yOffsetOriginal;

float getLineXOffset(float lineTotalAdvance) {
if (float.IsInfinity(this._width)) {
if (this._width.isInfinite()) {
return 0;
}

34
Runtime/widgets/basic.cs


level = DiagnosticLevel.info;
}
properties.add(new floatProperty("width", this.width,
properties.add(new FloatProperty("width", this.width,
properties.add(new floatProperty("height", this.height,
properties.add(new FloatProperty("height", this.height,
defaultValue: Diagnostics.kNullDefaultValue,
level: level));
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("aspectRatio", this.aspectRatio));
properties.add(new FloatProperty("aspectRatio", this.aspectRatio));
}
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("left", this.left, defaultValue: null));
properties.add(new floatProperty("top", this.top, defaultValue: null));
properties.add(new floatProperty("right", this.right, defaultValue: null));
properties.add(new floatProperty("bottom", this.bottom, defaultValue: null));
properties.add(new floatProperty("width", this.width, defaultValue: null));
properties.add(new floatProperty("height", this.height, defaultValue: null));
properties.add(new FloatProperty("left", this.left, defaultValue: null));
properties.add(new FloatProperty("top", this.top, defaultValue: null));
properties.add(new FloatProperty("right", this.right, defaultValue: null));
properties.add(new FloatProperty("bottom", this.bottom, defaultValue: null));
properties.add(new FloatProperty("width", this.width, defaultValue: null));
properties.add(new FloatProperty("height", this.height, defaultValue: null));
}
}

base.debugFillProperties(properties);
properties.add(new EnumProperty<BoxShape>("shape", this.shape));
properties.add(new DiagnosticsProperty<BorderRadius>("borderRadius", this.borderRadius));
properties.add(new floatProperty("elevation", this.elevation));
properties.add(new FloatProperty("elevation", this.elevation));
properties.add(new DiagnosticsProperty<Color>("color", this.color));
properties.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor));
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<CustomClipper<Path>>("clipper", this.clipper));
properties.add(new floatProperty("elevation", this.elevation));
properties.add(new FloatProperty("elevation", this.elevation));
properties.add(new DiagnosticsProperty<Color>("color", this.color));
properties.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor));
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Alignment>("alignment", this.alignment));
properties.add(new floatProperty("widthFactor",
properties.add(new FloatProperty("widthFactor",
properties.add(new floatProperty("heightFactor",
properties.add(new FloatProperty("heightFactor",
this.heightFactor, defaultValue: Diagnostics.kNullDefaultValue));
}
}

properties.add(new FlagProperty("softWrap", value: this.softWrap, ifTrue: "wrapping at box width",
ifFalse: "no wrapping except at line break characters", showName: true));
properties.add(new EnumProperty<TextOverflow>("overflow", this.overflow, defaultValue: TextOverflow.clip));
properties.add(new floatProperty("textScaleFactor", this.textScaleFactor, defaultValue: 1.0));
properties.add(new FloatProperty("textScaleFactor", this.textScaleFactor, defaultValue: 1.0));
properties.add(new IntProperty("maxLines", this.maxLines, ifNull: "unlimited"));
properties.add(new StringProperty("text", this.text.toPlainText()));
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<ui.Image>("image", this.image));
properties.add(new floatProperty("width", this.width, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("height", this.height, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("scale", this.scale, defaultValue: 1.0));
properties.add(new FloatProperty("width", this.width, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new FloatProperty("height", this.height, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new FloatProperty("scale", this.scale, defaultValue: 1.0));
properties.add(new DiagnosticsProperty<Color>("color", this.color,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new EnumProperty<BlendMode>("colorBlendMode", this.colorBlendMode,

2
Runtime/widgets/editable_text.cs


this._selectionOverlay.showHandles();
}
if (longPress || cause == SelectionChangedCause.floatTap) {
if (longPress || cause == SelectionChangedCause.doubleTap) {
this._selectionOverlay.showToolbar();
}
}

16
Runtime/widgets/gesture_detector.cs


GestureTapUpCallback onTapUp = null,
GestureTapCallback onTap = null,
GestureTapCancelCallback onTapCancel = null,
GesturefloatTapCallback onfloatTap = null,
GestureDoubleTapCallback onDoubleTap = null,
GestureLongPressCallback onLongPress = null,
GestureDragDownCallback onVerticalDragDown = null,
GestureDragStartCallback onVerticalDragStart = null,

this.onTapUp = onTapUp;
this.onTap = onTap;
this.onTapCancel = onTapCancel;
this.onfloatTap = onfloatTap;
this.onDoubleTap = onDoubleTap;
this.onLongPress = onLongPress;
this.onVerticalDragDown = onVerticalDragDown;
this.onVerticalDragStart = onVerticalDragStart;

public readonly GestureTapUpCallback onTapUp;
public readonly GestureTapCallback onTap;
public readonly GestureTapCancelCallback onTapCancel;
public readonly GesturefloatTapCallback onfloatTap;
public readonly GestureDoubleTapCallback onDoubleTap;
public readonly GestureLongPressCallback onLongPress;
public readonly GestureDragDownCallback onVerticalDragDown;
public readonly GestureDragStartCallback onVerticalDragStart;

);
}
if (this.onfloatTap != null) {
gestures[typeof(floatTapGestureRecognizer)] =
new GestureRecognizerFactoryWithHandlers<floatTapGestureRecognizer>(
() => new floatTapGestureRecognizer(debugOwner: this),
instance => { instance.onfloatTap = this.onfloatTap; }
if (this.onDoubleTap != null) {
gestures[typeof(DoubleTapGestureRecognizer)] =
new GestureRecognizerFactoryWithHandlers<DoubleTapGestureRecognizer>(
() => new DoubleTapGestureRecognizer(debugOwner: this),
instance => { instance.onDoubleTap = this.onDoubleTap; }
);
}

4
Runtime/widgets/icon_theme_data.cs


base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Color>("color", this.color,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("opacity", this.opacity,
properties.add(new FloatProperty("opacity", this.opacity,
properties.add(new floatProperty("size", this.size,
properties.add(new FloatProperty("size", this.size,
defaultValue: Diagnostics.kNullDefaultValue));
}
}

4
Runtime/widgets/image.cs


base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<ImageProvider>("image", this.image));
properties.add(new floatProperty("width", this.width, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("height", this.height, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new FloatProperty("width", this.width, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new FloatProperty("height", this.height, defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new DiagnosticsProperty<Color>("color", this.color,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new EnumProperty<BlendMode>("colorBlendMode", this.colorBlendMode,

8
Runtime/widgets/implicit_animations.cs


base.debugFillProperties(properties);
properties.add(new EnumProperty<BoxShape>("shape", this.shape));
properties.add(new DiagnosticsProperty<BorderRadius>("borderRadius", this.borderRadius));
properties.add(new floatProperty("elevation", this.elevation));
properties.add(new FloatProperty("elevation", this.elevation));
properties.add(new DiagnosticsProperty<Color>("color", this.color));
properties.add(new DiagnosticsProperty<bool>("animateColor", this.animateColor));
properties.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor));

public class _AnimatedPhysicalModelState : AnimatedWidgetBaseState<AnimatedPhysicalModel> {
BorderRadiusTween _borderRadius;
floatTween _elevation;
FloatTween _elevation;
ColorTween _color;
ColorTween _shadowColor;

this._elevation = (floatTween) visitor.visit(this, this._elevation, this.widget.elevation,
(float value) => new floatTween(begin: value, end: value));
this._elevation = (FloatTween) visitor.visit(this, this._elevation, this.widget.elevation,
(float value) => new FloatTween(begin: value, end: value));
this._color = (ColorTween) visitor.visit(this, this._color, this.widget.color,
(Color value) => new ColorTween(begin: value));
this._shadowColor = (ColorTween) visitor.visit(this, this._shadowColor, this.widget.shadowColor,

2
Runtime/widgets/scroll_view.cs


public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new floatProperty("itemExtent", this.itemExtent,
properties.add(new FloatProperty("itemExtent", this.itemExtent,
defaultValue: Diagnostics.kNullDefaultValue));
}
}

2
Runtime/widgets/sliver.cs


int reifiedCount = lastIndex - firstIndex + 1;
float averageExtent = (trailingScrollOffset - leadingScrollOffset) / reifiedCount;
int remainingCount = childCount - lastIndex - 1;
return (trailingScrollOffset + averageExtent * remainingCount);
return trailingScrollOffset + averageExtent * remainingCount;
}
public float estimateMaxScrollOffset(SliverConstraints constraints,

2
Runtime/widgets/text.cs


ifFalse: "no wrapping except at line break characters", showName: true));
properties.add(new EnumProperty<TextOverflow?>("overflow", this.overflow,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("textScaleFactor", this.textScaleFactor,
properties.add(new FloatProperty("textScaleFactor", this.textScaleFactor,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new IntProperty("maxLines", this.maxLines, defaultValue: Diagnostics.kNullDefaultValue));
}

2
Runtime/widgets/viewport.cs


properties.add(new EnumProperty<AxisDirection>("axisDirection", this.axisDirection));
properties.add(new EnumProperty<AxisDirection?>("crossAxisDirection", this.crossAxisDirection,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new floatProperty("anchor", this.anchor));
properties.add(new FloatProperty("anchor", this.anchor));
properties.add(new DiagnosticsProperty<ViewportOffset>("offset", this.offset));
if (this.center != null) {
properties.add(new DiagnosticsProperty<Key>("center", this.center));

8
Tests/Editor/Gestures.cs


this._panRecognizer = new PanGestureRecognizer();
this._panRecognizer.onUpdate = (details) => { Debug.Log("onUpdate " + details); };
this._floatTapGesture = new floatTapGestureRecognizer();
this._floatTapGesture.onfloatTap = (detail) => { Debug.Log("onfloatTap"); };
this._doubleTapGesture = new DoubleTapGestureRecognizer();
this._doubleTapGesture.onDoubleTap = (detail) => { Debug.Log("onDoubleTap"); };
}
void OnDisable() {

PanGestureRecognizer _panRecognizer;
floatTapGestureRecognizer _floatTapGesture;
DoubleTapGestureRecognizer _doubleTapGesture;
this._floatTapGesture.addPointer(evt);
this._doubleTapGesture.addPointer(evt);
}
RenderBox tap() {

6
Tests/Editor/Paragraph.cs


decoration: TextDecoration.underline),
text: "Real-time 3D revolution\n"),
new TextSpan(style: new TextStyle(color: Color.fromARGB(255, 255, 0, 0),
decoration: TextDecoration.underline, decorationStyle: TextDecorationStyle.floatLine),
text: "float line Real-time 3D revolution\n"),
decoration: TextDecoration.underline, decorationStyle: TextDecorationStyle.doubleLine),
text: "Double line Real-time 3D revolution\n"),
new TextSpan(style: new TextStyle(color: Color.fromARGB(255, 255, 0, 0),
decoration: TextDecoration.underline, fontSize: 24),
text: "Real-time 3D revolution\n"),

new TextSpan(style: new TextStyle(color: Color.fromARGB(255, 255, 0, 0),
decoration: TextDecoration.overline, decorationStyle: TextDecorationStyle.floatLine),
decoration: TextDecoration.overline, decorationStyle: TextDecorationStyle.doubleLine),
text: "Over line Real-time 3D revolution\n"),
new TextSpan(style: new TextStyle(color: Color.fromARGB(255, 255, 0, 0),
decoration: TextDecoration.lineThrough),

正在加载...
取消
保存