webf-routing-setup

Configures hybrid routing in WebF with native Flutter screen transitions.

2.5k|163|Updated Jul 19, 2022
One-click install
npx skills add https://github.com/openwebf/webf --skill webf-routing-setup-openwebf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webf-routing-setup
Source: https://github.com/openwebf/webf/tree/main/skills/webf-routing-setup
Command: npx skills add https://github.com/openwebf/webf --skill webf-routing-setup-openwebf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

WebF apps traditionally rely on SPA routing, which can lead to awkward navigation and poor back-stack management. This skill provides hybrid routing with native screen transitions, enabling multi-screen navigation that mimics native mobile apps.

Core Features & Use Cases

  • Hybrid routing: Each route renders on a separate Flutter screen with native transitions.
  • Framework compatibility: Works with React, Vue, and Svelte in WebF using the official router libraries.
  • Data flow and deep linking: Pass route state between screens and read dynamic params.
  • Common patterns: Protected routes, login redirects, and back-stack control for complex flows.

Quick Start

Install the router libraries and define your routes with a title on each Route. Then navigate programmatically using WebFRouter.pushState, WebFRouter.replaceState, or WebFRouter.back to move between screens. Access route state with useLocation and params with useParams to drive UI.

Frequently Asked Questions about webf-routing-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable native Flutter screen transitions for WebF apps?

You can build multi-screen navigation in WebF by replacing SPA routing with hybrid routing, which renders each route on a separate Flutter screen. This requires installing the @openwebf/react-router package and defining routes with a title prop.

Does WebF hybrid routing work with React, Vue, and Svelte?

Yes, WebF hybrid routing is compatible with React, Vue, and Svelte frameworks. It uses official router libraries to render each route on a separate Flutter screen with native transitions instead of relying on SPA routing.

How do I pass state and read dynamic params in WebF navigation flows?

You can pass state between WebF screens programmatically and read dynamic params by using the useLocation and useParams hooks. Navigation APIs like pushState and replaceState allow you to pass state directly during screen transitions.

Can I implement protected routes and login redirects using WebF routing?

Yes, you can implement common patterns like protected routes, login redirects, and back-stack control in WebF. The hybrid routing system supports complex navigation flows by managing native Flutter screen transitions and back-stack behavior.

Why does my WebF app have poor back-stack management with SPA routing?

SPA routing in WebF can lead to awkward navigation and poor back-stack management because it renders views in a single screen. Replacing it with hybrid routing provides native screen transitions and proper back-stack control.