getToWatch method

Future<List<Movie>> getToWatch()

Retrieves the list of to-watch movies.

Implementation

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

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