getGroupId static method

Object? getGroupId(
  1. Map? arguments,
  2. NopRoute route
)

Implementation

static Object? getGroupId(Map<dynamic, dynamic>? arguments, NopRoute route) {
  if (arguments == null) return null;

  if (route.groupOwner == null) return null;

  Object? group;
  dynamic groupId;
  try {
    groupId = arguments.remove(route.groupKey);
  } catch (_) {}
  // global
  if (groupId == true || groupId == null) return null;

  if (groupId == false) {
    int id = NopRoute._incGroupId;
    group = '${route.groupName}_$id';
  } else {
    group = groupId;
  }

  return group;
}