Kuchiki Nad
Kuchiki Nad

Reputation: 17

Text overflow in Flutter App in InputDecoration

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

Answers (1)

s_erfani
s_erfani

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

Related Questions