getEntity method

  1. @override
Future<FollowingDashboardEntity?> getEntity(
  1. String? id, {
  2. dynamic onError(
    1. Exception
    )?,
})
override

Implementation

@override
Future<FollowingDashboardEntity?> getEntity(String? id,
    {Function(Exception)? onError}) async {
  try {
    var collection = followingDashboardCollection.doc(id);
    var doc = await collection.get();
    return FollowingDashboardEntity.fromMap(doc.data());
  } on Exception catch (e) {
    if (onError != null) {
      onError(e);
    } else {
      print("Error whilst retrieving FollowingDashboard with id $id");
      print("Exceptoin: $e");
    }
  }
  return null;
}