ResponsiveGridService class
A service that provides responsive design values based on the current screen type.
This service centralizes the logic for providing corresponding values for margins,
gutters, and other layout properties based on the ScreenType from the sizer package.
Constructors
Properties
- gutter → double
-
Gets the responsive gutter (spacing between grid items) based on the current screen type.
Defaults to GridConstants.mobileGutter if the screen type is not set.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- l → double
-
Gets the responsive L (Large) size based on the current screen type.
Defaults to GridConstants.mobileL if the screen type is not set.
no setter
- m → double
-
Gets the responsive M (Medium) size based on the current screen type.
Defaults to GridConstants.mobileM if the screen type is not set.
no setter
- margin → double
-
Gets the responsive margin based on the current screen type.
Defaults to GridConstants.mobileMargin if the screen type is not set.
no setter
- maxWidgetWidth → double
-
Gets the responsive maximum width for a widget based on the current screen type.
For tablets, it uses dynamic logic based on the stored context.
Defaults to GridConstants.mobileWidgetMaxWidth if the screen type is not set.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- s → double
-
Gets the responsive S (Small) size based on the current screen type.
Defaults to GridConstants.mobileS if the screen type is not set.
no setter
- screenType ↔ ScreenType?
-
getter/setter pair
- xl → double
-
Gets the responsive XL (Extra Large) size based on the current screen type.
Defaults to GridConstants.mobileXL if the screen type is not set.
no setter
- xs → double
-
Gets the responsive XS (Extra Small) size based on the current screen type.
Defaults to GridConstants.mobileXS if the screen type is not set.
no setter
- xxl → double
-
Gets the responsive XXL (Extra Extra Large) size based on the current screen type.
Defaults to GridConstants.mobileXXL if the screen type is not set.
no setter
Methods
-
getResponsiveSize(
{required double mobile, double? tablet, required double desktop}) → double - Returns a responsive size based on the current screen type.
-
isDesktop(
) → bool - Checks if the current screen type is desktop.
-
isMobile(
) → bool - Checks if the current screen type is mobile.
-
isTablet(
) → bool - Checks if the current screen type is tablet.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setScreenType(
ScreenType screenType) → void -
Sets the current screen type from the
sizerpackage. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited