capitalize method
Return a String
with its first character UpperCase and the rest LowerCase.
print('this'.capitalize()); // 'This'
print('THIS'.capitalize()); // 'This'
Implementation
String capitalize() =>
isNotEmpty ? first.toUpperCase() + substring(1).toLowerCase() : this;