DesignSize class
Design size configuration for adaptive scaling.
The design size represents the base dimensions used in your design tool (Figma, XD, Sketch, etc.). All scaling calculations will be based on comparing the actual screen size to this design size.
Constructors
- DesignSize({Size phone = defaultPhone, Size tablet = defaultTablet, Size desktop = defaultDesktop})
-
Creates a design size configuration.
const
- DesignSize.all(Size size)
-
Creates a design size with a single size for all device types.
const
- DesignSize.fromDimensions({double phoneWidth = 375, double phoneHeight = 812, double tabletWidth = 768, double tabletHeight = 1024, double desktopWidth = 1440, double desktopHeight = 900})
- Creates a design size from width and height values.
Properties
- desktop → Size
-
The base design size for desktop layouts
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- phone → Size
-
The base design size for phone layouts
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tablet → Size
-
The base design size for tablet layouts
final
Methods
-
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
Constants
- defaultDesktop → const Size
- Default desktop design size (1440x900)
- defaultPhone → const Size
- Default design size (iPhone 13 Mini - 375x812)
- defaultTablet → const Size
- Default tablet design size (iPad - 768x1024)