@@ -81,7 +81,7 @@ const double _composeButtonSize = 44;
8181///
8282/// Subclasses must ensure that [_update] is called in all exposed constructors.
8383abstract class ComposeController <ErrorT > extends TextEditingController {
84- int get maxLengthUnicodeCodePoints;
84+ int ? get maxLengthUnicodeCodePoints;
8585
8686 String get textNormalized => _textNormalized;
8787 late String _textNormalized;
@@ -102,7 +102,8 @@ abstract class ComposeController<ErrorT> extends TextEditingController {
102102 @visibleForTesting
103103 int ? get debugLengthUnicodeCodePointsIfLong => _lengthUnicodeCodePointsIfLong;
104104 int ? _computeLengthUnicodeCodePointsIfLong () =>
105- _textNormalized.length > maxLengthUnicodeCodePoints
105+ maxLengthUnicodeCodePoints != null
106+ && _textNormalized.length > maxLengthUnicodeCodePoints!
106107 ? _textNormalized.runes.length
107108 : null ;
108109
@@ -152,7 +153,7 @@ class ComposeTopicController extends ComposeController<TopicValidationError> {
152153 bool get mandatory => store.realmMandatoryTopics;
153154
154155 // TODO(#307) use `max_topic_length` instead of hardcoded limit
155- @override final maxLengthUnicodeCodePoints = kMaxTopicLengthCodePoints;
156+ @override final int maxLengthUnicodeCodePoints = kMaxTopicLengthCodePoints;
156157
157158 @override
158159 String _computeTextNormalized () {
@@ -213,7 +214,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
213214 }
214215
215216 // TODO(#1237) use `max_message_length` instead of hardcoded limit
216- @override final maxLengthUnicodeCodePoints = kMaxMessageLengthCodePoints;
217+ @override final int maxLengthUnicodeCodePoints = kMaxMessageLengthCodePoints;
217218
218219 int _nextQuoteAndReplyTag = 0 ;
219220 int _nextUploadTag = 0 ;
0 commit comments