NyPullToRefresh<T> class

NyPullToRefresh is a widget that shows a list of items with a pull to refresh. Example:

NyPullToRefresh(
data: (int iteration) async => [1,2,3,4,5].paginate(itemsPerPage: 2, page: iteration).toList(),
  child: (context, data) {
    return Text(data.toString());
})
Inheritance
Available extensions

Constructors

NyPullToRefresh({Key? key, dynamic onRefresh()?, dynamic beforeRefresh()?, dynamic afterRefresh(dynamic data)?, required Widget child(BuildContext context, dynamic data), required Future data(int iteration), Widget? empty, Widget? loading, String? stateName, List<T> transform(List<T>)?, Axis? scrollDirection, bool? reverse, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool? shrinkWrap, EdgeInsets? padding = EdgeInsets.zero, 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, String? headerStyle, Clip? clipBehavior, bool? useSkeletonizer, Widget? header, Widget? footerLoadingIcon, List sort(dynamic items)?})
NyPullToRefresh.grid({Key? key, int? crossAxisCount = 2, double? mainAxisSpacing = 0, double? crossAxisSpacing = 0, dynamic onRefresh()?, dynamic beforeRefresh()?, dynamic afterRefresh(dynamic data)?, required Future data(int iteration), List<T> transform(List<T>)?, required Widget child(BuildContext context, dynamic data), Widget? empty, Widget? loading, String? stateName, Axis? scrollDirection, bool? reverse, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool? shrinkWrap, EdgeInsets? padding = EdgeInsets.zero, 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, String? headerStyle, Clip? clipBehavior, bool? useSkeletonizer, Widget? header, Widget? footerLoadingIcon, List sort(dynamic items)?})
NyPullToRefresh.separated({Key? key, dynamic onRefresh()?, dynamic beforeRefresh()?, dynamic afterRefresh(dynamic data)?, required Future data(int iteration), List<T> transform(List<T>)?, 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 = EdgeInsets.zero, 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, String? headerStyle, Clip? clipBehavior, bool? useSkeletonizer, Widget? header, Widget? footerLoadingIcon, List sort(dynamic items)?})

Properties

addAutomaticKeepAlives bool
final
addRepaintBoundaries bool
final
addSemanticIndexes bool
final
afterRefresh → dynamic Function(dynamic data)?
final
beforeRefresh → dynamic Function()?
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(int iteration)
final
dragStartBehavior DragStartBehavior?
final
empty Widget?
final
findChildIndexCallback ChildIndexGetter?
final
footerLoadingIcon Widget?
final
hashCode int
The hash code for this object.
no setterinherited
final
headerStyle String?
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
onRefresh → dynamic Function()?
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 List Function(dynamic items)?
final
stateName String?
final
transform List<T> Function(List<T>)?
final
useSkeletonizer bool?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _NyPullToRefreshState<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