import 'package:firebase_auth/firebase_auth.dart';

import '../../domain/repositories/settings_repository_interface.dart';

/// Implementation of [SettingsRepositoryInterface].
///
/// This implementation delegates authentication operations to [FirebaseAuth].
class SettingsRepositoryImpl implements SettingsRepositoryInterface {
/// Creates a [SettingsRepositoryImpl] with the required [_firebaseAuth].
  const SettingsRepositoryImpl({required this.firebaseAuth});

  /// The Firebase Auth instance.
  final FirebaseAuth firebaseAuth;

  @override
  Future<void> signOut() async {
    try {
      await firebaseAuth.signOut();
    } catch (e) {
      throw Exception('Error signing out: ${e.toString()}');
    }
  }
}
