CropAspectRatio class
Defines an aspect ratio constraint for the cropping window.
- Annotations
Constructors
- CropAspectRatio({double? width, double? height, String? label})
-
Creates a CropAspectRatio with optional
widthandheightproportions.const - CropAspectRatio.custom(double width, double height, {String? label})
-
Creates a custom aspect ratio with explicit numeric width and height.
factory
- CropAspectRatio.ratio(double ratio, {String? label})
-
Creates a CropAspectRatio from a floating point ratio value (width / height).
factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- height → double?
-
Relative height component.
final
- isFree → bool
-
Whether this aspect ratio is unconstrained (freeform).
no setter
- label → String?
-
Optional display label for UI buttons (e.g., "16:9", "Square").
final
- ratio → double?
-
Floating point ratio (width / height), or null if isFree.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
Relative width component.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- a4 → const CropAspectRatio
- Standard ISO 216 A4 document ratio (297 mm x 210 mm ≈ 1.414).
- free → const CropAspectRatio
- Freeform aspect ratio where the user can resize bounds freely.
- idCard → const CropAspectRatio
- Standard ISO/IEC 7810 ID-1 card ratio (85.60 mm x 53.98 mm ≈ 1.586). Used for Aadhar card, PAN card, Driver's License, Credit/Debit cards.
- passport → const CropAspectRatio
- Standard passport photo ratio (35 mm x 45 mm ≈ 0.778 portrait).
-
presets
→ const List<
CropAspectRatio> - Default list of aspect ratio presets.
- ratio2x3 → const CropAspectRatio
- 2:3 classic photo portrait ratio.
- ratio3x2 → const CropAspectRatio
- 3:2 classic photo landscape ratio.
- ratio3x4 → const CropAspectRatio
- 3:4 portrait ratio.
- ratio4x3 → const CropAspectRatio
- 4:3 standard landscape ratio.
- ratio9x16 → const CropAspectRatio
- 9:16 vertical video / story ratio.
- ratio16x9 → const CropAspectRatio
- 16:9 widescreen landscape ratio.
- square → const CropAspectRatio
- 1:1 square aspect ratio.