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
Available extensions

Constructors

NyListView({Key? key, required Widget child(BuildContext context, dynamic data), required dynamic data(), dynamic transform(List<T> data)?, Widget? empty, LoadingStyle? loadingStyle, 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, Widget? header, dynamic sort(List<T> items)?})
const
NyListView.grid({Key? key, int? crossAxisCount = 2, double? mainAxisSpacing = 1.0, double? crossAxisSpacing = 1.0, required Widget child(BuildContext context, dynamic data), required dynamic data(), dynamic transform(List<T> data)?, Widget? empty, LoadingStyle? loadingStyle, 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, Widget? header, dynamic sort(List<T> items)?})
const
NyListView.separated({Key? key, required dynamic data(), dynamic transform(List<T> data)?, required Widget child(BuildContext context, dynamic data), required IndexedWidgetBuilder? separatorBuilder, Widget? empty, LoadingStyle? loadingStyle, 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, Widget? header, dynamic sort(List<T> items)?})
const

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 → dynamic Function()
final
dragStartBehavior DragStartBehavior?
final
empty Widget?
final
findChildIndexCallback ChildIndexGetter?
final
hashCode int
The hash code for this object.
no setterinherited
final
itemExtent double?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior?
final
kind String
final
loadingStyle LoadingStyle?
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

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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
faderBottom(int strength, {Color color = Colors.black}) NyFader

Available on StatefulWidget, provided by the NyStateful extension

Make gradient fader from the bottom of the widget.
faderFrom(int strength, {Color color = Colors.black, List<AlignmentGeometry> alignment = const [Alignment.topCenter, Alignment.bottomCenter]}) NyFader

Available on StatefulWidget, provided by the NyStateful extension

fader from bottom
faderLeft(int strength, {Color color = Colors.black}) NyFader

Available on StatefulWidget, provided by the NyStateful extension

Make gradient fader from the left of the widget.
faderRight(int strength, {Color color = Colors.black}) NyFader

Available on StatefulWidget, provided by the NyStateful extension

Make gradient fader from the right of the widget.
faderTop(int strength, {Color color = Colors.black}) NyFader

Available on StatefulWidget, provided by the NyStateful extension

Make gradient fader from the top of the widget.
flexible({Key? key, int flex = 1, FlexFit fit = FlexFit.loose}) Flexible

Available on StatefulWidget, provided by the NyStateful extension

Make a StatefulWidget Flexible. Example:
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
toSkeleton({Key? key, bool? ignoreContainers, bool? justifyMultiLineText, Color? containersColor, bool ignorePointers = true, bool enabled = true, PaintingEffect? effect, TextBoneBorderRadius? textBoneBorderRadius}) → Skeletonizer

Available on Widget, provided by the NyWidget extension

Make a widget a skeleton using the Skeletonizer package.
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

stateReset(String stateName) → dynamic
Resets the state