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

/// Use case to save the application locale to persistent storage.
///
/// This class extends [UseCase] and interacts with [LocaleRepositoryInterface]
/// to save a given locale.
class SetLocaleUseCase extends UseCase<Locale, void> {
  final LocaleRepositoryInterface _repository;

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

  @override
  Future<void> call(Locale input) {
    return _repository.saveLocale(input);
  }
}
