I have a function to create a textField
Widget _createNormalTextField(
String hintTxt,
TextEditingController controller,
TextInputType inputType,
String Function(String) validation,
Function(String) onTextChanged,
int length,
Widget suffixIcon) {
return Container(
margin: EdgeInsets.symmetric(vertical: 8),
child: new TextFormField(
controller: controller,
maxLength: length,
keyboardType: inputType,
validator: validation,
onChanged: onTextChanged,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(bottom: -10.0),
suffixIcon: suffixIcon,
hintText: hintTxt,
)),
);
}
and i am creating few textfields like this:
Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(flex: 2, child: Text("Discount")),
SizedBox(
width: 4,
),
Expanded(
flex: 1,
child: _createNormalTextField(
"", _discountPercentController, TextInputType.number, null,
(txt) {
setState(() {
calculateAmount(txt);
});
}, 2, Text("%")),
),
SizedBox(
width: 4,
),
Expanded(
flex: 2,
child: _createNormalTextField(
"Amount",
_discountAmountController,
TextInputType.number,
null,
(txt) {},
5,
null),
),
],
),
],
);
i used '%' Text as suffix icon. but it creates '%' at middle and takes padding which i dont want. i have attached image of what i got and what i want :
i got:
i wanted suffix icon at the bottom right , like::
so does anyone knows workaround for this??


