katana_router 1.3.1 copy "katana_router: ^1.3.1" to clipboard
katana_router: ^1.3.1 copied to clipboard

outdated

A package to provide routing functionality. katana_router_builder can be used to automatically generate code with build_runner.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:katana_router/katana_router.dart';
import 'test.dart';

void main() {
  runApp(const MyApp());
}

final appRoute = AppRouter(
  boot: Boot(),
  pages: [
    MainPage.query,
    UserPage.query,
    ContentPage.query,
  ],
);

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: appRoute,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      // home: const MainPage(),
    );
  }
}

class Boot extends BootPageQueryBuilder {
  const Boot({super.key});

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Center(
        child: CircularProgressIndicator(),
      ),
    );
  }

  @override
  FutureOr<void> onInit(BuildContext context) async {
    await Future.delayed(const Duration(seconds: 1));
  }

  @override
  RouteQuery get initialRouteQuery => RouteQuery.fade;
}
27
likes
0
pub points
44%
popularity

Publisher

verified publishermathru.net

A package to provide routing functionality. katana_router_builder can be used to automatically generate code with build_runner.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, katana, katana_router_annotation, url_strategy

More

Packages that depend on katana_router