Skip to content

The system's navigator page management and the system's routing are not unified, while hi_route unifies the two, and manages the application interface entirely by way of routing

License

Notifications You must be signed in to change notification settings

wuchuhengtools/router_dart

Repository files navigation

what is wuchuheng_router.

The system's navigator page management and the system's routing are not unified, while easy_router unifies the two, and manages the application interface entirely by way of routing.

Features

install

 $ flutter pub add wuchuheng_router

Manage the page by routing.

Usage

import 'package:flutter/material.dart';
import 'package:wuchuheng_router/route/route_abstract.dart';
import 'package:wuchuheng_router/wuchuheng_router.dart';

class HomePage extends Page {
  @override
  Route createRoute(BuildContext context) => MaterialPageRoute(
        settings: this,
        builder: (BuildContext context) => const _HomePage(),
      );
}

class _HomePage extends StatelessWidget {
  const _HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => const Text('home page');
}

final WuchuhengRouter route = WuchuhengRouter(
  {
    '/': () => HomePage(),
  },
  before: (RoutePageInfo pageInfo) async => pageInfo,
);

class App extends StatelessWidget {
  const App({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return route.build(context, title: 'snotes');
  }
}

void main() async {
  runApp(const App());
}

Additional information

About

The system's navigator page management and the system's routing are not unified, while hi_route unifies the two, and manages the application interface entirely by way of routing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages