generateLink method

String? generateLink(
  1. Object? pageData
)

Returns the deep link generated by this page for the given pageData.

If linkGenerator is not set, it returns null.

If the linkGenerator is set and the generated link does not start with a '/', it recursively calls the generateLink method of the parent page factory to create a complete link. In this case, the createParentPageData method is used to generate the parent page data.

Implementation

String? generateLink(Object? pageData) {
  if (linkGenerator == null) {
    return null;
  }

  assert(
    pageData is R,
    'pageData must be of type $R, but got ${pageData.runtimeType}', // coverage:ignore-line
  );

  return _buildFullLinkPath(pageData as R);
}