init static method
Implementation
static Future<void> init() async {
await CreateFolderFiles.createAndWriteFile(
fileName: 'app_pages.dart',
path: 'lib/app/routes',
content:
'''import 'package:mega_commons_dependencies/mega_commons_dependencies.dart';
import 'package:mega_features/mega_features.dart';
import '../modules/change_password/views/change_password_view.dart';
import '../modules/forgot_password/views/forgot_password_view.dart';
import '../modules/home/bindings/home_binding.dart';
import '../modules/home/views/home_view.dart';
import '../modules/login/views/login_view.dart';
import '../modules/notification/views/notification_view.dart';
part 'app_routes.dart';
class AppPages {
AppPages._();
static const initial = Routes.login;
static final routes = [
GetPage(
name: Routes.login,
page: () => const LoginView(),
binding: LoginBinding(
homeRoute: Routes.home,
),
),
GetPage(
name: Routes.home,
page: () => const HomeView(),
binding: HomeBinding(),
),
GetPage(
name: _Paths.forgotPassword,
page: () => const ForgotPasswordView(),
binding: ForgotPasswordBinding(),
),
GetPage(
name: _Paths.changePassword,
page: () => const ChangePasswordView(),
binding: ChangePasswordBinding(),
),
GetPage(
name: _Paths.notifications,
page: () => const NotificationView(),
binding: NotificationBinding(),
),
];
}
''',
);
await CreateFolderFiles.createAndWriteFile(
fileName: 'app_routes.dart',
path: 'lib/app/routes',
content: '''part of 'app_pages.dart';
abstract class Routes {
Routes._();
static const home = _Paths.home;
static const login = _Paths.login;
static const forgotPassword = _Paths.forgotPassword;
static const changePassword = _Paths.changePassword;
static const notifications = _Paths.notifications;
}
abstract class _Paths {
_Paths._();
static const home = '/home';
static const login = '/login';
static const forgotPassword = '/forgot-password';
static const changePassword = '/change-password';
static const notifications = '/notifications';
}
''',
);
}