validateDropdown static method

String? validateDropdown(
  1. String? selectedKey, {
  2. String fieldName = 'Option',
})

Implementation

static String? validateDropdown(
    String? selectedKey, {
      String fieldName = 'Option',
    }) {
  if (selectedKey == null || selectedKey.isEmpty) {
    return 'Please select $fieldName';
  }
  return null;
}