From d04334f7c91811c2c33f7dbb22a1bcf6bf06c1f7 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 15 Jun 2019 08:16:18 +0200 Subject: [PATCH] Can get a list of users with a throw strategy --- lib/helpers/users_helper.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/helpers/users_helper.dart b/lib/helpers/users_helper.dart index c18d359..1e9e517 100644 --- a/lib/helpers/users_helper.dart +++ b/lib/helpers/users_helper.dart @@ -63,6 +63,19 @@ class UsersHelper { return list; } + /// Get users information from a given [Set]. Throws an exception in case + /// of failure + Future getListWithThrow(Set users, + {bool forceDownload = false}) async { + final list = await getUsersInfo(users.toList()); + + if (list == null) + throw Exception( + "Could not get information about the given list of users!"); + + return list; + } + /// Get users information from a given [Set] Future getList(Set users, {bool forceDownload = false}) async {