single static method

Future<SelectData?> single({
  1. List<SelectData>? data,
  2. String? selectedId,
  3. required dynamic title,
  4. required dynamic context,
  5. SelectStyle? style,
  6. bool? withSearch = false,
  7. bool onlySelect = false,
  8. double? fontSize,
  9. bool isFull = false,
  10. bool fullScreen = true,
  11. double? offset,
})

Implementation

static Future<SelectData?> single({List<SelectData>? data, String? selectedId, required title, required context, SelectStyle? style, bool? withSearch = false, bool onlySelect = false, double? fontSize, bool isFull = false, bool fullScreen = true, double? offset}) async {
  style ??= SelectStyle();
  final FocusScopeNode currentScope = FocusScope.of(context);
  if (!currentScope.hasPrimaryFocus && currentScope.hasFocus) {
    FocusManager.instance.primaryFocus!.unfocus();
  }
  await Future.delayed(Duration.zero, () async {
    return showModalBottomSheet<void>(
      isScrollControlled: true,
      backgroundColor: Colors.transparent,
      context: context,
      builder: (BuildContext context) => SelectBase(
        fontSize: fontSize,
        withSearch: withSearch,
        data: data ?? [],
        selectedid: selectedId,
        title: title,
        style: style!,
        isFull: isFull,
        onlySelect: onlySelect,
        fullScreen: fullScreen,
        offset: offset,
      ),
    );
  });
  return _selectedData;
}