getAll method

  1. @override
Future<List<Model>> getAll({
  1. String? userId,
  2. Where? where,
  3. String? orderBy,
  4. bool descending = true,
})
override

Returns all the entries in the repository. If userId is not null, the results will have the same user id. If where is not null, the results will be compliant to the where clause.

Implementation

@override
Future<List<Model>> getAll(
    {String? userId,
    Where? where,
    String? orderBy,
    bool descending = true}) async {
  _checkInitializationStatus();

  List<Model> correspondingUserModels = List.from(_models
      .where((element) => userId == null || element.userId! == userId)
      .toList());

  return correspondingUserModels;
}