// import 'package:firebase_crashlytics/firebase_crashlytics.dart';
// import 'package:flutter/material.dart';

import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:injector/injector.dart';
import 'package:mc_common_app/api/api_client.dart';
import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/repositories/ads_repo.dart';
import 'package:mc_common_app/repositories/appointment_repo.dart';
import 'package:mc_common_app/repositories/branch_repo.dart';
import 'package:mc_common_app/repositories/chat_repo.dart';
import 'package:mc_common_app/repositories/common_repo.dart';
import 'package:mc_common_app/repositories/payments_repo.dart';
import 'package:mc_common_app/repositories/setting_options_repo.dart';
import 'package:mc_common_app/repositories/shipping_repo.dart';
import 'package:mc_common_app/repositories/user_repo.dart';
import 'package:mc_common_app/services/common_services.dart';
import 'package:mc_common_app/services/firebase_service.dart';
import 'package:mc_common_app/services/payments_service.dart';
import 'package:mc_common_app/utils/location/Location.dart';

import '../repositories/request_repo.dart';

Injector injector = Injector.appInstance;

class AppDependencies {
  static void addDependencies() {
    //services
    injector.registerSingleton<AppState>(() => AppState());
    injector.registerSingleton<ApiClient>(() => ApiClientImp());
    injector.registerSingleton<CommonAppServices>(() => CommonServicesImp());
    injector.registerSingleton<PaymentService>(() => PaymentServiceImp());
    injector.registerSingleton<Location>(() => LocationService());
    injector.registerSingleton<FirebaseMessagingService>(() => FirebaseMessagingServiceImp(
          firebaseMessaging: FirebaseMessaging.instance,
          flutterLocalNotifications: FlutterLocalNotificationsPlugin(),
        ));

    //repos
    injector.registerSingleton<UserRepo>(() => UserRepoImp());
    injector.registerSingleton<CommonRepo>(() => CommonRepoImp());
    injector.registerSingleton<AdsRepo>(() => AdsRepoImp());
    injector.registerSingleton<PaymentsRepo>(() => PaymentsRepoImp());
    injector.registerSingleton<RequestRepo>(() => RequestRepoImp());
    injector.registerSingleton<AppointmentRepo>(() => AppointmentRepoImp());
    injector.registerSingleton<ChatRepo>(() => ChatRepoImp());
    injector.registerSingleton<BranchRepo>(() => BranchRepoImp());
    injector.registerSingleton<ShippingRepo>(() => ShippingRepoImp());
    injector.registerSingleton<SettingOptionsRepo>(() => SettingOptionsRepoImp());

    //
  }
}
