Skip to content

Commit

Permalink
non-nullable onChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
darkhan.nausharipov committed Nov 21, 2022
1 parent 70c0d61 commit 5ad067f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import 'builders/sdks.dart';

class SdkDropdown extends StatelessWidget {
final String sdkId;
final ValueChanged<String?> onChanged;
final ValueChanged<String> onChanged;
const SdkDropdown({
required this.sdkId,
required this.onChanged,
Expand All @@ -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(
Expand Down

0 comments on commit 5ad067f

Please sign in to comment.