FunctionExtensions extension

事件目标操作 void increase() { count += 1; }

on

Methods

debounce({int? timeout}) VoidCallback

Available on Function, provided by the FunctionExtensions extension

防抖 increase.debounce(timeout: 1000)
throttle() VoidCallback

Available on Function, provided by the FunctionExtensions extension

节流 () async{ await Future.delayed(Duration(seconds: 1)); increase(); }.throttle()
throttleWithTimeout({int? timeout}) VoidCallback

Available on Function, provided by the FunctionExtensions extension

指定时间节流 increase.throttleWithTimeout(2000)