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