Reputation: 17
I am using InputDecoration to put a hint text in Flutter App. But when I run the app, the text overflown which is not I want as it does not help the user to do it.
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(10, 0, 10, 0),
hintText: 'Enter in numbers (gram)',
helperText: 'Select teaspoon or tablespoon and click "Calculate" button for Water',
border: OutlineInputBorder(),
icon: Icon(Icons.send),
),
I have tried to use Text function at helperText but it has error where Text argument cannot be converted into String. I would prefer to do in InputDecoration rather than using Text function separately. Thanks in advance
Upvotes: 0
Views: 215
Reputation: 494
You can add helperMaxLine
:
InputDecoration(
contentPadding: EdgeInsets.fromLTRB(10, 0, 10, 0),
hintText: 'Enter in numbers (gram)',
helperText: 'Select teaspoon or tablespoon and click "Calculate" button for Water',
helperMaxLines: 2,
border: OutlineInputBorder(),
icon: Icon(Icons.send),
),
Upvotes: 2