diff --git a/learning/tour-of-beam/frontend/lib/components/sdk_dropdown.dart b/learning/tour-of-beam/frontend/lib/components/sdk_dropdown.dart index 15c8cbdea97d..bfa22578757c 100644 --- a/learning/tour-of-beam/frontend/lib/components/sdk_dropdown.dart +++ b/learning/tour-of-beam/frontend/lib/components/sdk_dropdown.dart @@ -23,7 +23,7 @@ import 'builders/sdks.dart'; class SdkDropdown extends StatelessWidget { final String sdkId; - final ValueChanged onChanged; + final ValueChanged onChanged; const SdkDropdown({ required this.sdkId, required this.onChanged, @@ -40,7 +40,11 @@ class SdkDropdown extends StatelessWidget { return _DropdownWrapper( child: DropdownButton( value: sdkId, - onChanged: onChanged, + onChanged: (value) { + if (value != null) { + onChanged(value); + } + }, items: sdks .map( (sdk) => DropdownMenuItem(