Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How scroll over a disabled TextField with fixed number of lines in Flutter?

After i set 'enable: false' i can't see the others lines if a text has more than 9 lines. I need set 'enable:false' because i don't want user edit text in this TextField. I tried use SigleChildScrollView, but it didn't work...

            Container(
                    child:  SingleChildScrollView(
                      child: TextField(
                        enabled: false,
                        keyboardType: TextInputType.multiline,
                        maxLines: 9,
                        controller: chatController,
                        decoration: InputDecoration(

                        hintText: "Chat...",

                        border: OutlineInputBorder(

                       borderRadius: BorderRadius.circular(15.0),
                          ),
                        ),
                      ),
                    ),
                  ),
like image 401
Grégori Fernandes de Lima Avatar asked Oct 30 '25 14:10

Grégori Fernandes de Lima


1 Answers

make readOnly: true now you can't edit the field and still you can scroll the field.

TextFormField( enabled: true, readOnly: true, initialValue: 'initial value', )

like image 121
Navdeep Singh Bhati Avatar answered Nov 02 '25 11:11

Navdeep Singh Bhati