validate method

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

Check null string, return given value if null

Implementation

String validate([String defaultValue = '']) =>
    isNullOrEmpty ? defaultValue : this!;