pub license: MIT build codecov

Dart extension methods to make the Rect class pleasant and convenient to work with.

adjustAdjust by dx1, dy1, dx2 and dy2.
intersectsWhether two rectangles intersect.
moveBottomMoves along the bottom edge.
moveBottomLeftMoves along the bottom left corner.
moveBottomRightMoves along the bottom right corner.
moveCenterMoves along the center.
moveLeftMoves along the left edge.
moveRightMoves along the right edge.
moveTopMoves along the top edge.
moveTopLeftMoves along the top left corner.
moveTopRightMoves along the top right corner.
normalizeEnsures non-negative width and height.
setBottomSets the bottom edge.
setBottomLeftSets the bottom left corner.
setBottomRightSets the bottom right corner.
setHeightSets the height.
setLeftSets the left edge.
setRightSets the right edge.
setTopSets the top edge.
setTopLeftSets the top left corner.
setTopRightSets the top right corner.
setWidthSets the width.
normalizeExchanges width and height.
uniteBounding rectangle of two rectangles.


To use this package, add rectify as a dependency in your pubspec.yaml file and import the package:

import 'package:rectify/rectify.dart';

All above methods are extension methods and work on any object of type Rect.


Extension methods to make Rect pleasant and convenient to work with.