import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:recolecta_app/features/separation_guide/models/separation_guide_model.dart';

// Esta guía funciona offline. El chat con IA (mascota) es la capa extra cuando hay conexión — ver features/mascota/
final separationGuideProvider = FutureProvider<SeparationGuide>((ref) async {
  // keepAlive: provider is non-autoDispose to avoid reloading the JSON on
  // each navigation. This makes the guide work offline without repeated IO.
  final jsonString = await rootBundle.loadString(
    'assets/data/separation_guide.json',
  );
  final jsonResponse = json.decode(jsonString) as Map<String, dynamic>;
  return SeparationGuide.fromJson(jsonResponse);
});
