single static method
Future<SelectData?>
single({
- List<
SelectData> ? data, - String? selectedId,
- required dynamic title,
- required dynamic context,
- SelectStyle? style,
- bool? withSearch = false,
- bool onlySelect = false,
- double? fontSize,
- bool isFull = false,
- bool fullScreen = true,
- 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;
}