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

A quick and easy Flutter navigation utility with fade transitions.

flutter_quick_nav #

flutter_quick_nav is a lightweight Flutter navigation utility that simplifies screen transitions using clean and intuitive methods. It provides a smooth fade animation and streamlines navigation by wrapping common patterns like push, replace, and pushAndRemoveUntil.


โœจ Features #

  • ๐Ÿš€ Navigate to a new screen with a fade transition.
  • ๐Ÿ” Replace the current screen.
  • ๐Ÿงน Push and remove all previous routes until a specified named route.
  • ๐Ÿงผ Clean API using just BuildContext and Widget.

๐Ÿš€ Screenshots #

Note: This package affects screen transitions only, not UI layout.


๐Ÿ”ง Installation #

1. Depend on it #

Add this to your packageโ€™s pubspec.yaml file:

dependencies:
  flutter_quick_nav: ^1.0.0

2. Install it #

Run either of the following commands in your terminal:

  flutter pub get

3. Import it #

  import 'package:flutter_quick_nav/flutter_quick_nav.dart';

๐Ÿ”น Quick Usage #

Use these one-liners to navigate your app with elegant fade transitions:

โž• Push a new screen #

  FlutterQuickNav.push(context, const SecondPage());

๐Ÿ” Replace the current screen #

  FlutterQuickNav.replace(context, const FinalPage());

๐Ÿงน Push and remove until a named #

  FlutterQuickNav.pushAndRemoveUntil(context,const HomePage());

when using named routes #

  FlutterQuickNav.pushAndRemoveUntil(context,const HomePage(),untilRoute: '/home',); // when using named routes

๐Ÿง‘โ€๐Ÿ’ป Usage Example #

    import 'package:flutter/material.dart';
    import 'package:flutter_quick_nav/flutter_quick_nav.dart';

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

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

        @override
        Widget build(BuildContext context) {
        return MaterialApp(
      title: 'flutter_quick_nav Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
        useMaterial3: true,
        textTheme: const TextTheme(
          bodyMedium: TextStyle(fontSize: 16),
          headlineSmall: TextStyle(fontWeight: FontWeight.bold),
        ),
        ),
      home: const HomePage(),
      // routes: {'/home': (context) => const HomePage()}, // Optional if using named routes
        );
    }
    }

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

        @override
        Widget build(BuildContext context) {
        return Scaffold(
      appBar: AppBar(
        title: const Text('๐Ÿ  Home Page'),
        centerTitle: true,
        ),
      body: Center(
        child: ElevatedButton.icon(
          onPressed: () {
            FlutterQuickNav.push(context, const SecondPage());
        },
          icon: const Icon(Icons.arrow_forward_rounded),
          label: const Text('Go to Second Page'),
          style: _buttonStyle(),
        ),
        ),
        );
    }
    }

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

        @override
        Widget build(BuildContext context) {
        return Scaffold(
      appBar: AppBar(
        title: const Text('๐Ÿงญ Second Page'),
        centerTitle: true,
        ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton.icon(
            onPressed: () {
                            FlutterQuickNav.replace(context, const FinalPage());
            },
            icon: const Icon(Icons.auto_awesome),
            label: const Text('Replace with Final Page'),
            style: _buttonStyle(background: Colors.deepPurple),
            ),
            const SizedBox(height: 20),
            ElevatedButton.icon(
            onPressed: () {
                            FlutterQuickNav.pushAndRemoveUntil(
                            context,
                            const HomePage(),
              // untilRoute: '/home', // Optional named route
                            );
            },
            icon: const Icon(Icons.home_rounded),
            label: const Text('Reset to Home'),
            style: _buttonStyle(background: Colors.green),
            ),
          ],
        ),
        ),
        );
    }
    }

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

        @override
        Widget build(BuildContext context) {
        return Scaffold(
      appBar: AppBar(
        title: const Text('๐ŸŽฏ Final Page'),
        centerTitle: true,
        ),
      body: const Center(
        child: Text(
          '๐ŸŽ‰ You made it to the final page!',
          style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600),
          textAlign: TextAlign.center,
        ),
        ),
        );
    }
    }

        /// Reusable button style for consistent design
        ButtonStyle _buttonStyle({Color background = Colors.indigo}) {
        return ElevatedButton.styleFrom(
      padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(16),
        ),
      elevation: 4,
      backgroundColor: background,
      foregroundColor: Colors.white,
        );
    }


๐Ÿ“ฆ Null Safety #

This package is 100% null-safe and compatible with the latest Flutter versions.

๐Ÿ’ก Contribution #

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.

๐Ÿ“„ License #

This project is licensed under the MIT License โ€” see the LICENSE file for details.

๐Ÿ™Œ Support #

If you like this package, don't forget to give it a โญ on GitHub and share it with others!

22
likes
0
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

A quick and easy Flutter navigation utility with fade transitions.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_quick_nav