showPickerFromType static method

Future<PickerFromTypeItem?> showPickerFromType(
  1. BuildContext context,
  2. List<PickerFromTypeItem> fromTypes
)

show 选择弹窗

Implementation

static Future<PickerFromTypeItem?> showPickerFromType(
    BuildContext context, List<PickerFromTypeItem> fromTypes) async {
  PickerFromTypeItem? type;
  if (fromTypes.length == 1 &&
      fromTypes.first.fromType != PickerFromType.cancel) {
    type = fromTypes.first;
  } else {
    type = await showCupertinoModalPopup<PickerFromTypeItem?>(
        context: context,
        builder: (_) => fromTypesBuilder(context, fromTypes));
  }
  return type;
}