renderItems method

dynamic renderItems(
  1. dynamic context,
  2. dynamic ref,
  3. List spaces
)

Implementation

Widget renderItems(
  BuildContext context,
  WidgetRef ref,
  List<SpaceDetails> spaces,
) {
  return inBox(
    context,
    SingleChildScrollView(
      scrollDirection: Axis.horizontal,
      child: Row(
        children: spaces.map((space) {
          return InkWell(
            child: Container(
              padding: const EdgeInsets.all(10),
              child: Column(
                children: [
                  space.icon,
                  const SizedBox(height: 3),
                  Text(space.name),
                ],
              ),
            ),
            onTap: () {
              if (popBeforeRoute) Navigator.pop(context);
              goToSpace(context, space.navigationTargetId);
            },
          );
        }).toList(),
      ),
    ),
  );
}