clear method

  1. @override
Future<void> clear({
  1. String? userId,
})
override

Deletes all the entries of the repository. If userId is not null, the only enties that will be deleted will have the same user id.

Implementation

@override
Future<void> clear({String? userId}) async {
  _checkInitializationStatus();

  _models
      .removeWhere((element) => userId == null || element.userId! == userId);
  _writeRaw();
}