Merge pull request #717 from nitishk72/capitalize-extension-fix
fix(ui): fix capitalize extension not working on empty strings
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
-[[#687]](https://github.com/GetStream/stream-chat-flutter/issues/687): Fix Users losing their place in the conversation after replying in threads.
|
-[[#687]](https://github.com/GetStream/stream-chat-flutter/issues/687): Fix Users losing their place in the conversation after replying in threads.
|
||||||
- Fixed floating date stream subscription causing "Bad state: stream has already been listened.” error.
|
- Fixed floating date stream subscription causing "Bad state: stream has already been listened.” error.
|
||||||
|
- Fixed `String` capitalize extension not working on empty strings.
|
||||||
|
|
||||||
✅ Added
|
✅ Added
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ final _emojiChars = Emoji.chars();
|
|||||||
extension StringExtension on String {
|
extension StringExtension on String {
|
||||||
/// Returns the capitalized string
|
/// Returns the capitalized string
|
||||||
String capitalize() =>
|
String capitalize() =>
|
||||||
'${this[0].toUpperCase()}${substring(1).toLowerCase()}';
|
isNotEmpty ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' : '';
|
||||||
|
|
||||||
/// Returns whether the string contains only emoji's or not.
|
/// Returns whether the string contains only emoji's or not.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user