GammaController class

A controller to handle the state of the GammaSmartPagination widget. It is used to control the state of the widget and to notify the widget when the state changes

Inheritance

Constructors

GammaController()
GammaController constructor.

Properties

hasClients bool
Whether any Listener objects have attached themselves to the GammaController using the attachListener method.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
listeners List<VoidCallback>
getter for the controller listeners.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status GammaControllerStatus
getter for the controller status.
no setter
statusString String
getter for the controller status as a string.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
attachListener(VoidCallback listener) → void
add a listener to the controller.
detachListener({VoidCallback? listener}) → void
remove a listener from the controller. @Params: listener is the listener to be removed. If no listener is passed, all listeners will be removed.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setIdle() → void
set the controller status to idle. Use this method when the widget is first rendered. And also it can be used after the first load of data is completed.
setLoading() → void
set the controller status to loading. Use this method when the widget is loading more data.
setLoadingCompleted() → void
set the controller status to loadingCompleted. Use this method when the widget is done loading more data. But there is still more data to load.
setLoadingFailed({String? errorMessage}) → void
set the controller status to loadingFailed. Use this method when the widget failed to load more data. errorMessage is the error message that will be displayed in the footer.
setNoMoreData() → void
set the controller status to noMoreData. Use this method when the widget has loaded all the data. AND there is no more data to load.
setRefreshFailed() → void
set the controller status to refreshingFailed. Use this method when the widget failed to refresh the data.
setRefreshing() → void
set the controller status to refreshing. Use this method when the widget is refreshing the data.
setRefreshingCompleted() → void
set the controller status to refreshingCompleted. Use this method when the widget is done refreshing the data.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited