toJson method

Map<String, dynamic> toJson({
  1. bool detail = false,
})

Implementation

Map<String, dynamic> toJson({bool detail = false}) {
  var ps = NRouterJsonTransfrom.encodeMap(params);
  final qps = NRouterJsonTransfrom.encodeMap(queryParams);
  if (isErrorEntry) {
    return {
      'page': path,
      'isErrorPage': true,
    };
  }
  return {
    'path': detail ? path : _path,
    'id': _id,
    'index': nPage.index,
    'params': ps,
    'queryParams': qps,
    'groupId': _groupId,
    'pageKey': pageKey.value,
  };
}