import 'package:get/get.dart';
import 'package:vitalapp/pages/contract/package_list/widgets/capture_portrait.dart';
import 'package:vitalapp/pages/contract/package_list/widgets/family_doctor_service_package.dart';
import 'package:vitalapp/pages/contract/package_list/widgets/personal_information.dart';
import 'package:vitalapp/pages/contract/package_list/widgets/remark.dart';
import 'package:vitalapp/pages/contract/package_list/widgets/service_information.dart';
import 'package:vitalapp/pages/data_sync/index/controller.dart';
import 'package:vitalapp/pages/data_sync/index/view.dart';
import 'package:vitalapp/pages/from_page/controller.dart';
import 'package:vitalapp/pages/check/follow_up_record/controller.dart';
import 'package:vitalapp/pages/check/follow_up_record/view.dart';
import 'package:vitalapp/pages/home/personal_center/controller.dart';
import 'package:vitalapp/pages/home/personal_center/view.dart';
import 'package:vitalapp/pages/medical/controller.dart';
import 'package:vitalapp/pages/medical/records/controller.dart';
import 'package:vitalapp/pages/medical/records/view.dart';
import 'package:vitalapp/pages/medical/view.dart';
import 'package:vitalapp/pages/redirect/redirect.dart';
import 'package:vitalapp/pages/settings/center/controller.dart';
import 'package:vitalapp/pages/settings/center/view.dart';
import 'package:vitalapp/pages/settings/devices/controller.dart';
import 'package:vitalapp/pages/settings/server/controller.dart';
import 'package:vitalapp/routes/route_setting.dart';
import 'package:vitalapp/pages/check/examination/controller.dart';
import 'package:vitalapp/pages/check/examination/view.dart';
import 'package:vitalapp/pages/check/follow_up/controller.dart';
import 'package:vitalapp/pages/check/follow_up/view.dart';
import 'package:vitalapp/pages/check/health_check_record/controller.dart';
import 'package:vitalapp/pages/check/health_check_record/view.dart';
import 'package:vitalapp/pages/contract/contract_record_html/controller.dart';
import 'package:vitalapp/pages/contract/contract_records/controller.dart';
import 'package:vitalapp/pages/contract/contract_records/view.dart';
import 'package:vitalapp/pages/contract/contract_template/controller.dart';
import 'package:vitalapp/pages/contract/contract_template/view.dart';
import 'package:vitalapp/pages/contract/package_info/controller.dart';
import 'package:vitalapp/pages/contract/package_info/view.dart';
import 'package:vitalapp/pages/contract/package_list/controller.dart';
import 'package:vitalapp/pages/contract/package_list/view.dart';
import 'package:vitalapp/pages/contract/signature_board/controller.dart';
import 'package:vitalapp/pages/contract/signature_board/view.dart';
import 'package:vitalapp/pages/controllers/crowd_labels.dart';
import 'package:vitalapp/pages/dashboard/controller.dart';
import 'package:vitalapp/pages/dashboard/view.dart';
import 'package:vitalapp/pages/home/controller.dart';
import 'package:vitalapp/pages/home/view.dart';
import 'package:vitalapp/pages/login/controller.dart';
import 'package:vitalapp/pages/login/view.dart';
import 'package:vitalapp/pages/login_gateway/controller.dart';
import 'package:vitalapp/pages/login_gateway/view.dart';
import 'package:vitalapp/pages/patient/create/controller.dart';
import 'package:vitalapp/pages/patient/create/view.dart';
import 'package:vitalapp/pages/patient/detail/controller.dart';
import 'package:vitalapp/pages/patient/detail/view.dart';
import 'package:vitalapp/pages/patient/info/controller.dart';
import 'package:vitalapp/pages/patient/info/view.dart';
import 'package:vitalapp/pages/patient/list/controller.dart';
import 'package:vitalapp/pages/patient/list/view.dart';
import 'package:vitalapp/pages/splash/controller.dart';
import 'package:vitalapp/pages/splash/view.dart';

import '../pages/contract/contract_record_html/view.dart';

class Routes {
  static Map<String, dynamic> parameters = {};

  static final routes = [
    VRouteSetting(
      '/redirect',
      () => const RedirectPage(),
    ),
    VRouteSetting(
      "/splash",
      () => const SplashPage(),
      binding: BindingsBuilder(
        () {
          Get.put(SplashController());
        },
      ),
    ),
    VRouteSetting(
      "/login",
      () => const LoginPage(),
      binding: BindingsBuilder(
        () {
          Get.put(LoginController());
        },
      ),
    ),
    VRouteSetting(
      "/login/gateway",
      () => const LoginGatewayPage(),
      binding: BindingsBuilder(
        () {
          Get.put(LoginGatewayController());
        },
      ),
    ),
    VRouteSetting(
      "/",
      () => const HomePage(),
      binding: BindingsBuilder(
        () {
          Get.put(HomeController());
        },
      ),
    ),
    VRouteSetting(
      "/dashboard",
      // participatesInRootNavigator: false,
      // preventDuplicates: true,
      () => const DashboardPage(),
      binding: BindingsBuilder(
        () {
          Get.put(DashboardController());
        },
      ),
    ),
    // VRouteSetting(
    //   "/settings",
    //   () => const SettingsPage(),
    //   binding: BindingsBuilder(
    //     () {
    //       Get.put(SettingsController());
    //     },
    //   ),
    // ),
    VRouteSetting(
      "/settings",
      () => const SettingCenterPage(),
      binding: BindingsBuilder(
        () {
          Get.lazyPut(() => DevicesSettingController());
          Get.lazyPut(() => ServerSettingController());
          Get.put(SettingCenterController());
        },
      ),
    ),
    VRouteSetting(
      "/data_sync",
      () => const DataSyncPage(),
      binding: BindingsBuilder(
        () {
          Get.put(DataSyncController());
        },
      ),
    ),
    VRouteSetting(
      "/patient/create",
      // participatesInRootNavigator: false,
      // preventDuplicates: true,
      () => const CreatePatientPage(),
      binding: BindingsBuilder(
        () {
          Get.lazyPut(() => CrowdLabelsController());
          Get.lazyPut(() => CreatePatientController());
        },
      ),
    ),
    VRouteSetting(
      "/patient/list",
      // participatesInRootNavigator: false,
      // preventDuplicates: true,
      () => const PatientListPage(),
      binding: BindingsBuilder(
        () {
          Get.lazyPut(() => CrowdLabelsController());
          Get.lazyPut(() => CreatePatientController());
          Get.lazyPut(() => PatientListController());
          Get.lazyPut(() => PatientDetailController());
        },
      ),
    ),
    VRouteSetting(
      "/patient/detail",
      // preventDuplicates: true,
      () => const PatientDetailPage(),
      binding: BindingsBuilder(
        () {
          Get.put(CrowdLabelsController());
          Get.put(PatientDetailController());
        },
      ),
    ),
    VRouteSetting(
      "/patient/info",
      () => const PatientInfoPage(),
      binding: BindingsBuilder(
        () {
          Get.put(PatientInfoController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_list",
      () => const ServicePackageContractPage(),
      binding: BindingsBuilder(
        () {
          Get.put(CrowdLabelsController());
          Get.put(ServicePackageContractController());
          Get.put(FromPageController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_info",
      () => const PackageInfoPage(),
      binding: BindingsBuilder(
        () {
          Get.put(PackageInfoController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/signature",
      () => SignatureBoardPage(),
      binding: BindingsBuilder(
        () {
          Get.put(SignatureBoardController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/contract_template",
      () => ContractTemplatePage(),
      binding: BindingsBuilder(
        () {
          Get.put(ContractTemplateController());
        },
      ),
    ),
    VRouteSetting(
      "/check/form",
      () => const ExaminationPage(),
      binding: BindingsBuilder(
        () {
          Get.put(ExaminationController());
        },
      ),
    ),
    VRouteSetting(
      "/check/follow_up",
      () => const FollowUpPage(),
      binding: BindingsBuilder(
        () {
          Get.put(FollowUpController());
        },
      ),
    ),
    VRouteSetting(
      "/check/healthCheckRecord",
      () => const HealthCheckRecordPage(),
      binding: BindingsBuilder(
        () {
          Get.put(HealthCheckRecordController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/contract_records",
      () => const ContractRecordsPage(),
      binding: BindingsBuilder(
        () {
          Get.put(ContractRecordsController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/contract_record_html",
      () => const ContractRecordsHtmlPage(),
      binding: BindingsBuilder(
        () {
          Get.put(ContractRecordsHtmlController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_list/capture_portrait",
      () => const CapturePortraitPage(),
      binding: BindingsBuilder(
        () {
          // Get.put(CrowdLabelsController());
          // Get.put(ServicePackageContractController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_list/family_doctor_service_package",
      () => const FamilyDoctorServicePackagePage(),
      binding: BindingsBuilder(
        () {
          // Get.put(CrowdLabelsController());
          // Get.put(ServicePackageContractController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_list/personal_information",
      () => const PersonalInformationPage(),
      binding: BindingsBuilder(
        () {
          // Get.put(CrowdLabelsController());
          // Get.put(ServicePackageContractController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_list/remark",
      () => const RemarkPage(),
      binding: BindingsBuilder(
        () {
          // Get.put(CrowdLabelsController());
          // Get.put(ServicePackageContractController());
        },
      ),
    ),
    VRouteSetting(
      "/contract/package_list/service_information",
      () => const ServiceInformationPage(),
      binding: BindingsBuilder(() {
        // Get.put(CrowdLabelsController());
        // Get.put(ServicePackageContractController());
      }),
    ),
    VRouteSetting(
      '/check/follow_up_record',
      () => const FollowUpRecordPage(),
      binding: BindingsBuilder(
        () {
          Get.put(FollowUpRecordController());
        },
      ),
    ),
    VRouteSetting(
      '/medical',
      () => const MedicalPage(),
      binding: BindingsBuilder(
        () {
          if (!Get.isRegistered<MedicalController>()) {
            Get.lazyPut(() => MedicalController());
          }
          Get.put(PatientDetailController());
        },
      ),
    ),
    VRouteSetting(
      '/home/personal_center',
      () => const PersonalCenterPage(),
      binding: BindingsBuilder(
        () {
          Get.put(PersonalCenterController());
        },
      ),
    ),
    VRouteSetting(
      '/medical/records',
      () => const MedicalRecordsPage(),
      binding: BindingsBuilder(
        () {
          Get.put(MedicalRecordsController());
        },
      ),
    ),
  ];
}
