ifFalsy function

String ifFalsy(
  1. String? a,
  2. String b
)

Method that will returns a if a is not null or an empty string. Otherwise, b will be returned.

Implementation

String ifFalsy(String? a, String b) {
  return validate(a, (x) => (x ?? '').isNotEmpty) ? a! : b;
}