AdaptiveWindowType class

Adaptive Window in Material has five different window sizes. Each window size represents a range of devices.

Extra small represents phones and small tablets in portrait view. Small represents tablets in portrait view and phones in landscape view. Medium represents large tablets in landscape view. Large represents computer screens. Extra large represents large computer screens.

https://material.io/design/layout/responsive-layout-grid.html#breakpoints

enum representation enum AdaptiveWindowType { xs, s, m, l, xl, }

example .whenDevice( desktop: () {}, mobile: () {}, tablet: () {}, ), .when( xl: () {}, l: () {}, m: () {}, s: () {}, xs: () {}, ), .maybeWhen( l: () {}, orElse: () {}, ),

Annotations
  • @freezed

Constructors

AdaptiveWindowType.l()
Large
const
factory
AdaptiveWindowType.m()
Medium
const
factory
AdaptiveWindowType.s()
Small
const
factory
AdaptiveWindowType.xl()
Extra large
const
factory
AdaptiveWindowType.xs()
Extra small
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
heightLandscapeRangeValues RangeValues
no setter
heightPortraitRangeValues RangeValues
no setter
isDesktop bool
Is extra large
no setter
isL bool
Is Large
no setter
isM bool
Is medium
no setter
isMobile bool
Is extra small widget and small
no setter
isS bool
Is small
no setter
isTablet bool
Is large and medium
no setter
isXl bool
is extra large
no setter
isXs bool
Is extra small
no setter
name String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
widthRangeValues RangeValues
no setter

Methods

map<TResult extends Object?>({required TResult xs(_AdaptiveWindowTypeXs value), required TResult s(_AdaptiveWindowTypeS value), required TResult m(_AdaptiveWindowTypeM value), required TResult l(_AdaptiveWindowTypeL value), required TResult xl(_AdaptiveWindowTypeXl value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? xs(_AdaptiveWindowTypeXs value)?, TResult? s(_AdaptiveWindowTypeS value)?, TResult? m(_AdaptiveWindowTypeM value)?, TResult? l(_AdaptiveWindowTypeL value)?, TResult? xl(_AdaptiveWindowTypeXl value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult xs(_AdaptiveWindowTypeXs value)?, TResult s(_AdaptiveWindowTypeS value)?, TResult m(_AdaptiveWindowTypeM value)?, TResult l(_AdaptiveWindowTypeL value)?, TResult xl(_AdaptiveWindowTypeXl value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult xs()?, TResult s()?, TResult m()?, TResult l()?, TResult xl()?, required TResult orElse()}) → TResult
inherited
maybeWhenDevice<T>({ValueGetter<T>? mobile, ValueGetter<T>? tablet, ValueGetter<T>? desktop, required ValueGetter<T> orElse}) → T
When current size resent mobile, tablet, desktop Or return orElse if not provided
next() AdaptiveWindowType
Get next size from values return first item if current item is _AdaptiveWindowTypeXs
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
previous() AdaptiveWindowType
Get previous size from values return last item if current item is _AdaptiveWindowTypeXs
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult xs(), required TResult s(), required TResult m(), required TResult l(), required TResult xl()}) → TResult
inherited
whenDevice<T>({required ValueGetter<T> mobile, required ValueGetter<T> tablet, required ValueGetter<T> desktop}) → T
When current size resent mobile, tablet, desktop
whenOrNull<TResult extends Object?>({TResult? xs()?, TResult? s()?, TResult? m()?, TResult? l()?, TResult? xl()?}) → TResult?
inherited

Operators

operator <(AdaptiveWindowType other) bool
operator <=(AdaptiveWindowType other) bool
operator ==(Object other) bool
The equality operator.
inherited
operator >(AdaptiveWindowType other) bool
operator >=(AdaptiveWindowType other) bool

Constants

values → const List<AdaptiveWindowType>
Order matter same as Enum.values