@@ -128,14 +128,20 @@ abstract class ComposeController<ErrorT> extends TextEditingController {
128
128
}
129
129
130
130
enum TopicValidationError {
131
- mandatoryButEmpty,
131
+ /// Error when the topic fails a mandatory-topics check
132
+ /// (see [ComposeTopicController.mandatory] ).
133
+ ///
134
+ /// The term "Vacuous" draws distinction from [String.isEmpty] , in the sense
135
+ /// that certain strings are not empty but also indicate the absence of a topic.
136
+ mandatoryButVacuous,
137
+
132
138
tooLong;
133
139
134
140
String message (ZulipLocalizations zulipLocalizations) {
135
141
switch (this ) {
136
142
case tooLong:
137
143
return zulipLocalizations.topicValidationErrorTooLong;
138
- case mandatoryButEmpty :
144
+ case mandatoryButVacuous :
139
145
return zulipLocalizations.topicValidationErrorMandatoryButEmpty;
140
146
}
141
147
}
@@ -161,17 +167,14 @@ class ComposeTopicController extends ComposeController<TopicValidationError> {
161
167
}
162
168
163
169
/// Whether [textNormalized] would fail a mandatory-topics check
164
- /// (see [mandatory] ).
165
- ///
166
- /// The term "Vacuous" draws distinction from [String.isEmpty] , in the sense
167
- /// that certain strings are not empty but also indicate the absence of a topic.
168
- bool get isTopicVacuous => textNormalized == kNoTopicTopic;
170
+ /// (see [TopicValidationError.mandatoryButVacuous] ).
171
+ bool get _isTopicVacuous => textNormalized == kNoTopicTopic;
169
172
170
173
@override
171
174
List <TopicValidationError > _computeValidationErrors () {
172
175
return [
173
- if (mandatory && isTopicVacuous )
174
- TopicValidationError .mandatoryButEmpty ,
176
+ if (mandatory && _isTopicVacuous )
177
+ TopicValidationError .mandatoryButVacuous ,
175
178
176
179
if (
177
180
_lengthUnicodeCodePointsIfLong != null
0 commit comments