AdaptiFlowData class
Immutable configuration data for the AdaptiFlow responsive system.
All fields have sensible defaults that match the original hardcoded values, so the system works identically with zero configuration. Override any field to customize behavior.
AdaptiFlow(
data: AdaptiFlowData(
mobileBreakpoint: 500,
designSize: Size(390, 844),
),
child: MaterialApp(...),
)
Constructors
- AdaptiFlowData({double mobileBreakpoint = 600, double desktopBreakpoint = 1200, double widescreenBreakpoint = 1920, Size designSize = const Size(375, 812), double mobileScaleFactor = 1.0, double tabletScaleFactor = 1.2, double desktopScaleFactor = 1.5, double mobileFontScale = 1.0, double tabletFontScale = 1.15, double desktopFontScale = 1.3, double mobilePadding = 16.0, double tabletPadding = 24.0, double desktopPadding = 32.0, double mobileMargin = 12.0, double tabletMargin = 16.0, double desktopMargin = 24.0, double mobileSpacing = 8.0, double tabletSpacing = 12.0, double desktopSpacing = 16.0, double tabletMaxWidth = 900, double desktopMaxWidth = 1200})
-
const
Properties
- designSize → Size
-
The design reference size for proportional scaling.
Set this to your design mockup dimensions (e.g., iPhone 13 Mini: 375x812).
Used by
context.w(),context.h(),context.r(),context.sp().final - desktopBreakpoint → double
-
Width at which the device transitions to desktop (default: 1200)
final
- desktopFontScale → double
-
Font scale multiplier for desktop (default: 1.3)
final
- desktopMargin → double
-
Adaptive margin for desktop (default: 24.0)
final
- desktopMaxWidth → double
-
Max width constraint for desktop layout (default: 1200)
final
- desktopPadding → double
-
Adaptive padding for desktop (default: 32.0)
final
- desktopScaleFactor → double
-
General scale multiplier for desktop (default: 1.5)
final
- desktopSpacing → double
-
Adaptive spacing for desktop (default: 16.0)
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- mobileBreakpoint → double
-
Width below which the device is considered mobile (default: 600)
final
- mobileFontScale → double
-
Font scale multiplier for mobile (default: 1.0)
final
- mobileMargin → double
-
Adaptive margin for mobile (default: 12.0)
final
- mobilePadding → double
-
Adaptive padding for mobile (default: 16.0)
final
- mobileScaleFactor → double
-
General scale multiplier for mobile (default: 1.0)
final
- mobileSpacing → double
-
Adaptive spacing for mobile (default: 8.0)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tabletFontScale → double
-
Font scale multiplier for tablet (default: 1.15)
final
- tabletMargin → double
-
Adaptive margin for tablet (default: 16.0)
final
- tabletMaxWidth → double
-
Max width constraint for tablet layout (default: 900)
final
- tabletPadding → double
-
Adaptive padding for tablet (default: 24.0)
final
- tabletScaleFactor → double
-
General scale multiplier for tablet (default: 1.2)
final
- tabletSpacing → double
-
Adaptive spacing for tablet (default: 12.0)
final
- widescreenBreakpoint → double
-
Width at which the device is considered widescreen (default: 1920)
final
Methods
-
copyWith(
{double? mobileBreakpoint, double? desktopBreakpoint, double? widescreenBreakpoint, Size? designSize, double? mobileScaleFactor, double? tabletScaleFactor, double? desktopScaleFactor, double? mobileFontScale, double? tabletFontScale, double? desktopFontScale, double? mobilePadding, double? tabletPadding, double? desktopPadding, double? mobileMargin, double? tabletMargin, double? desktopMargin, double? mobileSpacing, double? tabletSpacing, double? desktopSpacing, double? tabletMaxWidth, double? desktopMaxWidth}) → AdaptiFlowData - Creates a copy with the given fields replaced.
-
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.
override