Skip to content

Commit 299c53e

Browse files
committed
revert? "compose [nfc]: Make maxLengthUnicodeCodePoints nullable."
This reverts commit d10140a.
1 parent 1ceaef2 commit 299c53e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/widgets/compose_box.dart

+4-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const double _composeButtonSize = 44;
8383
///
8484
/// Subclasses must ensure that [_update] is called in all exposed constructors.
8585
abstract class ComposeController<ErrorT> extends TextEditingController {
86-
int? get maxLengthUnicodeCodePoints;
86+
int get maxLengthUnicodeCodePoints;
8787

8888
String get textNormalized => _textNormalized;
8989
late String _textNormalized;
@@ -104,8 +104,7 @@ abstract class ComposeController<ErrorT> extends TextEditingController {
104104
@visibleForTesting
105105
int? get debugLengthUnicodeCodePointsIfLong => _lengthUnicodeCodePointsIfLong;
106106
int? _computeLengthUnicodeCodePointsIfLong() =>
107-
maxLengthUnicodeCodePoints != null
108-
&& _textNormalized.length > maxLengthUnicodeCodePoints!
107+
_textNormalized.length > maxLengthUnicodeCodePoints
109108
? _textNormalized.runes.length
110109
: null;
111110

@@ -155,7 +154,7 @@ class ComposeTopicController extends ComposeController<TopicValidationError> {
155154
bool get mandatory => store.realmMandatoryTopics;
156155

157156
// TODO(#307) use `max_topic_length` instead of hardcoded limit
158-
@override final int maxLengthUnicodeCodePoints = kMaxTopicLengthCodePoints;
157+
@override final maxLengthUnicodeCodePoints = kMaxTopicLengthCodePoints;
159158

160159
@override
161160
String _computeTextNormalized() {
@@ -216,7 +215,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
216215
}
217216

218217
// TODO(#1237) use `max_message_length` instead of hardcoded limit
219-
@override final int maxLengthUnicodeCodePoints = kMaxMessageLengthCodePoints;
218+
@override final maxLengthUnicodeCodePoints = kMaxMessageLengthCodePoints;
220219

221220
int _nextQuoteAndReplyTag = 0;
222221
int _nextUploadTag = 0;

0 commit comments

Comments
 (0)