Flutter increase height of TextFormField

前端 未结 6 1161
情书的邮戳
情书的邮戳 2021-02-19 02:48

I am creating a Flutter app. i made the design like this.

My TextFormField form field for email and password heights are small. I want it to be the same size of the bu

6条回答
  •  我寻月下人不归
    2021-02-19 03:26

    Use these two lines to control TextFormField Height inside InputDecoration .

    isDense: true, 
    contentPadding: EdgeInsets.fromLTRB(10, 10, 10, 0),
    

    Full example

    Material(
                    elevation: 4,
                    shadowColor: Colors.blue,
                    shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
                    child: Padding(
                      padding: const EdgeInsets.only(left: 12),
                      child: TextFormField(
                        controller: searchProvider.searchController,
                        keyboardType: TextInputType.text,
                        decoration: InputDecoration(
                            hintText: 'hintText',
                            isDense: true, // important line
                            contentPadding: EdgeInsets.fromLTRB(10, 10, 10, 0),// control your hints text size
                            hintStyle: TextStyle(letterSpacing: 2, color: Colors.black54, fontWeight: FontWeight.bold),
                            fillColor:  Colors.white30 ,
                            filled: true,
                            border: OutlineInputBorder(borderRadius: BorderRadius.circular(30), borderSide: BorderSide.none)),
                      ),
                    ),
                  ),
    

提交回复
热议问题