Correct toTitleCase function
This commit is contained in:
parent
66c320cfd4
commit
22137f66cf
|
|
@ -265,8 +265,7 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
|
|||
.toList(),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
for (var gatewayTypeId
|
||||
in gateway?.options.keys ?? <String>[])
|
||||
for (var gatewayTypeId in gateway?.options.keys ?? <String>[])
|
||||
SwitchListTile(
|
||||
title: Text(kGatewayTypes.containsKey(gatewayTypeId)
|
||||
? localization
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ String toTitleCase(String text) {
|
|||
return text.toUpperCase();
|
||||
}
|
||||
|
||||
text = toSpaceCase(text.toLowerCase());
|
||||
text = toSpaceCase(text);
|
||||
|
||||
final words = text.split(' ');
|
||||
final capitalized = words.map((word) {
|
||||
if (word == 'url') {
|
||||
|
|
@ -63,7 +64,7 @@ String toTitleCase(String text) {
|
|||
}
|
||||
|
||||
final first = word.substring(0, 1).toUpperCase();
|
||||
final rest = word.substring(1);
|
||||
final rest = word.substring(1).toLowerCase();
|
||||
return '$first$rest';
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue