applyIf<T> method
Apply the operation
with T
as parameter if condition
is true
Implementation
T applyIf<T>(bool? condition, T Function(T) operation) {
return (condition == true) ? operation(this as T) : this as T;
}
Apply the operation
with T
as parameter if condition
is true
T applyIf<T>(bool? condition, T Function(T) operation) {
return (condition == true) ? operation(this as T) : this as T;
}