@@ -172,6 +172,9 @@ class InputDecorationModel with EquatableMixin, SerializableMixin {
172172 /// Defines minimum and maximum sizes for the [InputDecorator] .
173173 final BoxConstraintsModel constraints;
174174
175+ /// Whether to show counter text.
176+ final bool showCounter;
177+
175178 /// Creates [InputDecorationModel] with given data.
176179 InputDecorationModel ({
177180 this .icon = const MultiSourceIconModel (),
@@ -204,6 +207,7 @@ class InputDecorationModel with EquatableMixin, SerializableMixin {
204207 this .fillColor = ColorRGBA .grey10,
205208 this .focusColor = ColorRGBA .black,
206209 this .hoverColor = ColorRGBA .grey10,
210+ this .showCounter = true ,
207211 this .errorBorder = const InputBorderModel (
208212 borderSide: BorderSideModel (color: ColorRGBA .red),
209213 ),
@@ -291,6 +295,8 @@ class InputDecorationModel with EquatableMixin, SerializableMixin {
291295 String ? semanticCounterText,
292296 bool ? alignLabelWithHint,
293297 BoxConstraintsModel ? constraints,
298+ bool ? showCounter,
299+ bool forceCounterText = false ,
294300 }) =>
295301 InputDecorationModel (
296302 icon: icon ?? this .icon,
@@ -320,7 +326,8 @@ class InputDecorationModel with EquatableMixin, SerializableMixin {
320326 suffixStyle: suffixStyle ?? this .suffixStyle,
321327 suffixIconConstraints:
322328 suffixIconConstraints ?? this .suffixIconConstraints,
323- counterText: counterText ?? this .counterText,
329+ counterText:
330+ forceCounterText ? counterText : counterText ?? this .counterText,
324331 counterStyle: counterStyle ?? this .counterStyle,
325332 filled: filled ?? this .filled,
326333 fillColor: fillColor ?? this .fillColor,
@@ -336,6 +343,7 @@ class InputDecorationModel with EquatableMixin, SerializableMixin {
336343 semanticCounterText: semanticCounterText ?? this .semanticCounterText,
337344 alignLabelWithHint: alignLabelWithHint ?? this .alignLabelWithHint,
338345 constraints: constraints ?? this .constraints,
346+ showCounter: showCounter ?? this .showCounter,
339347 );
340348
341349 @override
@@ -380,6 +388,7 @@ class InputDecorationModel with EquatableMixin, SerializableMixin {
380388 semanticCounterText,
381389 alignLabelWithHint,
382390 constraints,
391+ showCounter,
383392 ];
384393
385394 /// Factory constructor for creating a new [InputDecorationModel] instance
0 commit comments