trackCustomPage method

void trackCustomPage(
  1. String title,
  2. Widget widget
)

Implementation

void trackCustomPage(String title, Widget widget) {
  var pageEvent = GrowingPageEvent();
  if (CustomLocationHelper.isLocalWidget(widget)) {
    Map<String, String> locationMap =
        CustomLocationHelper.getLocationInfo(widget);
    if (locationMap["file"] != null) {
      pageEvent.fileName =
          locationMap["file"]!.replaceAll(locationMap["rootUrl"]!, "");
    }
    pageEvent.importUri = locationMap["importUri"];
  }
  pageEvent.title = title;
  pageEvent.widgetName = widget.runtimeType.toString();

  _checkWithGrowingPage(pageEvent, widget);
  GrowingPluginDispatcher.getInstance()
      .trackFlutterPage(pageEvent.toNativeMap());
}