navigator_scope 1.0.1 copy "navigator_scope: ^1.0.1" to clipboard
navigator_scope: ^1.0.1 copied to clipboard

A simple package for nested navigation. No need to learn a bunch of new APIs. It will work exactly as you imagine.

example/lib/main.dart

import 'package:example/navigation_bar_example.dart';
import 'package:example/navigation_drawer_example.dart';
import 'package:flutter/material.dart';

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

const examples = {
  'Navigation Bar': NavigationBarExample(),
  'Navigation Drawer': NavigationDrawerExample(),
};

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Nested Navigator Example',
      theme: ThemeData(
        useMaterial3: true,
        colorSchemeSeed: Colors.green,
      ),
      home: Scaffold(
        body: Builder(
          builder: (context) {
            return ListView(
              children: examples.entries.map(
                (example) {
                  return ListTile(
                    title: Text('Example with ${example.key}'),
                    onTap: () {
                      Navigator.of(context).push(
                        MaterialPageRoute(
                          builder: (_) => example.value,
                        ),
                      );
                    },
                  );
                },
              ).toList(),
            );
          },
        ),
      ),
    );
  }
}
16
likes
160
pub points
65%
popularity

Publisher

verified publishernorelease.dev

A simple package for nested navigation. No need to learn a bunch of new APIs. It will work exactly as you imagine.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on navigator_scope