FlexGap class

A flexible and customizable widget that adds spacing between its children based on various configurations.

flex_gap allows you to create a row or column of widgets with customizable spacing between them.

  • children: The list of widgets to be displayed.
  • axis: The main axis direction. Defaults to Axis.vertical.
  • startSpacerIndex: The index from which to start applying an expanded space. Defaults to 0.
  • globalSpace: The space to be applied between all elements. Defaults to 0.0.
  • locatedSpace: A map where keys are indices and values are the space to be applied at the specified index.
  • crossAxisAlignment: How the children should be placed relative to the cross axis. Defaults to CrossAxisAlignment.start.
  • mainAxisAlignment: How the children should be placed relative to the main axis. Defaults to MainAxisAlignment.start.
  • isScrollable: Determines whether the widget should be scrollable. Defaults to false.
  • physics: The physics of the scrolling area. Defaults to BouncingScrollPhysics.
  • isAdaptative: Determines whether the widget should adapt its size based on available space. Defaults to false.
Inheritance

Constructors

FlexGap({Key? key, required List<Widget> children, Axis? axis, int startSpacerIndex = 0, double globalSpace = 0.0, Map<int, double> locatedSpace = const {}, CrossAxisAlignment? crossAxisAlignment, MainAxisAlignment? mainAxisAlignment, bool isScrollable = false, ScrollPhysics? physics, bool isAdaptive = false, ScrollController? scrollController, bool isScrollableWithReverse = false})
const

Properties

axis → Axis?
final
children → List<Widget>
final
crossAxisAlignment → CrossAxisAlignment?
final
globalSpace → double
final
hashCode → int
The hash code for this object.
no setterinherited
isAdaptive → bool
Disclaimer:
final
isScrollable → bool
final
isScrollableWithReverse → bool
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locatedSpace → Map<int, double>
Apply spacing between widgets starting from index 1 and ending at (n - 1).
final
mainAxisAlignment → MainAxisAlignment?
final
physics → ScrollPhysics?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollController → ScrollController?
final
startSpacerIndex → int
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