RouteBase class

Adds a new single sub-path or endpoint segment to parent path

child to create sub-segments.

root to create endpoint for this segment.

unknown to customize unknown route for this segment

and sub-segments.

You can use as split route for sub-segments and this segment. For this use case child and root both must be defined.

  • segment of 'new_segment' is adding segment to parent like:
parent/path/new_segment/(...?)

Look PathSegment for argument segments.

  • root Running when this segment is called as an endpoint. root is null responded with unknown Next CallingComponent from root calling in example request:
parent/path/new_segment
  • child Running when this segments known sub-route is called as an endpoint.

parent/path/new_segment/known_route

  • unknown Running when this segments unknown sub-route is called as an endpoint. unknown is null responded with first parent unknown

parent/path/new_segment/any_unknown_route

-

Example Dart Code:

  /// defined from parent path "host/user"
  return PathRouter(
    segment: PathSegment("info"),
    root: MyUserInfoEndpoint()
  );

Added route of host/user/info . if request path is host/user/info calling next CallingComponent from root.

Detailed

RouteBase component helps to

  • Adding new single child segments to calling tree
  • Adding unknown endpoint to this segment
  • Adding root endpoint to this segment a
Inheritance
Mixed-in types

Constructors

RouteBase(String segment, {Component? child, Component? root, bool? handleUnknownAsRoot})
For argument segments use segment with "{segment}" . child, root and unknown is parent unknown in default for custom PathSegment to use constructor PathRouter.withPathSegment
factory
RouteBase.withPathSegment({required PathSegment segment, Component? child, Component? root, bool? handleUnknownAsRoot})
For argument segments use segment with "{segment}" . child, root and unknown

Properties

child → Component?
Using known child
no setteroverride
handleUnknownAsRoot → bool
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
finalinherited
root → Component?
Using this segment calling as a endpoint
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
segment → PathSegment
This Calling Component segment
no setteroverride

Methods

createBinding() → RouteBinding
override
createCalling(BuildContext context) → Calling
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
toStringDeep() → String
inherited
toStringSort() → String
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited