addRoute method Null safety

void addRoute(
  1. int pointer,
  2. PointerRoute route,
  3. [Matrix4? transform]

Adds a route to the routing table.

Whenever this object routes a PointerEvent corresponding to pointer, call route.

Routes added reentrantly within PointerRouter.route will take effect when routing the next event.


void addRoute(int pointer, PointerRoute route, [Matrix4? transform]) {
  final Map<PointerRoute, Matrix4?> routes = _routeMap.putIfAbsent(
    () => <PointerRoute, Matrix4?>{},
  routes[route] = transform;