Merge pull request #717 from nitishk72/capitalize-extension-fix

fix(ui): fix capitalize extension not working on empty strings
This commit is contained in:
Salvatore Giordano
2021-10-04 13:51:08 +02:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
@@ -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.
- Fixed floating date stream subscription causing "Bad state: stream has already been listened.” error.
- Fixed `String` capitalize extension not working on empty strings.
✅ Added
@@ -12,7 +12,7 @@ final _emojiChars = Emoji.chars();
extension StringExtension on String {
/// Returns the capitalized string
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.
///