buildStateAndCityRow function
Implementation
Widget buildStateAndCityRow(
OrganizationCubit cubit,
OrganizationState state,
List<String> stateList,
Map<String, List<String>> indiaStatesWithCities,
) {
return Row(
children: [
Expanded(
child: buildColumnWithDropdown(
"State",
stateList,
state.selectedState,
"Select state",
(val) => cubit.setSelectedState(val),
false,
),
),
const SizedBox(width: 20),
Expanded(
child: buildColumnWithDropdown(
"City",
state.selectedState != null &&
indiaStatesWithCities.containsKey(state.selectedState)
? indiaStatesWithCities[state.selectedState]!
: [],
state.selectedCity,
"Select city",
(val) => cubit.setSelectedCity(val),
false,
),
),
],
);
}