showModalOptionList<T> function

Future<SettingsOption<T>?> showModalOptionList<T>({
  1. required BuildContext context,
  2. required List<SettingsOption<T>> options,
})

Implementation

Future<SettingsOption<T>?> showModalOptionList<T>({required BuildContext context, required List<SettingsOption<T>> options}) async {
  return await showModalBottomSheet<SettingsOption<T>>(
    context: context,
    isDismissible: true,
    builder: (context) => SettingsOptionList<T>(
      onSelect: (option) {
        // select this track
        Navigator.pop(context, option);
      },
      options: options,
    ),
  );
}