-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: capitalize method for String #4734
Conversation
New file: * `string_extension.dart`: extension for `String` Impacted file: * `user_preferences_languages_list.dart`: now using the new `String` extension instead of deprecated library
extension StringExtension on String { | ||
String capitalize() => isEmpty | ||
? this | ||
: this[0].toUpperCase() + (length == 1 ? '' : substring(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify, but replacing (length == 1 ? '' : substring(1)
with just substring(1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@g123k I'll try that, but I would be surprised if substring
accepted a starting index beyond the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@g123k Fair enough, it does work! I still don't see the logic behind it though...
Codecov Report
@@ Coverage Diff @@
## develop #4734 +/- ##
==========================================
- Coverage 9.90% 9.90% -0.01%
==========================================
Files 310 312 +2
Lines 15807 15808 +1
==========================================
- Hits 1566 1565 -1
- Misses 14241 14243 +2
... and 14 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, let's unlock the other upgrade!
What
capitalize
method forString
from an outdated package, and that prevents us from upgrading packageflutter_native_splash
.String
extension.flutter_native_splash
.Part of
Files
New file:
string_extension.dart
: extension forString
Impacted file:
user_preferences_languages_list.dart
: now using the newString
extension instead of deprecated library