domain/helpers library

Constants

kDefaultSelectedColor → const Color

Functions

calculateCroppedRect(VideoEditorController controller, Size layout, {Offset? min, Offset? max}) Rect
Calculate crop Rect area depending of controller min and max crop values and the size of the layout
computeSizeWithRatio(Size layout, double r) Size
Returns a desired dimension of layout that respect r aspect ratio
getBestIndex(int max, int length, int index) int
Return the best index to spread among the list length when limited to a max value When max is 0 or smaller than length, returns index
getOppositeRatio(double ratio) double
Returns opposite aspect ratio
isNumberAlmost(double a, int b) bool
Return true if the difference between a and b is less than 0.001
isRectContained(Size size, Rect rect) bool
Returns true if rect is left and top are bigger than 0 and if right and bottom are smaller than size width and height
resizeCropToRatio(Size layout, Rect crop, double r) Rect
Returns a new crop Rect that respect r aspect ratio inside a layout and based on an existing crop area
scaleToSize(Size layout, Rect rect) double
Return the scale for rect to fit layout
scaleToSizeMax(Size layout, Rect rect) double
Return the scale for rect to not be smaller layout
translateRectIntoBounds(Size layout, Rect rect) Rect
Returns a translated Rect that fit layout size