spaceDescription method

dynamic spaceDescription(
  1. dynamic context,
  2. dynamic ref
)

Implementation

Widget spaceDescription(BuildContext context, WidgetRef ref) {
  final spaceLoader = ref.watch(spaceProvider(spaceId));
  return spaceLoader.when(
    data: (space) {
      final topic = space.topic();
      return SelectionArea(
        child: GestureDetector(
          onTap: () async {
            if (await editDescriptionPermissionCheck(ref) &&
                context.mounted) {
              showEditDescriptionBottomSheet(
                context: context,
                ref: ref,
                spaceId: spaceId,
              );
            }
          },
          child: Text(
            topic ?? L10n.of(context).noTopicFound,
            style: Theme.of(context).textTheme.bodySmall,
          ),
        ),
      );
    },
    error: (e, s) {
      _log.severe('Failed to load space', e, s);
      return Text(L10n.of(context).failedToLoadSpace(e));
    },
    loading: () => Skeletonizer(
      child: Text(L10n.of(context).loading),
    ),
  );
}