File tree 1 file changed +11
-0
lines changed
modules/ensemble/lib/widget/input
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,8 @@ abstract class BaseTextInput extends StatefulWidget
147
147
_controller.enableClearText = Utils .optionalBool (value),
148
148
'dismissibleKeyboard' : (value) =>
149
149
_controller.dismissibleKeyboard = Utils .getBool (value, fallback: _controller.dismissibleKeyboard),
150
+ 'endingWidget' : (widget) =>
151
+ _controller.endingWidget = widget,
150
152
'obscureToggle' : (value) =>
151
153
_controller.obscureToggle = Utils .optionalBool (value),
152
154
'obscured' : (widget) => _controller.obscureText == true ,
@@ -228,6 +230,9 @@ class TextInputController extends FormFieldController with HasTextPlaceholder {
228
230
bool ? enableClearText;
229
231
bool dismissibleKeyboard = true ;
230
232
233
+ // Ending widget for the input field
234
+ dynamic endingWidget;
235
+
231
236
// applicable only for TextInput
232
237
bool ? obscureText;
233
238
@@ -473,6 +478,12 @@ class TextInputState extends FormFieldWidgetState<BaseTextInput>
473
478
);
474
479
}
475
480
481
+ if (widget.controller.endingWidget != null ) {
482
+ decoration = decoration.copyWith (
483
+ suffixIcon: scopeManager! .buildWidgetFromDefinition (widget.controller.endingWidget),
484
+ );
485
+ }
486
+
476
487
return InputWrapper (
477
488
type: TextInput .type,
478
489
controller: widget._controller,
You can’t perform that action at this time.
0 commit comments