import 'package:car_provider_app/models/profile/branch.dart';
import 'package:car_provider_app/models/user/register_user.dart';
import 'package:car_provider_app/pages/dashboard/dashboard_page.dart';
import 'package:car_provider_app/pages/settings/branch/branch_detail_page.dart';
import 'package:car_provider_app/pages/settings/branch/branch_list_page.dart';
import 'package:car_provider_app/pages/settings/create_services_page.dart';
import 'package:car_provider_app/pages/settings/dealership_page.dart';
import 'package:car_provider_app/pages/settings/define_license_page.dart';
import 'package:car_provider_app/pages/user/change_email_page.dart';
import 'package:car_provider_app/pages/user/change_mobile_page.dart';
import 'package:car_provider_app/pages/user/change_password_page.dart';
import 'package:car_provider_app/pages/user/complete_profile_page.dart';
import 'package:car_provider_app/pages/user/confirm_new_password_page.dart';
import 'package:car_provider_app/pages/user/edit_account_page.dart';
import 'package:car_provider_app/pages/user/forget_password_method_page.dart';
import 'package:car_provider_app/pages/user/forget_password_page.dart';
import 'package:car_provider_app/pages/user/login_method_selection_page.dart';
import 'package:car_provider_app/pages/user/login_verification_page.dart';
import 'package:car_provider_app/pages/user/login_verify_account_page.dart';
import 'package:car_provider_app/pages/user/login_with_password_page.dart';
import 'package:car_provider_app/pages/user/profile/profile_1_page.dart';
import 'package:car_provider_app/pages/user/profile/profile_2_page.dart';
import 'package:car_provider_app/pages/user/profile/profile_3_page.dart';
import 'package:car_provider_app/pages/user/register_page.dart';
import 'package:car_provider_app/pages/user/register_selection_page.dart';
import 'package:car_provider_app/pages/user/selection_page.dart';
import 'package:car_provider_app/pages/user/splash_page.dart';
import 'package:car_provider_app/pages/user/vertify_password_page.dart';
import 'package:flutter/material.dart';

import '../models/profile/branch2.dart';
import '../pages/settings/branch/define_branch_page.dart';

class AppRoutes {
  //User
  static final String splash = "/splash";
  static final String selectionPage = "/selectionPage";
  static final String registerSelection = "/registerSelection";
  static final String loginVerifyAccount = "/loginVerifyAccount";
  static final String register = "/register";
  static final String forgetPassword = "/forgetPassword";
  static final String loginVerification = "/loginVerification";
  static final String loginWithPassword = "/loginWithPassword";
  static final String loginMethodSelection = "/loginMethodSelection";
  static final String completeProfile = "/completeProfile";
  static final String profile1 = "/profile1";
  static final String profile2 = "/profile2";
  static final String profile3 = "/profile3";
  static final String vertifyPassword = "/vertifyPassword";
  static final String confirmNewPasswordPage = "/confirmNewPasswordPage";
  static final String defineLicense = "/defineLicese";
  static final String changePassword = "/changePassword";
  static final String forgetPasswordMethodPage = "/forgetPasswordMethodPage";
  static final String changeMobilePage = "/changeMobilePage";
  static final String changeEmailPage = "/changeEmailPage";
  static final String editAccoundPage = "/editAccoundPage";

  static final String dashboard = "/dashboard";

  //settings
  static final String dealershipSetting = "/dealershipSetting";
  static final String branchList = "/branchList";
  static final String branchDetail = "/branchDetail";
  static final String defineBranch = "/defineBranch";
  static final String createServices = "/createServices";

  static final String initialRoute = splash;

  static final Map<String, WidgetBuilder> routes = {
    //User
    splash: (context) => SplashPage(),
    selectionPage: (context) => SelectionPage(),
    registerSelection: (context) => RegisterSelectionPage(),
    loginVerifyAccount: (context) => LoginVerifyAccountPage(),
    register: (context) => RegisterPage(),
    forgetPassword: (context) => ForgetPasswordPage(),
    loginVerification: (context) => LoginVerificationPage(),
    loginWithPassword: (context) => LoginWithPassword(),
    loginMethodSelection: (context) => LoginMethodSelectionPage(),
    completeProfile: (context) => CompleteProfilePage(ModalRoute.of(context)!.settings.arguments as RegisterUser),
    profile1: (context) => Profile1Page(),
    profile2: (context) => Profile2Page(),
    profile3: (context) => Profile3Page(),
    defineLicense: (context) => DefineLicensePage(),
    vertifyPassword: (context) => VerifyPasswordPage(),
    confirmNewPasswordPage: (context) => ConfirmNewPasswordPage(ModalRoute.of(context)!.settings.arguments as String),
    changePassword: (context) => ChangePasswordPage(),
    forgetPasswordMethodPage: (context) => ForgetPasswordMethodPage(ModalRoute.of(context)!.settings.arguments as String),
    changeMobilePage: (context) => ChangeMobilePage(),
    changeEmailPage: (context) => ChangeEmailPage(),
    editAccoundPage: (context) => EditAccountPage(),
    //Home page
    dashboard: (context) => DashboardPage(),

    //setting
    dealershipSetting: (context) => DealershipPage(),
    branchList: (context) => BranchListPage(),
    branchDetail: (context) => BranchDetailPage(ModalRoute.of(context)!.settings.arguments as ServiceProviderBranch),
    defineBranch: (context) => DefineBranchPage((ModalRoute.of(context)!.settings.arguments) == null ? null : (ModalRoute.of(context)!.settings.arguments as ServiceProviderBranch)),
    createServices: (context) => CreateServicesPage((ModalRoute.of(context)!.settings.arguments) == null ? null : (ModalRoute.of(context)!.settings.arguments as ServiceProviderBranch)),
  };
}
