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/similar_photo/similar_photo_controller.dart';
import 'package:clean/module/similar_photo/similar_photo_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_instance/src/bindings_interface.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 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 photoPreview = '/photoPreview';
  static const locationsSinglePhoto = '/locationsSinglePhoto';
  static const photoSelectedPreview = '/photoSelectedPreview';
}

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

    lazyPut(() => PhotoInfoController());
    lazyPut(() => LocationsSinglePhotoController());
    lazyPut(() => PhotoSelectedPreviewController());
  }

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

}

final generalPages = [
  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.locationsSinglePhoto, page: () => LocationsSinglePhotoPage()),
  GetPage(name: RoutePath.photoSelectedPreview, page: () => PhotoSelectedPreviewPage()),
];
