ScreenSize class final
A condition configuration that evaluates the current screen size breakpoint.
Features:
- Responsive design support
- Breakpoint-based evaluation
- Integration with BreakpointService
- Asynchronous evaluation
Example:
// In a conditional content
final conditional = Conditional(
condition: Condition(
configuration: ScreenSize(),
),
cases: [
CaseItem(
value: 'small',
item: MobileLayout(),
),
CaseItem(
value: 'large',
item: DesktopLayout(),
),
],
defaultCase: 'small',
);
// In a conditional action
final action = ConditionalAction(
condition: Condition(
configuration: ScreenSize(),
),
cases: [
ActionCase(
value: 'small',
action: NavigationAction(url: '/mobile'),
),
ActionCase(
value: 'large',
action: NavigationAction(url: '/desktop'),
),
],
defaultCase: 'small',
);
The condition returns:
- 'small' for mobile devices
- 'medium' for tablets
- 'large' for desktops
- 'xlarge' for large screens
- Inheritance
-
- Object
- ConditionConfiguration
- ScreenSize
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaType → String
-
The schema type of this configuration.
finalinherited
- title → String?
-
Optional title for this configuration.
finalinherited
Methods
-
execute(
BuildContext context) → Future< String?> -
Evaluates this condition configuration.
override
-
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
Static Properties
-
typeDescriptor
→ TypeDescriptor<
ScreenSize> -
final
Constants
- schemaName → const String