FuncUtils class
函数工具类
提供防抖、节流等常用函数工具,支持类型安全和取消功能
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
clampMax(
double a, double b) → double - 限制最大值
-
clampMin(
double a, double b) → double - 限制最小值
-
debounce(
void func(), Duration delay) → (void Function(), void Function()) - 防抖函数
-
debounceWithArgs<
T> (void func(T), Duration delay) → (void Function(T), void Function()) - 防抖函数(带参数)
-
max<
T extends num> (T a, T b) → T - 两个值中取最大值
-
min<
T extends num> (T a, T b) → T - 两个值中取最小值
-
randomInt(
int min, int max) → int - 在一个指定范围内随机一个整数
-
throttle(
void func(), Duration delay) → (void Function(), void Function()) - 节流函数
-
throttleWithArgs<
T> (void func(T), Duration delay) → (void Function(T), void Function()) - 节流函数(带参数)