SimpleGridView class

SimpleGridView is a widget for displaying a simple grid view.

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

Properties:

  • data: The data to display in the grid.
  • 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. Specific properties for SimpleGridView:
  • style: The style to apply to the simple grid view.
Inheritance

Constructors

SimpleGridView({Key? key, required List data, required Widget renderItem(dynamic data), 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 = 300, double gridViewWidth = double.infinity, double containerWidth = double.infinity, double containerHeight = 300, Widget footerWidget = const SizedBox(), ScrollPhysics? physics, ScrollController? controller, SimpleGridViewStyle style = const SimpleGridViewStyle()})
const

Properties

adjustGridToStyles bool
finalinherited
containerHeight double?
finalinherited
containerWidth double
finalinherited
controller ScrollController?
finalinherited
data List
final
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
physics ScrollPhysics?
finalinherited
renderItem Widget Function(dynamic data)
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style SimpleGridViewStyle
final
verticalSpacing double
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SimpleGridView>
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