DynamicRouteSource<T> class

Esquema GENÉRICO para rotas dinâmicas (ex.: /blog/:slug, /produtos/:id) gerarem sitemap/llms automaticamente.

O desenvolvedor fornece:

  • provider: busca os dados (posts, produtos...) — pode ser DB/API.
  • build: transforma cada item T no RouteMeta correspondente.

O framework expande tudo na resolução, sem o dev tocar em XML/markdown.

DynamicRouteSource<Post>(
  provider: () => postsRepository.all(),
  build: (post) => RouteMeta(
    path: '/blog/${post.slug}',
    title: post.title,
    description: post.excerpt,
    lastmod: post.updatedAt,
    kind: PageKind.blogPost,
  ),
);
Implemented types

Constructors

DynamicRouteSource({required Future<List<T>> provider(), required RouteMeta build(T item)})
const

Properties

build RouteMeta Function(T item)
Mapeia um item em sua rota com metadados.
final
hashCode int
The hash code for this object.
no setterinherited
provider Future<List<T>> Function()
Fornece os itens de dados (assíncrono — DB, API, arquivos).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve() Future<List<RouteMeta>>
override
toString() String
A string representation of this object.
inherited

Operators

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