Returns a new instance of UrlState With the flattened version of segments e.g if segments = [Match1[Match2Match3]] the result is Match1,Match2,Match3
Match3
Match1,Match2,Match3
UrlState get flatten => UrlState.fromSegments(segments.last.flattened, state: pathState);