nopath_url_history 0.1.2 copy "nopath_url_history: ^0.1.2" to clipboard
nopath_url_history: ^0.1.2 copied to clipboard

Platformweb

A Flutter Web navigation library that uses browser history API without changing URLs. Supports complex JSON parameters and browser back/forward navigation.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:nopath_url_history/nopath_url_history.dart';
import 'screens/a_page.dart';
import 'screens/b_page.dart';
import 'screens/c_page.dart';

// 1️⃣ Define your pages as an enum (right in main.dart!)
enum AppPage { a, b, c }

void main() {
  // ⭐ REQUIRED: Initialize JsonNavigator BEFORE runApp()
  JsonNavigator.initialize<AppPage>(
    pages: [
      PageConfig(AppPage.a, () => const APage()),
      PageConfig(AppPage.b, () => const BPage()),
      PageConfig(AppPage.c, () => const CPage()),
    ],
    initialPage: AppPage.a,
  );

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'URL History Navigation Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
      ),
      home:
          const JsonNavigatorWrapper(), // ⭐ REQUIRED: Use JsonNavigatorWrapper
    );
  }
}
2
likes
160
points
11
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter Web navigation library that uses browser history API without changing URLs. Supports complex JSON parameters and browser back/forward navigation.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, web

More

Packages that depend on nopath_url_history