Teks input flutter dimulai dengan huruf besar
TextField(
keyboardType: TextInputType.text,
textCapitalization: TextCapitalization.sentences
)
Glamorous Gibbon
TextField(
keyboardType: TextInputType.text,
textCapitalization: TextCapitalization.sentences
)
textCapitalization: TextCapitalization.sentences
extension StringExtension on String {
String capitalize() {
return "${this[0].toUpperCase()}${this.substring(1).toLowerCase()}";
}
}
// use the StringExtension like this
import "string_extension.dart";
var someCapitalizedString = "someString".capitalize();
extension CapExtension on String {
String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}';
String get allInCaps => this.toUpperCase();
String get capitalizeFirstofEach => this.split(" ").map((str) => str.capitalize).join(" ");
}