FlutstrapGrid class

Flutstrap Grid Component

Important Notes:

  • Properly coordinates between FlutstrapRow and FlutstrapCol for grid layouts
  • Uses flex-based grid system for proper column distribution
  • Maintains responsive behavior across all breakpoints
Inheritance

Constructors

FlutstrapGrid({Key? key, required List<Widget> children, bool fluid = false, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, Color? color, Decoration? decoration, AlignmentGeometry? alignment, double? rowGap})
const
FlutstrapGrid.autoFit({required List<Widget> children, required double minColumnWidth, double gap = FSSpacing.md, bool fluid = false, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin})
Create an auto-fit grid that adjusts columns based on available width
factory
FlutstrapGrid.cards({required List<Widget> cards, int columns = 3, double gap = FSSpacing.md, bool fluid = false, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, bool equalHeight = true})
✅ FIXED: Create a card grid layout
factory
FlutstrapGrid.multipleRows({required List<List<Widget>> rows, double? rowGap, double? columnGap, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start, bool fluid = false, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin})
Quick grid creation with multiple rows
factory
FlutstrapGrid.responsive({required List<Widget> children, int xsColumns = 1, int? smColumns, int? mdColumns, int? lgColumns, int? xlColumns, int? xxlColumns, double? gap, bool fluid = false, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin})
✅ FIXED: Create a responsive grid that properly wraps columns
factory
FlutstrapGrid.singleRow({required List<Widget> columns, double? gap, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start, bool fluid = false, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin})
Quick grid creation with a single row
factory

Properties

alignment AlignmentGeometry?
final
children List<Widget>
final
color Color?
final
decoration Decoration?
final
fluid bool
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
final
padding EdgeInsetsGeometry?
final
rowGap double?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
copyWith({Key? key, List<Widget>? children, bool? fluid, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, Color? color, Decoration? decoration, AlignmentGeometry? alignment, double? rowGap}) FlutstrapGrid
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
fluidGrid() FlutstrapGrid
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
withColor(Color newColor) FlutstrapGrid
withDecoration(Decoration newDecoration) FlutstrapGrid
withMargin(EdgeInsetsGeometry customMargin) FlutstrapGrid
withPadding(EdgeInsetsGeometry customPadding) FlutstrapGrid
withRowGap(double gap) FlutstrapGrid

Operators

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

Constants

defaultColumnGap → const double
defaultRowGap → const double