UINavigableComponent constructor

UINavigableComponent(
  1. Object? parent,
  2. Iterable<String> routes, {
  3. dynamic componentClass,
  4. dynamic componentStyle,
  5. dynamic classes,
  6. dynamic classes2,
  7. dynamic style,
  8. dynamic style2,
  9. dynamic id,
  10. bool inline = true,
  11. bool renderOnConstruction = false,
})

Implementation

UINavigableComponent(super.parent, Iterable<String> routes,
    {dynamic componentClass,
    dynamic componentStyle,
    super.classes,
    super.classes2,
    super.style,
    super.style2,
    super.id,
    super.inline,
    bool renderOnConstruction = false})
    : _routes = routes.toList(),
      super(componentClass: [
        UINavigableComponent.componentClass,
        componentClass
      ], renderOnConstruction: renderOnConstruction) {
  _normalizeRoutes();

  if (findRoutes!) updateRoutes();
  //if (this.routes.isEmpty) throw ArgumentError('Empty routes');

  var currentRoute = UINavigator.currentRoute;
  var currentRouteParameters = UINavigator.currentRouteParameters;

  if (currentRoute != null && currentRoute.isNotEmpty) {
    if (_routes.contains(currentRoute)) {
      _currentRoute = currentRoute;
      _currentRouteParameters = currentRouteParameters;
    }
  }

  _currentRoute ??= _routes.isNotEmpty ? _routes[0] : '';

  UINavigator.get().registerNavigable(this);

  if (renderOnConstruction) {
    callRender();
  }
}