未验证 提交 9fa73367 编写于 作者: D Dan Field 提交者: GitHub

fix toString (#8688)

上级 c1231527
......@@ -879,7 +879,7 @@ class Rect {
int get hashCode => hashValues(left, top, right, bottom);
@override
String toString() => 'Rect.fromLTRB(${left.toStringAsFixed(1)} ${top.toStringAsFixed(1)}, ${right.toStringAsFixed(1)}, ${bottom.toStringAsFixed(1)})';
String toString() => 'Rect.fromLTRB(${left.toStringAsFixed(1)}, ${top.toStringAsFixed(1)}, ${right.toStringAsFixed(1)}, ${bottom.toStringAsFixed(1)})';
}
/// A radius for either circular or elliptical shapes.
......
......@@ -7,6 +7,11 @@ import 'dart:ui';
import 'package:test/test.dart';
void main() {
test('toString test', () {
const Rect r = Rect.fromLTRB(1.0, 3.0, 5.0, 7.0);
expect(r.toString(), 'Rect.fromLTRB(1.0, 3.0, 5.0, 7.0)');
});
test('rect accessors', () {
const Rect r = Rect.fromLTRB(1.0, 3.0, 5.0, 7.0);
expect(r.left, equals(1.0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册