I am creating below registration form in Flutter.
TextStyle white =
new TextStyle(color: Colors.white, decorationColor: Colors.white);
TextStyle grey =
new TextStyle(color: Colors.grey, decorationColor: Colors.white);
I want to apply white style to DropDownButton and grey to DropDownMenuItem. But, the style of DropDownMenu item is also applied to DDButton.
Also, can I "match_parent" the width of DropDownButton like TextField (as in image)?
Here is the code:
child: new Center(
child: new ListView(
shrinkWrap: true,
padding: new EdgeInsets.only(left: 24.0, right: 24.0),
children: <Widget>[
new ListTile(
leading: const Icon(
Icons.language,
color: Colors.white,
),
title: new DropdownButton(
items:
<String>['India', 'Australia', 'USA'].map((String value) {
return new DropdownMenuItem<String>(
value: value,
child: new Text(value, ),
);
}).toList(),
value: selected,
onChanged: (String value) {
setState(() {
selected = value;
});
},
style: white,
),
),
new ListTile(
leading: const Icon(Icons.smartphone, color: Colors.white),
title: new TextField(
decoration: new InputDecoration(
hintText: "Phone Number", hintStyle: white),
keyboardType: TextInputType.phone,
style: white,
),
),...