validate method

String validate([
  1. String value = ''
])

Check null string, return given value if null

Implementation

String validate([String value = '']) =>
    this?.trim().isEmptyOrNull ?? true ? value : this!;