我完全无法解决这个错误,是这个平台的新手,任何人都可以帮我清除这个
class _EditBasicDetailsScreenState extends State<EditBasicDetailsScreen> {
final _formKey = GlobalKey<FormState>();
List _locations = List();
String _location_id;
@override
void initState() {
// TODO: implement initState
super.initState();
_location_id = '';
_locations = [
{"location_id": "1", "location_name": "pathirikuppam"},
{"location_id": "2", "location_name": "koothapakam"},
{"location_id": "3", "location_name": "thiruvandhipuram"}
];
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Edit Basic Details"),
),
body: Padding(
padding: EdgeInsets.all(15.0),
child: ListView(children: <Widget>[
Container(
padding: EdgeInsets.all(5.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.pink, style: BorderStyle.solid, width: 0.80),
),
alignment: Alignment.center,
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
hint: Text('Select Shop Location'),
items: _locations.map((dropDowmLocationItem) {
return DropdownMenuItem(
value: dropDowmLocationItem['location_id'].toString(),
child: Text(dropDowmLocationItem['location_name']));
}).toList(),
onChanged: (String newselectedLocation) {
setState(() {
_location_id = newselectedLocation;
});
},
value: _location_id)),
)
]),
),
);
}
}
我附上了错误的屏幕截图,希望它能说明问题所在