HydraGrid class

HydraGrid is a grid whose column count depends on the current breakpoint.

At least one of mini, small, medium, or large must be provided. A breakpoint without a column count falls back to the nearest one that has, like HydraWidget does.

HydraGrid(
  mini: 1,
  small: 2,
  medium: 3,
  large: 4,
  children: items,
)

The grid is a GridView; the layout parameters are passed through. Use HydraGrid.builder to build the children lazily, and HydraSliverGrid inside a CustomScrollView.

Inheritance

Constructors

HydraGrid({required List<Widget> children, int? mini, int? small, int? medium, int? large, HydraBehaviour? behaviour, double mainAxisSpacing = 0, double crossAxisSpacing = 0, double childAspectRatio = 1, EdgeInsetsGeometry? padding, bool shrinkWrap = false, ScrollPhysics? physics, Key? key})
Creates a HydraGrid with a column count per breakpoint.
const
HydraGrid.builder({required NullableIndexedWidgetBuilder itemBuilder, int? itemCount, int? mini, int? small, int? medium, int? large, HydraBehaviour? behaviour, double mainAxisSpacing = 0, double crossAxisSpacing = 0, double childAspectRatio = 1, EdgeInsetsGeometry? padding, bool shrinkWrap = false, ScrollPhysics? physics, Key? key})
Creates a HydraGrid that builds its children on demand, for long or infinite grids. See GridView.builder.
const

Properties

behaviour → HydraBehaviour?
HydraBehaviour defines behaviour for HydraWidget.
final
childAspectRatio → double
The ratio of width to height of each child. See GridView.count.
final
children → List<Widget>
The widgets to lay out in the grid. Empty for HydraGrid.builder.
final
crossAxisSpacing → double
The space between columns. See GridView.count.
final
hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → NullableIndexedWidgetBuilder?
Builds the children on demand. Only set by HydraGrid.builder.
final
itemCount → int?
The number of children of HydraGrid.builder; null for an infinite grid.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
large → int?
Number of columns at the large breakpoint.
final
mainAxisSpacing → double
The space between rows. See GridView.count.
final
medium → int?
Number of columns at the medium breakpoint.
final
mini → int?
Number of columns at the mini breakpoint.
final
padding → EdgeInsetsGeometry?
The space around the grid. See GridView.count.
final
physics → ScrollPhysics?
How the grid responds to scrolling. See GridView.count.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shrinkWrap → bool
Whether the grid takes only the height of its content. See GridView.count.
final
small → int?
Number of columns at the small breakpoint.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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