FitGrid class

Виджет сетки плиток с автоподбором размера и количества под область.

Автоматически рассчитывает оптимальное размещение виджетов в сетке с учетом заданных параметров: количества элементов, выравнивания, отступов и максимального размера плиток.

Поддерживает пагинацию: отображает только элементы текущей страницы и уведомляет о текущей странице и общем количестве страниц через pageInfoNotifier.

Inheritance

Constructors

FitGrid({Key? key, required List<Widget> children, required int maxItemsPerPage, required AlignmentDirectional alignment, Size itemPadding = const Size(8, 8), EdgeInsets gridPadding = EdgeInsets.zero, double? aspectRatio, ValueNotifier<FitGridPageInfo>? pageInfoNotifier, int? currentPage, List<TileSizePreset> presets = tileSizePresets})
const

Properties

alignment → AlignmentDirectional
Выравнивание сетки внутри области.
final
aspectRatio → double?
Пропорции плитки (width / height). Если null, используется 1:1
final
children → List<Widget>
Список виджетов-карточек для отображения в сетке
final
currentPage → int?
Текущая страница (начинается с 1).
final
gridPadding → EdgeInsets
Внешние отступы сетки от границ области
final
hashCode → int
The hash code for this object.
no setterinherited
itemPadding → Size
Отступы между плитками (width = горизонтальный, height = вертикальный)
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxItemsPerPage → int
Максимальное количество элементов на странице
final
pageInfoNotifier → ValueNotifier<FitGridPageInfo>?
ValueNotifier для передачи информации о текущей странице и общем количестве страниц.
final
presets → List<TileSizePreset>
Список пресетов размеров плитки, из которых выбирается оптимальный.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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