getWatched method

Future<List<Movie>> getWatched()

Retrieves the list of watched movies.

Implementation

Future<List<Movie>> getWatched() async {
  final String? moviesJson = _prefs.getString(_watchedKey);
  if (moviesJson == null) return [];

  final List<dynamic> decoded = jsonDecode(moviesJson);
  return decoded.map((movie) => Movie.fromJson(movie)).toList();
}