Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahyangnb/get_route_generator
https://github.com/ahyangnb/get_route_generator
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ahyangnb/get_route_generator
- Owner: ahyangnb
- License: mit
- Created: 2024-04-30T03:23:19.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-21T10:54:41.000Z (7 months ago)
- Last Synced: 2024-10-16T14:13:08.307Z (3 months ago)
- Language: Dart
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Get Route Generator.
We can generate code like:
```dart
import 'package:get/get.dart';
import 'package:xxxx/pages/welcome_page/welcome_view.dart';
import 'package:xxxx/pages/welcome_page/welcome_binding.dart';
import 'package:xxxx/pages/login/login_view.dart';
import 'package:xxxx/pages/login/login_binding.dart';class AppRouterName {
static const String welcomePage = '/welcomePage';
static const String loginPage = '/loginPage';
}class AppRouter {
static List pages = [
GetPage(name: AppRouterName.welcomePage,
page: () => const WelcomePage(),
binding: WelcomeBinding()),
GetPage(name: AppRouterName.loginPage, page: () => const LoginPage(), binding: LoginBinding()),
];
}
```Only `@GetGeneratePage()` like:
```dart
@GetGeneratePage()
class WelcomePage extends StatelessWidget {
const WelcomePage({super.key});@override
Widget build(BuildContext context) {
final logic = Get.find();
final state = Get
.find()
.state;return Container();
}
}
```When project file structure like:
```
[welcome_page]
[welcome_binding.dart]
[welcome_logic.dart]
[welcome_state.dart]
[welcome_view.dart]
```# Create new page with GetX in android studio.
step1
![step1](./images/step1.png)
step2
![step2](./images/step2.png)