From ba558adecbe398b7989da9c3b97923308307efaa Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 27 Feb 2023 11:07:46 +0100 Subject: [PATCH] Check for empty list --- lib/widgets/drop_down.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/drop_down.dart b/lib/widgets/drop_down.dart index ae4dec9..845c42c 100644 --- a/lib/widgets/drop_down.dart +++ b/lib/widgets/drop_down.dart @@ -10,7 +10,7 @@ class DropDown extends StatelessWidget { Widget build(BuildContext context) { var inputModel = context.watch(); return DropdownButtonFormField( - value: _items[0], + value: _items.isEmpty ? null : _items[0], icon: const Icon(Icons.arrow_downward), elevation: 16, style: const TextStyle(color: Colors.deepPurple),