capitalizeFirstofEach function

String capitalizeFirstofEach({
  1. required String text,
})

Implementation

String capitalizeFirstofEach({required String text}) => text
    .split(" ")
    .map((str) => (str != "") ? str[0].toUpperCase() + str.substring(1) : "")
    .join(" ");