overrideEnabledAttr method

Future<Pref> overrideEnabledAttr(
  1. Pref pref
)

Implementation

Future<Pref> overrideEnabledAttr (Pref pref) async {
  if (pref != null && pref.dependancy != null) {
    Pref parent = getPref(pref.dependancy);
    if (parent != null && parent.type == Pref.TYPE_BOOL) {
      if (parent.value == null) {
        pref.enabled = await getBool(parent.prefKey);
      } else {
        pref.enabled = parent.value;
      }
      setPref(pref);
    }
  }
  return pref;
}