KinGridView class
A themed, flexible grid with optional section headers and adaptive columns.
Automatically calculates column count based on minItemWidth or uses a fixed crossAxisCount. Supports section-based layouts with titles.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- KinGridView
Constructors
-
KinGridView({Key? key, required List<
Widget> children, double minItemWidth = 160, int? crossAxisCount, double spacing = KinSpacing.sm, double? crossAxisSpacing, double childAspectRatio = 1.0, String? title, EdgeInsetsGeometry? padding, bool shrinkWrap = false, ScrollPhysics? physics}) -
const
Properties
- childAspectRatio → double
-
Child aspect ratio (width / height).
final
-
children
→ List<
Widget> -
Items to display.
final
- crossAxisCount → int?
-
Fixed column count. Overrides minItemWidth.
final
- crossAxisSpacing → double?
-
Cross-axis spacing. Defaults to spacing.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- minItemWidth → double
-
Minimum width per item. Columns are auto-calculated.
Ignored if crossAxisCount is set.
final
- padding → EdgeInsetsGeometry?
-
Scroll padding.
final
- physics → ScrollPhysics?
-
Scroll physics.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shrinkWrap → bool
-
Whether this grid scrolls. If false, wraps with shrinkWrap
for use inside other scrollable parents.
final
- spacing → double
-
Spacing between items.
final
- title → String?
-
Optional section title above the grid.
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
Static Methods
-
bento(
{Key? key, required List< KinBentoItem> items, int columns = 4, double spacing = KinSpacing.sm, double cellAspectRatio = 1.0, String? title, EdgeInsetsGeometry? padding}) → Widget - Creates a bento-style grid where each item can span multiple rows/columns.
-
builder<
T> ({Key? key, required List< T> items, required Widget itemBuilder(BuildContext context, T item, int index), double minItemWidth = 160, int? crossAxisCount, double spacing = KinSpacing.sm, double? crossAxisSpacing, double childAspectRatio = 1.0, String? title, EdgeInsetsGeometry? padding, bool shrinkWrap = false, ScrollPhysics? physics}) → Widget - Creates a grid from a list of data with a builder.
-
masonry(
{Key? key, required List< Widget> children, int crossAxisCount = 2, double spacing = KinSpacing.sm, double? crossAxisSpacing, String? title, EdgeInsetsGeometry? padding}) → Widget - Creates a masonry-style grid with variable-height items (no fixed aspect ratio).