Line data Source code
1 : import 'dart:math' show Rectangle; 2 : import 'dart:ui' show Rect; 3 : 4 : extension RectangleExtension on Rectangle { 5 : /// Converts this math [Rectangle] into an ui [Rect]. 6 1 : Rect toRect() { 7 1 : return Rect.fromLTWH( 8 2 : left.toDouble(), 9 2 : top.toDouble(), 10 2 : width.toDouble(), 11 2 : height.toDouble(), 12 : ); 13 : } 14 : }