reportDependencyLinkedToRoute method

void reportDependencyLinkedToRoute(
  1. String dependencyKey
)

Links a Class instance S (or tag) to the current route. Requires usage of GetMaterialApp. 将类实例 S(或 tag)绑定到当前路由. 需要使用 GetMaterialApp.

Implementation

void reportDependencyLinkedToRoute(String dependencyKey) {
  // 如果没有当前路由,则返回
  if (_current == null) return;
  // 绑定关系
  if (_routesKey.containsKey(_current)) {
    _routesKey[_current!]!.add(dependencyKey);
  } else {
    _routesKey[_current] = <String>[dependencyKey];
  }
}