CreativeImageSize class

One size range an image slot accepts, with the containers it may be in.

An exact size is a range whose bounds are equal. ratio is checked only across a real range: Apple's exact sizes are not exact ratios — 5244x2950 is not quite 16:9 and 3840x1646 is not quite 21:9 — so applying the nominal ratio to them would refuse the very sizes Apple publishes.

Constructors

CreativeImageSize({required int minWidth, required int minHeight, required int maxWidth, required int maxHeight, required Set<ImageFormat> formats, required String description, (int, int)? ratio})
const
CreativeImageSize.exact(int width, int height, {required Set<ImageFormat> formats, required String description})
const

Properties

description → String
How the error names this size, e.g. 5244x2950 PNG (universal, 16:9).
final
formats → Set<ImageFormat>
final
hashCode → int
The hash code for this object.
no setterinherited
maxHeight → int
final
maxWidth → int
final
minHeight → int
final
minWidth → int
final
ratio → (int, int)?
(width, height) in lowest terms, compared exactly — (3, 2).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

fits(int width, int height) → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited