I have tried to change TextFormField prefix icon alignment, but flutter don’t have a property for this.
My code:
TextFormField(
keyboardType: TextInputType.multiline,
style: typography.titleMedium,
validator: (value) {
if (value.isNullOrEmpty) {
_shakeDescKey.currentState?.shake();
return "";
}
bloc.onChangeDescription(value!);
return null;
},
decoration: InputDecoration(
hintText: intl.descMsg,
hintStyle: typography.titleMedium!
.apply(color: AppColors.black.withOpacity(0.5)),
prefixIcon: Icon(FontAwesomeIcons.pen),
cursorColor: Colors.black,
maxLines: 6,
);
I need a property to align vertically prefix icon
2
Answers
This is a solution will help you , If you find another better solution, you can add it here
you will give to
prefixIcon
widget likeconst SizedBox()
and then wrap
TextFormField
with aStack
and use icon as widget like below code
THIS OUTPUT
Wrap Icon widget in Column: