Prefs constructor

Prefs(
  1. {List<Pref> preferences}
)

Implementation

Prefs ({ this.preferences }) {
  Map<String, Pref> prefs = Map();
  for (Pref p in this.preferences)
    if (!prefs.containsKey(p.prefKey)) {
      prefs[p.prefKey] = p;
    } else {
      print('WARNING: Duplicate prefKey - preference discarded.');
    }
  this.preferences = prefs.values.toList();
}