SectionGridView class

SectionGridView is a widget for displaying a sections with grids.

Combines common grid functionalities from CommonGrid with features specific for a sectional layout.

Properties:

  • sections: The sections to display in the grid, each section containing its data and title.
  • renderItem: The function that renders each item in the grid.
  • itemSize: The size of the grid item. Defaults to 120.0, applicable when isFixed is false.
  • minItemDimension: The minimum dimension (width or height) of each grid item. Defaults to 120.0, applicable when isFixed is false.
  • verticalSpacing: The spacing between grid items vertically. Defaults to 10.
  • horizontalSpacing: The spacing between grid items horizontally. Defaults to 10.
  • itemsPerRow: The number of items per row in the grid. Defaults to 3, applicable when isFixed is false.
  • itemContainerStyle: Style of the container of each item in the grid. Defaults to ContainerStyle, applicable when isFixed is false.
  • isFixed: If true, uses the original size instead of adjusting to grid. Defaults to false.
  • horizontal: If true, the grid view grows horizontally. Defaults to false.
  • invertedRow: If true, inverts the order of the row. Defaults to false.
  • adjustGridToStyles: If true, adjusts the total dimensions of the grid based on style and container size. Defaults to false.
  • gridViewHeight: The height of the grid view. Defaults to 300.
  • gridViewWidth: The width of the grid view. Defaults to infinity.
  • containerWidth: The width of the main container. Relevant if greater than gridViewWidth. Defaults to infinity.
  • containerHeight: The height of the main container. Relevant if greater than gridViewHeight. Defaults to 300.
  • footerWidget: The widget rendered at the bottom of the grid view. Defaults to SizedBox.
  • physics: The physics of the grid view.
  • controller: ScrollController? to controll scroller in the grid view.
  • sectionController: List
  • onNewItemAdded: Callback function when a new item is added to the sections list.
  • onPressed: Callback function when an item in a section is pressed.
  • style: The style to apply to the section grid.
Inheritance

Constructors

SectionGridView({Key? key, required List<Map<String, dynamic>> sections, required Widget renderItem(dynamic data), void onNewItemAdded()?, void onPressed(int sectionIndex, int index)?, double itemSize = 120.0, double minItemDimension = 120.0, double verticalSpacing = 10, double horizontalSpacing = 10, int itemsPerRow = 3, ContainerStyle itemContainerStyle = const ContainerStyle(), bool isFixed = false, bool horizontal = false, bool invertedRow = false, bool adjustGridToStyles = false, double? gridViewHeight, double gridViewWidth = double.infinity, double containerWidth = double.infinity, double? containerHeight, Widget footerWidget = const SizedBox(), ScrollPhysics? physics, ScrollController? controller, List<ScrollController>? sectionController, SectionGridViewStyle style = const SectionGridViewStyle()})
const

Properties

adjustGridToStyles bool
finalinherited
containerHeight double?
finalinherited
containerWidth double
finalinherited
controller ScrollController?
finalinherited
footerWidget Widget
finalinherited
gridViewHeight double?
finalinherited
gridViewWidth double
finalinherited
hashCode int
The hash code for this object.
no setterinherited
horizontal bool
finalinherited
horizontalSpacing double
finalinherited
invertedRow bool
finalinherited
isFixed bool
finalinherited
itemContainerStyle ContainerStyle
finalinherited
itemSize double
finalinherited
itemsPerRow int
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minItemDimension double
finalinherited
onNewItemAdded → void Function()?
final
onPressed → void Function(int sectionIndex, int index)?
final
physics ScrollPhysics?
finalinherited
renderItem Widget Function(dynamic data)
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sectionController List<ScrollController>?
final
sections List<Map<String, dynamic>>
final
style SectionGridViewStyle
final
verticalSpacing double
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SectionGridView>
Creates the mutable state for this widget at a given location in the tree.
override
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