getImportance property

String Function(String attributeId) getImportance
final

Gets the importance of an attribute, e.g. from a SharedPreferences.

Ex:

getImportance: (String attributeId) =>
    mySharedPreferences.getString(attributeId)
    ?? PreferenceImportance.ID_NOT_IMPORTANT

For pre-determined fix settings, that can be more simple:

getImportance: (String attributeId) =>
    attributeId == AvailableAttributeGroups.ATTRIBUTE_VEGAN
    ? PreferenceImportance.ID_MANDATORY
    : PreferenceImportance.ID_NOT_IMPORTANT

Implementation

final String Function(String attributeId) getImportance;