ReorderableGridView class
Usage:
ReorderableGridView(
crossAxisCount: 3,
children: this.data.map((e) => buildItem("$e")).toList(),
onReorder: (oldIndex, newIndex) {
setState(() {
final element = data.removeAt(oldIndex);
data.insert(newIndex, element);
});
},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ReorderableGridView
Constructors
-
ReorderableGridView({Key? key, required List<
Widget> children, DragWidgetBuilder? dragWidgetBuilder, ScrollSpeedController? scrollSpeedController, Clip clipBehavior = Clip.hardEdge, double? cacheExtent, int? semanticChildCount, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, bool reverse = false, required int crossAxisCount, EdgeInsetsGeometry? padding, required ReorderCallback onReorder, ScrollPhysics? physics, bool? primary, double mainAxisSpacing = 0.0, double crossAxisSpacing = 0.0, double? childAspectRatio = 1.0, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, dynamic addSemanticIndexes = true, bool shrinkWrap = true, @Deprecated("Not used any more, because always anti multiDrag now.") bool antiMultiDrag = false})
Properties
- addAutomaticKeepAlives → bool
-
final
- addRepaintBoundaries → bool
-
final
- addSemanticIndexes → dynamic
-
final
- antiMultiDrag → bool
-
I think anti multi drag is loss performance.
So default is false, and only set if you care this case.
final
- cacheExtent → double?
-
final
- childAspectRatio → double?
-
The ratio of the cross-axis to the main-axis extent of each child.
final
-
children
→ List<
Widget> -
final
- clipBehavior → Clip
-
final
- crossAxisCount → int
-
final
- crossAxisSpacing → double
-
final
- dragWidgetBuilder → DragWidgetBuilder?
-
final
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior
-
final
- mainAxisSpacing → double
-
final
- onReorder → ReorderCallback
-
final
- padding → EdgeInsetsGeometry?
-
final
- physics → ScrollPhysics?
-
final
- primary → bool?
-
final
- restorationId → String?
-
final
- reverse → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollSpeedController → ScrollSpeedController?
-
final
- semanticChildCount → int?
-
final
- shrinkWrap → bool
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _ReorderableGridViewState -
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}) → 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