In my app I would like to make the suffixText
property of the InputDecoration
of a TextFormField
always visible (not just when the field is not empty or when it is focused). I took a look at the flutter code and it is a 1-line change on the input_decorator.dart
file. This file is used by text_field.dart
which is used by text_form_field.dart
. Of course I know that I could copy-paste all that 3 files in my project with my 1-line change. But is this the best option? There are several drawbacks:
- If the flutter team updates those files (e.g. because of a bug), I have to patch them manually every time by copy-pasting
- I have to add 6k lines of code to my project
- I'm not sure if I can even copy-paste that code to my project because of the terms of the license
All of this for a 1-line change. Please tell me that there are better way of achieving this result. Thanks in advance!
CodePudding user response:
Based on the highest score answer from this question, you can do something like this to have a permanent suffix, I've tried on DartPad and it works:
TextFormField(
decoration: const InputDecoration(
suffixIcon: Text('permanent suffix'),
suffixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0),
))