getMemberMediumModelChainOfMediumInfo static method
Future<List<MediumInfo> >
getMemberMediumModelChainOfMediumInfo(
- String? appId,
- MemberMediumModel memberMediumModel
Implementation
static Future<List<MediumInfo>> getMemberMediumModelChainOfMediumInfo(
String? appId, MemberMediumModel memberMediumModel) async {
var infos = <MediumInfo>[];
var currentPolicy = memberMediumModel;
_addMemberMediumInfo(infos, currentPolicy);
while (currentPolicy.relatedMediumId != null) {
var newPolicy = await memberMediumRepository(appId: appId)!
.get(currentPolicy.relatedMediumId);
if (newPolicy == null) {
print("Can't get policy");
} else {
currentPolicy = newPolicy;
_addMemberMediumInfo(infos, currentPolicy);
}
}
return infos;
}