validate method

String validate({
  1. String value = '',
})

Returns a default value if the string is null or empty.

Implementation

String validate({String value = ''}) => isEmptyOrNull ? value : this;