Using fullWidth causes unwanted behaviour...
oodavid opened this issue · 5 comments
In this example, I trimmed by Theme data back to nothing
AutoSizeTextField(
fullwidth: false,
minLines: 1,
maxLines: 10,
);
In my app, I noticed the issue more prominently with more theming / styling:
MaterialApp(
...
theme: ThemeData(
inputDecorationTheme: InputDecorationTheme(
fillColor: Colors.white,
filled: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(4),
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(4),
borderSide: BorderSide(color: Colors.blue, width: 3),
),
border: OutlineInputBorder(),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 18,
),
hintStyle: TextStyle(
color: Colors.black,
fontSize: 13,
),
contentPadding: EdgeInsets.only(
left: 15,
bottom: 11,
top: 11,
right: 15,
),
),
),
);
... and in my homescreen ...
AutoSizeTextField(
fullwidth: false,
style: Theme.of(context).textTheme.subtitle1,
minLines: 1,
maxLines: 10,
);
No problem. I made a pull-request on a similar plugin here:
https://github.com/huyffs/fitted_text_field_container/pull/3
the functional change:
https://github.com/huyffs/fitted_text_field_container/pull/3/files#diff-ca5b9e5f9a78c48e981a6f01a9c6959e
In this case the plugin wasn't taking into account decoration padding, I imagine borders may need to be factored in too.
Selfishly speaking, I'm looking for a plugin that keeps the font size fixed, but the TextField will expand to fit the contents and be able to flow onto multiple lines. I've not tested auto_size_text_field
in any other conditions :)
+1 need include padding and border