@@ -81,7 +81,7 @@ const double _composeButtonSize = 44;
81
81
///
82
82
/// Subclasses must ensure that [_update] is called in all exposed constructors.
83
83
abstract class ComposeController <ErrorT > extends TextEditingController {
84
- int get maxLengthUnicodeCodePoints;
84
+ int ? get maxLengthUnicodeCodePoints;
85
85
86
86
String get textNormalized => _textNormalized;
87
87
late String _textNormalized;
@@ -102,7 +102,8 @@ abstract class ComposeController<ErrorT> extends TextEditingController {
102
102
@visibleForTesting
103
103
int ? get debugLengthUnicodeCodePointsIfLong => _lengthUnicodeCodePointsIfLong;
104
104
int ? _computeLengthUnicodeCodePointsIfLong () =>
105
- _textNormalized.length > maxLengthUnicodeCodePoints
105
+ maxLengthUnicodeCodePoints != null
106
+ && _textNormalized.length > maxLengthUnicodeCodePoints!
106
107
? _textNormalized.runes.length
107
108
: null ;
108
109
@@ -152,7 +153,7 @@ class ComposeTopicController extends ComposeController<TopicValidationError> {
152
153
bool get mandatory => store.realmMandatoryTopics;
153
154
154
155
// TODO(#307) use `max_topic_length` instead of hardcoded limit
155
- @override final maxLengthUnicodeCodePoints = kMaxTopicLengthCodePoints;
156
+ @override final int maxLengthUnicodeCodePoints = kMaxTopicLengthCodePoints;
156
157
157
158
@override
158
159
String _computeTextNormalized () {
@@ -213,7 +214,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
213
214
}
214
215
215
216
// TODO(#1237) use `max_message_length` instead of hardcoded limit
216
- @override final maxLengthUnicodeCodePoints = kMaxMessageLengthCodePoints;
217
+ @override final int maxLengthUnicodeCodePoints = kMaxMessageLengthCodePoints;
217
218
218
219
int _nextQuoteAndReplyTag = 0 ;
219
220
int _nextUploadTag = 0 ;
0 commit comments