KoolbaseCollectionGrid class
A collection rendered as a grid rather than a list.
Deliberately thin: KoolbaseCollectionController already owns fetching, stale-while-revalidate and refresh, so this differs from KoolbaseCollectionList only in how records are laid out. Sharing the controller is what keeps the two from drifting on the hard parts.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- KoolbaseCollectionGrid
Constructors
-
KoolbaseCollectionGrid({Key? key, required String collection, required Widget itemBuilder(BuildContext context, KoolbaseRecord record), int crossAxisCount = 2, double spacing = 8, double childAspectRatio = 1, KoolbaseQueryBuilder? query, WidgetBuilder? empty, Widget error(BuildContext context, Object error, Future<
void> retry())?, WidgetBuilder? loading, EdgeInsetsGeometry? padding, @visibleForTesting KoolbaseCollectionController? controller}) -
const
Properties
- childAspectRatio → double
-
Tile width : height.
final
- collection → String
-
The collection to show.
final
- controller → KoolbaseCollectionController?
-
Test seam only.
final
- crossAxisCount → int
-
Tiles across. Fixed rather than responsive — a caller who needs reflow
can vary it from a LayoutBuilder.
final
- empty → WidgetBuilder?
-
Shown when the load succeeded and there are no records.
final
-
error
→ Widget Function(BuildContext context, Object error, Future<
void> retry())? -
Shown when the FIRST load failed with nothing to show. Later refresh
failures keep the records.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemBuilder → Widget Function(BuildContext context, KoolbaseRecord record)
-
Builds one record's tile. Appearance is entirely the caller's.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loading → WidgetBuilder?
-
Shown during the first load. Defaults to a centered spinner.
final
- padding → EdgeInsetsGeometry?
-
final
- query → KoolbaseQueryBuilder?
-
Shapes each fresh query. Null lists the collection unfiltered.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
Gap between tiles, both directions.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< KoolbaseCollectionGrid> -
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