alghwalbi_easy_router

Creator: coderz1093

Last updated:

0 purchases

alghwalbi_easy_router Image
alghwalbi_easy_router Images
Add to Cart

Description:

alghwalbi easy router

Demo Videos #


alghwalbi_easy_router #
Experience effortless navigation in your Flutter apps across platforms with alghwalbi_easy_router. Seamlessly adapts to each environment, mirroring web routes in the browser's search bar on the web, while integrating with default mobile behavior. Say goodbye to platform inconsistencies and hello to a consistent user experience. Simplify routing with alghwalbi_easy_router today!
Installation #
To install alghwalbi_easy_router from pub.dev, click here.
Usage #


Define Routes:
void main() {
WidgetsFlutterBinding.ensureInitialized();
EasyRouter.removeHashFromUrl();
EasyRouter.allAppRoutes = {
'/': (context, state, data) {
return EasyRouter.routeInfo(
child: const MainPage(),
title: 'Main Page',
key: const ValueKey('Easy Route main'));
},
'/login': (context, state, data) => EasyRouter.routeInfo(
child: const LoginPage(),
title: 'Login Page',
key: const ValueKey('Easy Route Login'),
),
'/signup': (context, state, data) => EasyRouter.routeInfo(
child: const SignUpPage(),
title: 'Signup Page',
key: const ValueKey('Easy Route Signup'),
),
// Add more routes as needed
};
runApp(const MyApp());
}
copied to clipboard


Use Material App Router:
MaterialApp.router(
routerDelegate: EasyRouter.easyRouterDelegate,
routeInformationParser: EasyRouter.getEasyRouterParser,
backButtonDispatcher: EasyRouter.getEasyRouterBackButtonDispatcher,
debugShowCheckedModeBanner: false,
...
)
copied to clipboard


Remove Hash from URL:
void main() {
WidgetsFlutterBinding.ensureInitialized();
EasyRouter.removeHashFromUrl();
...
}
copied to clipboard


Navigate between Pages:
EasyRouter.go(
context: context,
route: '/login', // Provide your destination route
replaceRoute: true, // Optional
data: {}, // Optional: Provide JSON data to send from page to another
invalidRouterDialog: // Optional: Provide your custom dynamic Function(BuildContext)? or dialog when the route is not found
)
copied to clipboard


Back Navigation:
EasyRouter.back(context)
copied to clipboard
Optionally, you can specify the route to go to if back navigation fails:
EasyRouter.back(context, popFailedRoute: '/')
copied to clipboard


For more detailed information and usage examples, refer to the official pub.dev page.

Feel free to explore the capabilities of alghwalbi_easy_router and simplify navigation within your Flutter apps! If you encounter any issues or have questions, don't hesitate to reach out. Happy coding!

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.