resetImportances method Null safety

Future<void> resetImportances()

Implementation

Future<void> resetImportances() async {
  await clearImportances(notifyListeners: false);
  if (attributeGroups != null) {
    for (final AttributeGroup attributeGroup in attributeGroups!) {
      if (attributeGroup.attributes != null) {
        for (final Attribute attribute in attributeGroup.attributes!) {
          final String? defaultF = attribute.defaultF;
          if (attribute.id != null && defaultF != null) {
            await setImportance(
              attribute.id!,
              defaultF,
              notifyListeners: false,
            );
          }
        }
      }
    }
  }
  notify();
}