如何在InputDecoration Flutter中自定义labeltext?

时间:2019-06-26 06:53:16

标签: flutter

我希望水平文本带有输入框click to see desire result,但这不会发生,因为laveltext触摸边框线。有什么办法可以在盒子内制作laveltext?click to see current output

                   DropdownButtonHideUnderline(
                      child: FormBuilderDropdown(
                        attribute: "name",
                        decoration: InputDecoration(
                          contentPadding: EdgeInsets.symmetric(horizontal:15.0,vertical: 8.0),
                          enabledBorder: OutlineInputBorder(
                            borderRadius: BorderRadius.all(
                                 Radius.circular(10.0),),
                            borderSide: BorderSide(color: Colors.white,width: 0.0),
                          ),
                          filled: true,
                          fillColor: Color(0xffD2E8E6),
                          icon: Icon(
                            FontAwesomeIcons.solidUser,
                            color: Colors.black,
                            size: 30.0,
                          ),
                          labelText: 'Contact Name',
                          alignLabelWithHint: true,
                          labelStyle: TextStyle(fontSize: 18.0,color: Color.fromRGBO(61, 61, 61,1)),
                        ),
                        initialValue: 'Santosh Adhikari',
                        items: [
                          'Willem Worthwood',
                          'Santosh Adhikari',
                          'Other'
                        ]
                            .map((person) => DropdownMenuItem(
                                value: person, child: Text("$person")))
                            .toList(),
                      ),
                    ),

0 个答案:

没有答案