Keyboard Shortcuts

j / kScroll down / up
ggScroll to top
GScroll to bottom
K / /Open search
?Show this help
EscClose search / help
n / NNext / previous section
hGo to landing
dGo to docs
:Command mode — type section name

Press ? or Esc to close

Systems

Media Viewer

A full-screen viewer for images and video, reached via AppRoutes.mediaViewer. It is intentionally exempt from the auth guard so share links work cold.

Open it

lib/config/ui/media_viewer/media_viewer_route.dart
context.push(
  AppRoutes.mediaViewer.route,
  pathParameters: {'url': Uri.encodeComponent(mediaUrl)},
);

Image vs video

The route inspects the URL extension and renders ImageMediaView or VideoMediaView. Video uses chewie over video_player for controls.

lib/config/ui/media_viewer/media_viewer.dart
Widget _body(String url) {
  if (url.endsWith('.mp4') || url.endsWith('.mov')) {
    return VideoMediaView(url: url);
  }
  return ImageMediaView(url: url);
}

Auth exemption

Because the viewer is auth-exempt, the global redirect lists it in noAuthRoutes. Any other authenticated-only route would bounce a cold deep link to the login screen.

lib/app/app_router.dart
final noAuthRoutes = [
  AppRoutes.splash.route,
  AppRoutes.webView.route,
  AppRoutes.mediaViewer.route,
];
sam's arch — A Pragmatic Flutter Architecture