nuvigator 1.0.0-dev.3 nuvigator: ^1.0.0-dev.3 copied to clipboard
A powerful and strongly typed routing abstraction over Flutter navigator, providing some new features and an easy way to define routers with code generation.
import 'package:flutter/material.dart';
import 'package:nuvigator/next.dart';
import 'samples/router.dart';
void main() => runApp(MyApp());
class TestObserver extends NavigatorObserver {
@override
void didPush(Route<dynamic> route, Route<dynamic> previousRoute) {
print('didPush $route');
}
@override
void didPop(Route<dynamic> route, Route<dynamic> previousRoute) {
print('didPop $route');
}
@override
void didRemove(Route<dynamic> route, Route<dynamic> previousRoute) {
print('didRemove $route');
}
@override
void didReplace({Route<dynamic> newRoute, Route<dynamic> oldRoute}) {
print('didReplace $oldRoute to $newRoute');
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Nuvigator Example',
theme: ThemeData(
primarySwatch: Colors.deepPurple,
),
builder: Nuvigator(
screenType: cupertinoDialogScreenType,
router: MainAppRouter(),
),
);
}
}