throttle method
Implementation
void throttle(VoidCallback callback) {
final now = DateTime.now();
if (_lastRun == null || now.difference(_lastRun!) >= duration) {
_lastRun = now;
callback();
}
}
void throttle(VoidCallback callback) {
final now = DateTime.now();
if (_lastRun == null || now.difference(_lastRun!) >= duration) {
_lastRun = now;
callback();
}
}