Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 27 additions & 37 deletions lib/web_ui/lib/src/ui/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,7 @@ class Color {

@override
String toString() {
if (engine.assertionsEnabled) {
return 'Color(0x${value.toRadixString(16).padLeft(8, '0')})';
} else {
return super.toString();
}
return 'Color(0x${value.toRadixString(16).padLeft(8, '0')})';
}
}

Expand Down Expand Up @@ -1192,36 +1188,32 @@ class Paint {

@override
String toString() {
if (engine.assertionsEnabled) {
final StringBuffer result = StringBuffer();
String semicolon = '';
result.write('Paint(');
if (style == PaintingStyle.stroke) {
result.write('$style');
if (strokeWidth != null && strokeWidth != 0.0)
result.write(' $strokeWidth');
else
result.write(' hairline');
if (strokeCap != null && strokeCap != StrokeCap.butt)
result.write(' $strokeCap');
semicolon = '; ';
}
if (isAntiAlias != true) {
result.write('${semicolon}antialias off');
semicolon = '; ';
}
if (color != _defaultPaintColor) {
if (color != null)
result.write('$semicolon$color');
else
result.write('${semicolon}no color');
semicolon = '; ';
}
result.write(')');
return result.toString();
} else {
return super.toString();
final StringBuffer result = StringBuffer();
String semicolon = '';
result.write('Paint(');
if (style == PaintingStyle.stroke) {
result.write('$style');
if (strokeWidth != null && strokeWidth != 0.0)
result.write(' $strokeWidth');
else
result.write(' hairline');
if (strokeCap != null && strokeCap != StrokeCap.butt)
result.write(' $strokeCap');
semicolon = '; ';
}
if (isAntiAlias != true) {
result.write('${semicolon}antialias off');
semicolon = '; ';
}
if (color != _defaultPaintColor) {
if (color != null)
result.write('$semicolon$color');
else
result.write('${semicolon}no color');
semicolon = '; ';
}
result.write(')');
return result.toString();
}
}

Expand Down Expand Up @@ -1447,9 +1439,7 @@ class ColorFilter {
}

@override
String toString() => engine.assertionsEnabled
? 'ColorFilter($_color, $_blendMode)'
: super.toString();
String toString() => 'ColorFilter($_color, $_blendMode)';
}

/// Styles to use for blurs in [MaskFilter] objects.
Expand Down
5 changes: 1 addition & 4 deletions lib/web_ui/lib/src/ui/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,7 @@ class TextBox {

@override
String toString() {
if (engine.assertionsEnabled) {
return 'TextBox.fromLTRBD(${left.toStringAsFixed(1)}, ${top.toStringAsFixed(1)}, ${right.toStringAsFixed(1)}, ${bottom.toStringAsFixed(1)}, $direction)';
}
return super.toString();
return 'TextBox.fromLTRBD(${left.toStringAsFixed(1)}, ${top.toStringAsFixed(1)}, ${right.toStringAsFixed(1)}, ${bottom.toStringAsFixed(1)}, $direction)';
}
}

Expand Down