import 'dart:ui';
import 'package:krow_core/core.dart';
import '../repositories/locale_repository_interface.dart';

/// Use case to retrieve the persisted application locale.
///
/// This class extends [NoInputUseCase] and interacts with [LocaleRepositoryInterface]
/// to fetch the saved locale.
class GetLocaleUseCase extends NoInputUseCase<Locale?> {
  final LocaleRepositoryInterface _repository;

  /// Creates a [GetLocaleUseCase] with the required [LocaleRepositoryInterface].
  GetLocaleUseCase(this._repository);

  @override
  Future<Locale> call() {
    return _repository.getSavedLocale();
  }
}
