easy_navigation_flutter 0.0.4
easy_navigation_flutter: ^0.0.4 copied to clipboard
Flutter package for simplified page-to-page navigation.
example/main.dart
import 'package:easy_navigation_flutter/easy_navigation_flutter.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Flutter Navigator Example')),
body: Center(
child: ElevatedButton(
onPressed: () {
NavigatorHelper.to(context, const SecondPage()); // Navigate to SecondPage
},
child: const Text('Go to Second Page'),
),
),
),
);
}
}
class SecondPage extends StatelessWidget {
const SecondPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Second Page')),
body: Center(
child: ElevatedButton(
onPressed: () {
NavigatorHelper.to(context, const MyApp());
},
child: const Text('Go Back'),
),
),
);
}
}