frostrouter 0.9.1 copy "frostrouter: ^0.9.1" to clipboard
frostrouter: ^0.9.1 copied to clipboard

FrostRouter is a library that helps you move from one page to another in Flutter projects.

FrostRouter Banner

Developers #

  • Sinan UYĞUN - Developer

Contact #

GitHub stars GitLab stars Medium ORCID YouTube

Project Details #

Contributors Version License: BSD-3-Clause Pub.dev Dokümantasyonu Görüntüle GitHub Wiki

Introduction #

What is frostrouter?

FrostRouter is a library that helps you move from one page to another in Flutter projects. It is usually used to manage the transitions between pages. It provides an easier-to-use version of Flutter's default navigation system, helping to create a cleaner and more maintainable code structure. FrostRouter makes in-app routing more flexible and organized.

With customizable structures and less boilerplate code, FrostRouter allows users and developers to manage their applications more efficiently. It also helps make page transitions more controllable and testable.

Why frostrouter?

Flutter's basic navigation system works well for small and simple projects, but it can be hard to use in large projects. Using a library like FrostRouter has these benefits:

  • Clean and organized code:

    FrostRouter manages page transitions and redirects from a centralized location. This makes your code more organized and easier to maintain.

  • Flexibility:

    You can customize FrostRouter according to the needs of your application. You can make it easier to move data between pages and add custom animations.

  • Testability:

    Managing navigation in a centralized point makes it easy to write tests. This makes it easier to create and test your application.

  • Complex Routing States:

    When your application needs to redirect users to different pages in different situations, FrostRouter is the ideal tool to manage such complex routing logics.

  • Application Management:

    By centralizing your app's routing structure, you can better manage how users navigate through your app and in what order.

Open Source: You can access and support the source code. You can use the codes in your projects according to the rules of the license and support the project.

Installation #

Add the following dependencies to your pubspec.yaml file:

dependencies:
  frostrouter: [latest-version]

Include the package using the bash command.


$ flutter pub add frostrouter

Usage #

After you install it, here's how to use Flutter. The package includes three different versions.

FrostRouter #

The version with hex codes verifies the color.

import 'package:frostrouter/frostrouter.dart';

final frostrouter = frostrouter();

final frostrouter = FrostRouter(
  [
    FrostRoute(
      name: 'page0', 
      path: '/', 
      builder: (context) => PageZero(),
    ),
    FrostRoute(
      name: 'page1', 
      path: '/pageone', 
      builder: (context) => PageOne(),
    ),
    FrostRoute(
      name: 'Page2', 
      path: '/pagetwo', 
      builder: (context) => PageTwo(),
    )
  ]

  void main(){
    runApp(
      MaterialApp.router(
        routerConfig: frostrouter.config,
      )
    );
  }
);

Page Redirection with Path #

frostrouter.frostRoutePath('/pageone');

Page Redirection with Name #

frostrouter.frostRouteName('page0');

Page Redirection with Pop #

frostrouter.frostRoutePop();

Page Redirection with Return #

frostrouter.frostRouteReturn();

Extension #

Build Context makes it easy for you to get things done.

import 'package:frostrouter/src/extension/extension.dart';

context.frostPath('/pagetwo));

context.frostName('pagetwo');

context.frostPop();

context.frostReturn();

0
likes
0
points
40
downloads

Publisher

verified publisherfrostaloncode.blogspot.com

Weekly Downloads

FrostRouter is a library that helps you move from one page to another in Flutter projects.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on frostrouter