Check for empty list
parent
cbf384f9e9
commit
ba558adecb
|
@ -10,7 +10,7 @@ class DropDown extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
var inputModel = context.watch<InputProvider>();
|
||||
return DropdownButtonFormField<String>(
|
||||
value: _items[0],
|
||||
value: _items.isEmpty ? null : _items[0],
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
elevation: 16,
|
||||
style: const TextStyle(color: Colors.deepPurple),
|
||||
|
|
Loading…
Reference in New Issue