NyListView<T> class
The NyListView widget is a wrapper for the ListView widget. It provides a simple way to display a list of items. Example:
NyListView(
data: () async => [1,2,3,4,5],
child: (context, data) {
return Text(data.toString());
})
The above example will display a list of numbers. The data is fetched from the data function. The child is the widget that will be displayed for each item in the list.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NyListView
- Available extensions
Constructors
-
NyListView({Key? key, required Widget child(BuildContext context, dynamic data), required Future data(), dynamic transform(List<
T> data)?, Widget? empty, Widget? loading, String? stateName, Axis? scrollDirection, bool? reverse, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool? shrinkWrap, EdgeInsets? padding, double? itemExtent, Widget? prototypeItem, ChildIndexGetter? findChildIndexCallback, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior? dragStartBehavior, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, String? restorationId, Clip? clipBehavior, bool? useSkeletonizer, Widget? header, dynamic sort(List<T> items)?}) -
NyListView.grid({Key? key, int? crossAxisCount = 2, double? mainAxisSpacing = 1.0, double? crossAxisSpacing = 1.0, required Widget child(BuildContext context, dynamic data), required Future data(), dynamic transform(List<
T> data)?, Widget? empty, Widget? loading, String? stateName, Axis? scrollDirection, bool? reverse, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool? shrinkWrap, EdgeInsets? padding, double? itemExtent, Widget? prototypeItem, ChildIndexGetter? findChildIndexCallback, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior? dragStartBehavior, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, String? restorationId, Clip? clipBehavior, bool? useSkeletonizer, Widget? header, dynamic sort(List<T> items)?}) -
NyListView.separated({Key? key, required Future data(), dynamic transform(List<
T> data)?, required Widget child(BuildContext context, dynamic data), required IndexedWidgetBuilder? separatorBuilder, Widget? empty, Widget? loading, String? stateName, Axis? scrollDirection, bool? reverse, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool? shrinkWrap, EdgeInsets? padding, double? itemExtent, Widget? prototypeItem, ChildIndexGetter? findChildIndexCallback, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior? dragStartBehavior, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, String? restorationId, Clip? clipBehavior, bool? useSkeletonizer, Widget? header, dynamic sort(List<T> items)?})
Properties
- addAutomaticKeepAlives → bool
-
final
- addRepaintBoundaries → bool
-
final
- addSemanticIndexes → bool
-
final
- cacheExtent → double?
-
final
- child → Widget Function(BuildContext context, dynamic data)
-
final
- clipBehavior → Clip?
-
final
- controller → ScrollController?
-
final
- crossAxisCount → int?
-
final
- crossAxisSpacing → double?
-
final
- data → Future Function()
-
final
- dragStartBehavior → DragStartBehavior?
-
final
- empty → Widget?
-
final
- findChildIndexCallback → ChildIndexGetter?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
final
- itemExtent → double?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior?
-
final
- kind → String
-
final
- loading → Widget?
-
final
- mainAxisSpacing → double?
-
final
- padding → EdgeInsets?
-
final
- physics → ScrollPhysics?
-
final
- primary → bool?
-
final
- prototypeItem → Widget?
-
final
- restorationId → String?
-
final
- reverse → bool?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection → Axis?
-
final
- semanticChildCount → int?
-
final
- separatorBuilder → IndexedWidgetBuilder?
-
final
- shrinkWrap → bool?
-
final
-
sort
→ dynamic Function(List<
T> items)? -
final
- stateName → String?
-
final
-
transform
→ dynamic Function(List<
T> data)? -
final
- useSkeletonizer → bool?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _NyListViewState< T> -
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
Static Methods
-
stateReset(
String stateName) → dynamic - Resets the state