isFalsey function

bool isFalsey(
  1. dynamic value
)

Implementation

bool isFalsey(dynamic value) {
  return value == null ||
      (value is bool && value == false) ||
      (value is String && value.trim() == '') ||
      (value is num && value == 0);
}