all method

Future<List<Credentials>> all()

Returns all the Credentials stored in the database.

Implementation

Future<List<Credentials>> all() async {
  final result = await safe((db) async {
    final stmt = await db.select(db.tokens).get();
    return stmt
        .map((e) {
          try {
            return _CredentialsDb.fromDb(e);
          } catch (e) {
            Log.error('Unable to decode `Credentials`: $e', '$runtimeType');
            return null;
          }
        })
        .nonNulls
        .toList();
  }, exclusive: false);

  return result ?? [];
}