singleV2 static method
Future<SelectData?>
singleV2({
- 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,
Implementation
static Future<SelectData?> singleV2({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}) 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) {
if (_selectStates.context != context) {
_selectStates.offset = 0;
}
_selectStates.context = context;
return SelectBaseV2(
fontSize: fontSize,
withSearch: withSearch,
data: data ?? [],
selectedid: selectedId,
title: title,
style: style!,
isFull: isFull,
onlySelect: onlySelect,
);
},
);
});
return _selectedData;
}