route_map 0.0.6 route_map: ^0.0.6 copied to clipboard
Route Map is a convenient code generator for Navigator 2.0. Inspired by injectable.
import 'package:example/route_map.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(useMaterial3: true),
onGenerateRoute: onGenerateRoute,
initialRoute: "/",
onUnknownRoute: (settings) {
return MaterialPageRoute(
builder: (_) => Scaffold(
appBar: AppBar(title: const Text("unknown")),
));
},
);
}
}