parseJson method

dynamic parseJson({
  1. required String json,
  2. dynamic parseAllParamsDirectly = false,
})

Reads the JSON string and creates routes and parameters. Parameters that are not still existing in the route tree are safed in the right nodes for later use, but only if parseAllParamsDirectly is false.

Implementation

parseJson({required String json, parseAllParamsDirectly = false}) {
  late Object object;
  try {
    object = jsonDecode(json);
  } catch (e) {
    throw GgRouteTreeNodeError(
      id: 'GRC008475',
      message: 'Error while decoding JSON: $e',
    );
  }

  _parseJson(object, parseAllParamsDirectly);
}