titleCase static method
Capitalises the first letter of each word.
Implementation
static String titleCase(String value) => value
.split(' ')
.map(
(w) =>
w.isEmpty ? w : w[0].toUpperCase() + w.substring(1).toLowerCase(),
)
.join(' ');