stringifyToggles function
Serializes structured toggles into a String before we send it to the server of local storage
Implementation
String stringifyToggles(Map<String, ToggleConfig> toggles) {
const jsonEncoder = JsonEncoder();
final togglesList =
toggles.entries.map((e) => toJSON(e.key, e.value)).toList();
return jsonEncoder.convert({'toggles': togglesList});
}