import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
import 'package:telemednet/screens/authentication/launch_screen.dart';
import 'package:telemednet/screens/doctor_screens/doctor_profile_screen.dart';
import 'package:telemednet/controller/patient_controller.dart';
import 'package:telemednet/screens/doctor_screens/achivements.dart';
import 'package:telemednet/screens/doctor_screens/address_screen.dart';
import 'package:telemednet/route_names.dart';
import 'package:telemednet/screens/doctor_screens/digital_signature.dart';
import 'package:telemednet/screens/doctor_screens/experience_screen.dart';
import 'package:telemednet/screens/doctor_screens/profile_description_screen.dart';
import 'package:telemednet/screens/doctor_screens/specialities_selection.dart';
import 'package:telemednet/screens/patientScreens/patientDashboard/patient_dashboard_screen.dart';
import 'package:telemednet/screens/patientScreens/patientDashboard/patient_profile_screen.dart';
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_adress_screen.dart';
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_family_members_screen.dart';
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_registration_screen.dart';

import 'controllers/doctor_controller.dart';
import 'screens/patientScreens/patient_landing_screen.dart';
import 'screens/patientScreens/registrationScreens/family_members_edit_screen.dart';

final Map<String, Widget Function(BuildContext)> routes = {
  RouteNames.launch: (context) => const LaunchScreen(),
  RouteNames.signIn: (context) => SignInScreen(
        providers: [EmailAuthProvider(), PhoneAuthProvider()],
      ),
  RouteNames.signUp: (context) => const RegisterScreen(),
  // RouteNames.userProfile: (context) {
  //   var user = ModalRoute.of(context)!.settings.arguments as TelemedUser?;
  //   return UserProfileScreen(user: user);
  // },
  RouteNames.profileUpload: (context) => const ProfileUploadPage(),
  RouteNames.patientLandingScreen: (context) => const PatientLandingScreen(),
  RouteNames.patientDashboardScreen: (context) =>
      const PatientDashboardScreen(),
  RouteNames.patientRegistrationScreen: (context) =>
      const PatientRegistrationScreen(),
  // RouteNames.patientAdressScreen: (context) =>
  //     PatientAddressScreen(controller: PatientController()),
  // RouteNames.patientFamilyMembersScreen: (context) =>
  //     PatientFamilyMembersScreen(controller: PatientController()),
  // RouteNames.familyMembersEditScreen: (context) =>
  //     FamilyMembersEditScreen(controller: PatientController()),
  RouteNames.doctorAddressScreen: (context) => DoctorAddressScreen(
        controller: DoctorController(), // Provide the required controller
      ),
  RouteNames.profileDescriptionScreen: (context) =>
      ProfileDescriptionScreen(controller: DoctorController()),
  RouteNames.experienceScreen: (context) => ExperienceScreen(
        controller: DoctorController(),
      ),
  RouteNames.specialitiesScreeen: (context) => SpecialitiesScreen(
        controller: DoctorController(),
      ),
  RouteNames.digitalSignatureScreeen: (context) => DigitalSignatureScreen(
        controller: DoctorController(),
      ),
  RouteNames.achievementsScreen: (context) =>
      AchievementsScreen(controller: DoctorController()),
  // FamilyMembersEditScreen(controller: PatientController()),
  RouteNames.patientAdressScreen: (context) {
    final controller =
        ModalRoute.of(context)!.settings.arguments as PatientController;
    return PatientAddressScreen(controller: controller);
  },
  RouteNames.patientFamilyMembersScreen: (context) {
    final controller =
        ModalRoute.of(context)!.settings.arguments as PatientController;
    return PatientFamilyMembersScreen(controller: controller);
  },
  RouteNames.familyMembersEditScreen: (context) {
    final controller =
        ModalRoute.of(context)!.settings.arguments as PatientController;
    return FamilyMembersEditScreen(controller: controller);
  },
  RouteNames.patientprofileScreen: (context) => const PatientProfileScreen()
};
