addSingleExecutionListener method
Registers a listener that will be called only once when the object notifies its listeners. After the listener is called, it is automatically removed.
Implementation
void addSingleExecutionListener(VoidCallback listener) {
late final VoidCallback tempListener;
tempListener = () {
listener();
removeListener(tempListener);
};
// ignore: deprecated_member_use_from_same_package
addListener(tempListener);
}