import 'package:get/get.dart';
import 'package:news_getx/middlewares/router_auth.dart';
import 'package:news_getx/middlewares/router_welcome.dart';
import 'package:news_getx/modules/application/application_binding.dart';
import 'package:news_getx/modules/application/application_page.dart';
import 'package:news_getx/modules/category/category_binding.dart';
import 'package:news_getx/modules/category/category_page.dart';
import 'package:news_getx/modules/main/main_binding.dart';
import 'package:news_getx/modules/not_found/not_found_binding.dart';
import 'package:news_getx/modules/not_found/not_found_page.dart';
import 'package:news_getx/modules/sign_in/sign_in_binding.dart';
import 'package:news_getx/modules/sign_in/sign_in_page.dart';
import 'package:news_getx/modules/sign_up/sign_up_binding.dart';
import 'package:news_getx/modules/sign_up/sign_up_page.dart';
import 'package:news_getx/modules/welcome/welcome_binding.dart';
import 'package:news_getx/modules/welcome/welcome_page.dart';

part './app_routes.dart';

abstract class AppPages {
  static final pages = [
    // 免登陆
    GetPage(
      name: AppRoutes.Initial,
      page: () => WelcomePage(),
      binding: WelcomeBinding(),
      middlewares: [RouteWelcomeMiddleware()],
    ),
    GetPage(
      name: AppRoutes.Signin,
      page: () => SignInPage(),
      binding: SignInBinding(),
    ),
    GetPage(
      name: AppRoutes.Signup,
      page: () => SignUpPage(),
      binding: SignUpBinding(),
    ),
    GetPage(
      name: AppRoutes.NotFound,
      page: () => NotFoundPage(),
      binding: NotFoundBinding(),
    ),
    // 应用页
    GetPage(
      name: AppRoutes.Application,
      page: () => ApplicationPage(),
      binding: ApplicationBinding(),
      bindings: [MainBinding(), CategoryBinding()],
      middlewares: [
        RouteAuthMiddleware(),
      ],
    ),
  ];
}
