Flutter AutoSizeTextField multiline labelText

Viewed 63

the labeltext field I set for AutoSizeTextField is insufficient. Is there a way to do multiline?

AutoSizeTextField(
                                ...
                                style: TextStyle(
                                    fontSize: 22, color: Colors.black),
                                decoration: InputDecoration(
                                    border: OutlineInputBorder(
                                      borderRadius: BorderRadius.circular(10.0),
                                    ),
                                    labelText: AppLocalizations.of(context)
                                        .translate('total_spent'),
                                    labelStyle: TextStyle(
                                        fontSize: 22, color: Colors.black,),
                                    hintText: spent.toString(),
                                    contentPadding: const EdgeInsets.all(10.0),
                                    ...

enter image description here

1 Answers

labelText size depends on AutoSizeTextField's font size if we don't specify the font size on labelStyle.

You can solve it by reducing the fontSize on labelStyle or separate the hit text using \n, label\ntext.

Or providing enough width to AutoSizeTextField.

Related