This commit is contained in:
Dan Field
2019-04-22 14:12:31 -07:00
committed by GitHub
parent d98c2e2df0
commit c9a0f50ecc
2 changed files with 6 additions and 1 deletions

View File

@@ -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.

View File

@@ -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));