Skip to content

Commit b6c634a

Browse files
committed
Text field and code-gen improvements
- Fix code-gen not generating expands and maxLines code properly. - Fix text field counter text not working properly. - Remove FittedBox from scaffold codegen. - Add showCounter prop for input decoration. - Fix text field with incorrect sizing in codegen.
1 parent dfaea7e commit b6c634a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/src/api/models/input_decoration.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

lib/src/api/models/input_decoration.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)