Home > Mobile >  Custom Decoration for DropDown Flutter
Custom Decoration for DropDown Flutter

Time:11-12

can anyone help me get the same style from these textField to my DropDown widget ?

This is the textField widget

TextFormField(
        obscureText: obscureText,
        controller: controller,
        style: TextStyle(color: Colors.white),
        decoration: InputDecoration(
            contentPadding:
                EdgeInsets.symmetric(vertical: 0, horizontal: 12),
            enabledBorder: OutlineInputBorder(
                borderSide: BorderSide(color: Colors.purple[800])),
            border: OutlineInputBorder(
                borderSide: BorderSide(color: Colors.purple[800])),
            focusedBorder: OutlineInputBorder(
              borderSide: BorderSide(color: Colors.purple[800], width: 2.0),
            )),
        validator: validator),

and this my DropDown :

DropdownButton(
                    value: professionChoosed,
                    onChanged: (newValue) {
                      setState(() {
                        professionChoosed = newValue;
                      });
                    },
                    items: professionList.map((valueItem) {
                      return DropdownMenuItem(
                        value: valueItem,
                        child: Text(valueItem),
                      );
                    }).toList(),
                  ),

This is a preview of the simulator : image

  • Related