import 'package:clean/module/analysis/analysis_controller.dart';
import 'package:clean/module/analysis/analysis_view.dart';
import 'package:clean/module/contact/all/all_controller.dart';
import 'package:clean/module/contact/all/all_view.dart';
import 'package:clean/module/contact/backup/controller.dart';
import 'package:clean/module/contact/backup/view.dart';
import 'package:clean/module/contact/contact_controller.dart';
import 'package:clean/module/contact/contact_view.dart';
import 'package:clean/module/calendar/calendar_controller.dart';
import 'package:clean/module/calendar/calendar_month_controller.dart';
import 'package:clean/module/calendar/preview/calendar_preview_controller.dart';
import 'package:clean/module/calendar/selected_preview/calendar_selected_preview_controller.dart';
import 'package:clean/module/contact/duplicate/controller.dart';
import 'package:clean/module/contact/duplicate/view.dart';
import 'package:clean/module/contact/incomplete/controller.dart';
import 'package:clean/module/contact/incomplete/view.dart';
import 'package:clean/module/home/home_controller.dart';
import 'package:clean/module/locations_photo/locations_photo_controller.dart';
import 'package:clean/module/locations_photo/locations_photo_view.dart';
import 'package:clean/module/locations_photo/locations_single_photo_controller.dart';
import 'package:clean/module/locations_photo/locations_single_photo_view.dart';
import 'package:clean/module/main/main_view.dart';
import 'package:clean/module/photo_preview/photo_preview_controller.dart';
import 'package:clean/module/photo_preview/photo_preview_view.dart';
import 'package:clean/module/photo_info/photo_info_controller.dart';
import 'package:clean/module/photo_preview/photo_selected_preview_controller.dart';
import 'package:clean/module/photo_preview/phtoto_selected_preview_view.dart';
import 'package:clean/module/privacy/privacy_view.dart';
import 'package:clean/module/people_photo/people_photo_controller.dart';
import 'package:clean/module/people_photo/people_photo_view.dart';
import 'package:clean/module/screenshots_blurry/screenshots_controller.dart';
import 'package:clean/module/screenshots_blurry/screenshots_view.dart';
import 'package:clean/module/setting/setting_controller.dart';
import 'package:clean/module/setting/setting_view.dart';
import 'package:clean/module/similar_photo/similar_photo_controller.dart';
import 'package:clean/module/similar_photo/similar_photo_view.dart';
import 'package:clean/module/splash/intro/intro_controller.dart';
import 'package:clean/module/splash/intro/intro_view.dart';
import 'package:clean/module/store/discount/discount_controller.dart';
import 'package:clean/module/store/discount/discount_view.dart';
import 'package:clean/module/store/store_controller.dart';
import 'package:clean/module/store/store_view.dart';
import 'package:clean/module/splash/splash_controller.dart';
import 'package:clean/module/splash/splash_view.dart';
import 'package:clean/module/wallpaper/wallpaper_controller.dart';
import 'package:clean/module/wallpaper/wallpaper_view.dart';

import 'package:get/get.dart';

import '../module/browser/browser_controller.dart';
import '../module/browser/browser_view.dart';
import '../module/calendar/calendar_month_view.dart';
import '../module/calendar/preview/calendar_preview_view.dart';
import '../module/calendar/selected_preview/calendar_selected_preview_view.dart';
import '../module/main/main_controller.dart';
import '../module/photo_info/photo_info_view.dart';
import '../module/privacy/privacy_controller.dart';

abstract class AppPage {
  static final pages = <GetPage>[
    ...generalPages,
  ];
}

abstract class RoutePath {
  static const browser = '/browser';
  static const mainTab = '/mainTab';
  static const privacy = '/privacy';
  static const peoplePhoto = '/peoplePhoto';
  static const similarPhoto = '/similarPhoto';
  static const locationsPhoto = '/locationsPhoto';
  static const screenshots = '/screenshots';
  static const photoInfo = '/photoInfo';
  static const store = '/store';
  static const discount = '/discount';
  static const photoPreview = '/photoPreview';
  static const locationsSinglePhoto = '/locationsSinglePhoto';
  static const setting = '/setting';
  static const analysis = '/analysis';
  static const photoSelectedPreview = '/photoSelectedPreview';
  static const splash = '/splash';
  static const wallpaper = '/wallpaper';
  static const intro = '/intro';
  static const contact = '/contact';
  static const contactAll = '/contact/all';
  static const contactBackup = '/contact/backup';
  static const contactDuplicate = '/contact/duplicate';
  static const contactIncomplete = '/contact/incomplete';
  static const calendarMonth = '/calendarMonth';
  static const calendarPreview =  '/calendarPreview';
  static const calendarSelectedPreview = '/calendarSelectedPreview';
}

class AppBinding extends Bindings {
  @override
  void dependencies() {
    lazyPut(() => BrowserController());
    lazyPut(() => MainController());
    lazyPut(() => HomeController());
    lazyPut(() => PrivacyController());
    lazyPut(() => PeoplePhotoController());
    lazyPut(() => SimilarPhotoController());
    lazyPut(() => LocationsPhotoController());
    lazyPut(() => ScreenShotsController());
    lazyPut(() => PhotoPreviewController());

    lazyPut(() => PhotoInfoController());
    lazyPut(() => StoreController());
    lazyPut(() => DiscountController());
    lazyPut(() => LocationsSinglePhotoController());
    lazyPut(() => SettingController());
    lazyPut(() => AnalysisController());
    lazyPut(() => PhotoSelectedPreviewController());
    lazyPut(() => SplashController());
    lazyPut(() => WallPaperController());
    lazyPut(() => IntroController());
    lazyPut(() => ContactController());
    lazyPut(() => AllController());
    lazyPut(() => ContactBackUpController());
    lazyPut(() => ContactDuplicateController());
    lazyPut(() => ContactInCompleteController());
    lazyPut(() => AllController());
    lazyPut(() => CalendarController());
    lazyPut(() => CalendarMonthController());
    lazyPut(() => CalendarPreviewController());
    lazyPut(() => CalendarSelectedPreviewController());
  }

  void lazyPut<S>(InstanceBuilderCallback<S> builder) {
    Get.lazyPut(builder, fenix: true);
  }
}

final generalPages = [
  GetPage(name: RoutePath.browser, page: () => const BrowserPage()),
  GetPage(name: RoutePath.mainTab, page: () => MainTabPage()),
  GetPage(name: RoutePath.privacy, page: () => PrivacyPage()),
  GetPage(name: RoutePath.peoplePhoto, page: () => PeoplePhotoPage()),
  GetPage(name: RoutePath.similarPhoto, page: () => SimilarPhotoPage()),
  GetPage(name: RoutePath.locationsPhoto, page: () => LocationsPhotoPage()),
  GetPage(name: RoutePath.screenshots, page: () => ScreenshotsPage()),
  GetPage(name: RoutePath.photoPreview, page: () => PhotoPreviewPage()),
  GetPage(name: RoutePath.photoInfo, page: () => PhotoInfoPage()),
  GetPage(name: RoutePath.store, page: () => StorePage()),
  GetPage(name: RoutePath.discount, page: () => DiscountPage()),
  GetPage(
      name: RoutePath.locationsSinglePhoto,
      page: () => LocationsSinglePhotoPage()),
  GetPage(
      name: RoutePath.photoSelectedPreview,
      page: () => PhotoSelectedPreviewPage()),
  GetPage(name: RoutePath.setting, page: () => SettingPage()),
  GetPage(name: RoutePath.analysis, page: () => AnalysisPage()),
  GetPage(name: RoutePath.splash, page: () => SplashPage()),
  GetPage(name: RoutePath.wallpaper, page: () => WallPaperPage()),
  GetPage(name: RoutePath.intro, page: () => IntroPage()),
  GetPage(name: RoutePath.contact, page: () => ContactPage()),
  GetPage(name: RoutePath.contactAll, page: () => AllPage()),
  GetPage(name: RoutePath.contactBackup, page: () => ContactBackUpPage()),
  GetPage(name: RoutePath.contactDuplicate, page: () => ContactDuplicatePage()),
  GetPage(name: RoutePath.contactIncomplete, page: () => ContactIncompletePage()),
  GetPage(name: RoutePath.calendarMonth, page: () => CalendarMonthPage()),
  GetPage(name: RoutePath.calendarPreview, page: () => CalendarPreviewPage()),
  GetPage(
      name: RoutePath.calendarSelectedPreview,
      page: () => CalendarSelectedPreviewPage()),
];
