import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../data/datasources/pokemon_local_datasource.dart';
import '../../data/datasources/pokemon_remote_datasource.dart';
import '../../data/repositories/pokemon_repository_impl.dart';
import '../../domain/repositories/pokemon_repository.dart';

/// Point d'injection unique du repository. Sur le web, pas de SQLite (local = null).
final pokemonRepositoryProvider = Provider<PokemonRepository>((ref) {
  final remote = PokemonRemoteDataSource();
  final local = kIsWeb ? null : PokemonLocalDataSource();
  return PokemonRepositoryImpl(remote: remote, local: local);
});
