String capitalize() error 'Stack overflow'
IZriouil opened this issue · comments
Using string_extension method capitalize() will trigger a Stack Overflow because of the recursive call to .capitalize() inside.
I believe that's just a small mistake:
/// Capitalize each word inside string
/// Example: your name => Your Name, your name => Your name
String capitalize() {
if (isEmpty) return this;
return split(' ').map((e) => e.capitalize()).join(' ');
}
We should use capitalizeFirst()
instead of capitalize()
.
Good work guys, i like the package !
Is this merged and released ? This is still happening in 2.0.12
Well, I believe that the new version isn't deployed yet on pub.dev
@jayeshpansheriya, do u confirm ?
As a fix for now, u can use the git directly to get the package:
awesome_extensions:
git:
url: https://github.com/jayeshpansheriya/awesome_extensions
it should work fine !
Use 2.0.13.