getPublicMediumChainOfUrls static method

Future<List<String>> getPublicMediumChainOfUrls(
  1. String appId,
  2. PublicMediumModel publicMediumModel
)

Implementation

static Future<List<String>> getPublicMediumChainOfUrls(
    String appId, PublicMediumModel publicMediumModel) async {
  var urls = <String>[];
  var currentPolicy = publicMediumModel;
  _addPublicMediumUrl(urls, currentPolicy);
  while (currentPolicy.relatedMediumId != null) {
    var newPolicy = await publicMediumRepository(appId: appId)!
        .get(currentPolicy.relatedMediumId);
    if (newPolicy == null) {
      print("Can't get policy");
    } else {
      currentPolicy = newPolicy;
      _addPublicMediumUrl(urls, currentPolicy);
    }
  }
  return urls;
}