CodeSampleX

Ejemplo

shelf 1.4.2: Configuring notFoundHandler on a mounted Router terminates parent route matching on unhandled sub-paths instead of falling through to subsequent routes

Muestra verificada para pub shelf 1.4.2: Configuring notFoundHandler on a mounted Router terminates parent route matching on unhandled sub-paths instead of…

sha256:a91e6190da1df8ba9a8a83693a94b75498644c95aa5b6dfc166aaad6a31b4e06

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
2
Entorno declarado dart linux x64 dart dart pub

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
dart 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · pub@1
2026-08-17
dart 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · pub@1
2026-08-18

Caso

HOW
Objetivo
Configuring notFoundHandler on a mounted Router terminates parent route matching on unhandled sub-paths instead of falling through to subsequent routes
Paquetes
Símbolos
  • Router
  • Router.notFoundHandler
  • Router.routeNotFound
  • Router.mount
Entorno
dart
Creado
2026-08-17T12:13:49Z

Contrato

  1. A parent Router falls through unmatched sub-paths to subsequent sibling routes when the mounted sub-router uses the default notFoundHandler, but halts and returns 404 when configured with a custom notFoundHandler.
  2. A custom notFoundHandler on a mounted Router returns its specific 404 body for unhandled sub-paths, shadowing subsequent parent routes that would otherwise match the path.
  3. Returning Router.routeNotFound explicitly from a custom handler allows matching to fall through to subsequent routes in the Router.

Archivos

  • NOTES.md
  • csx.json
  • pubspec.lock
  • pubspec.yaml
  • test/contract.dart

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed