selectSpaceDrawer function
Future<String?>
selectSpaceDrawer({ - required dynamic context,
- dynamic key = selectSpaceDrawerKey,
- String canCheck = 'CanLinkSpaces',
- String? currentSpaceId,
- dynamic title,
})
Implementation
Future<String?> selectSpaceDrawer({
required BuildContext context,
Key? key = selectSpaceDrawerKey,
String canCheck = 'CanLinkSpaces',
String? currentSpaceId,
Widget? title,
}) async {
final selected = await showModalBottomSheet(
showDragHandle: true,
enableDrag: true,
context: context,
isDismissible: true,
builder: (context) => SelectRoomDrawer(
key: key,
canCheck: canCheck,
currentSpaceId: currentSpaceId,
title: title ?? Text(L10n.of(context).selectSpace),
keyPrefix: 'select-space',
roomType: RoomType.space,
),
);
if (selected == null) {
// in case of being dismissed, we return the previously selected item
return currentSpaceId;
}
if (selected == '') {
// in case of being cleared, we return null
return null;
}
return selected;
}