Map<String, Object?> toMap() { final conf = <String, Object?>{ 'contexts': contexts.map((c) => c.toMap()).toList(), }; conf.removeWhere((key, value) => value == null); return conf; }