groupLeftRouteBuilders static method

Map<String, WidgetBuilder> groupLeftRouteBuilders(
  1. BuildContext context,
  2. RouteSettings routeSettings,
  3. List<AtGroup> _data, {
  4. int? expandIndex,
})

Implementation

static Map<String, WidgetBuilder> groupLeftRouteBuilders(
    BuildContext context, RouteSettings routeSettings, List<AtGroup> _data,
    {int? expandIndex}) {
  return {
    DesktopRoutes.DESKTOP_GROUP_LEFT_INITIAL: (context) {
      if (_data.isEmpty) {
        return const DesktopEmptyGroup(true);
      } else {
        return DesktopGroupList(
          _data,
          key: UniqueKey(),
          expandIndex: expandIndex ?? 0,
        );
      }
    },
    DesktopRoutes.DESKTOP_GROUP_LIST: (context) {
      var args = routeSettings.arguments as Map<String, dynamic>;
      return DesktopGroupList(
        args['groups'],
        expandIndex: args['expandIndex'],
        key: UniqueKey(),
      );
    },
  };
}