GranularLayout class

A granular set of breakpoints, commonly used in applications that requires a more fine-grained layout.

See also:

  • LayoutResolver - the base class used to create any type of layout, like a custom one.
Inheritance

Constructors

GranularLayout(double size, {int xxLarge = 1600, int xLarge = 1200, int large = 769, int medium = 481, int small = 321})
Creates a GranularLayout with the respective breakpoint sizes, each representing a Breakpoint instance of value type GranularBreakpoint.

Properties

breakpoint → Breakpoint<GranularBreakpoint>
Current breakpoint created from size
finalinherited
breakpoints → List<Breakpoint<GranularBreakpoint>>
The list of the current available breakpoints, descending ordered
no setterinherited
breakpointValue → GranularBreakpoint
The Breakpoint.value associated with the current breakpoint
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isLarge → bool
true if the current breakpointValue exactly matches GranularBreakpoint.large
no setter
isLargeOrLarger → bool
true if the current breakpointValue matches GranularBreakpoint.large or a larger breakpoint
no setter
isLargeOrSmaller → bool
true if the current breakpointValue matches GranularBreakpoint.large or a smaller breakpoint
no setter
isMedium → bool
true if the current breakpointValue exactly matches GranularBreakpoint.medium
no setter
isMediumOrLarger → bool
true if the current breakpointValue matches GranularBreakpoint.medium or a larger breakpoint
no setter
isMediumOrSmaller → bool
true if the current breakpointValue matches GranularBreakpoint.medium or a smaller breakpoint
no setter
isSmall → bool
true if the current breakpointValue exactly matches GranularBreakpoint.small
no setter
isSmallOrLarger → bool
true if the current breakpointValue matches GranularBreakpoint.small or a larger breakpoint
no setter
isSmallOrSmaller → bool
true if the current breakpointValue matches GranularBreakpoint.small or a smaller breakpoint
no setter
isXLarge → bool
true if the current breakpointValue exactly matches GranularBreakpoint.xLarge
no setter
isXLargeOrLarger → bool
true if the current breakpointValue matches GranularBreakpoint.xLarge or a larger breakpoint
no setter
isXLargeOrSmaller → bool
true if the current breakpointValue matches GranularBreakpoint.xLarge or a smaller breakpoint
no setter
isXSmall → bool
true if the current breakpointValue exactly matches GranularBreakpoint.xSmall
no setter
isXXLarge → bool
true if the current breakpointValue exactly matches GranularBreakpoint.xxLarge
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → double
The reference value to build the current breakpoint
finalinherited

Methods

closestValue<U extends Object>(Map<GranularBreakpoint, U> breakpointsMap) → U
Finds the closest value to the current breakpoint by applying a custom cascading search in the current list of available breakpointsMap.
inherited
matchesValue(GranularBreakpoint match) → bool
true if match is equals to breakpointValue
inherited
matchesValueOrLarger(GranularBreakpoint match) → bool
true if match is associated with a corresponding Breakpoint that is exactly or larger than the current breakpointValue
inherited
matchesValueOrSmaller(GranularBreakpoint match) → bool
true if match is associated with a corresponding Breakpoint that is exactly or smaller than the current breakpointValue
inherited
maybeValue<T extends Object>({T xxLarge()?, T xLarge()?, T large()?, T medium()?, T small()?, T xSmall()?}) → T?
Proxies the call to value but allows all arguments to be null
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
value<T extends Object>({T xxLarge()?, T xLarge()?, T large()?, T medium()?, T small()?, T xSmall()?}) → T
Builds the most suitable T depending on the current breakpoint.

Operators

operator ==(Object other) → bool
The equality operator.
inherited