fix toString (flutter/engine#8688)
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user