build method
dynamic
build( - dynamic context,
- dynamic ref
)
Implementation
@override
Widget build(BuildContext context, WidgetRef ref) {
final bookmarkedSpaces = ref.watch(bookmarkedSpacesProvider);
final spaces = ref.watch(spacesProvider);
if (bookmarkedSpaces.isNotEmpty) {
return _RenderSpacesSection(
spaces: bookmarkedSpaces,
limit: bookmarkedSpaces.length,
showAll: true,
showAllCounter: spaces.length,
title: Text(
L10n.of(context).bookmarkedSpaces,
style: Theme.of(context).textTheme.titleSmall,
),
);
}
// fallback
if (spaces.isEmpty) {
return const _NoSpacesWidget();
}
final count = limit == null ? spaces.length : min(spaces.length, limit!);
return _RenderSpacesSection(
spaces: spaces,
limit: count,
showAll: count != spaces.length,
showActions: count == spaces.length,
showAllCounter: spaces.length,
title: InkWell(
key: DashboardKeys.widgetMySpacesHeader,
onTap: () => context.pushNamed(Routes.spaces.name),
child: Text(
L10n.of(context).mySpaces,
style: Theme.of(context).textTheme.titleSmall,
),
),
);
}