capitalize function

String? capitalize(
  1. String? source
)

Implementation

String? capitalize(String? source) {
  if (source == null || source.isEmpty) {
    return source;
  } else {
    return source[0].toUpperCase() + source.substring(1);
  }
}