Function throttle(Function func, Duration delay) { Timer? timer; return () { if (timer == null || !timer!.isActive) { timer = Timer(delay, () => func()); } }; }