showPicker<T extends BaseItem> static method

void showPicker<T extends BaseItem>(
  1. BuildContext context, {
  2. String? regionJson,
  3. List<T>? regionList,
  4. ChangeData? selectProvince,
  5. ChangeData? selectCity,
  6. ChangeData? selectArea,
})

Implementation

static void showPicker<T extends BaseItem>(
  BuildContext context, {
  String? regionJson,
  List<T>? regionList,
  ChangeData? selectProvince,
  ChangeData? selectCity,
  ChangeData? selectArea,
}) {
  List<T>? data;
  if (regionJson != null) {
    data = json.decode(regionJson);
  } else {
    data = regionList;
  }
  Navigator.push(
    context,
    _CityPickerRoute<T>(
        data: data,
        selectProvince: selectProvince,
        selectCity: selectCity,
        selectArea: selectArea,
        theme: Theme.of(context),
        barrierLabel:
            MaterialLocalizations.of(context).modalBarrierDismissLabel),
  );
}