stringifyToggles function

String stringifyToggles(
  1. Map<String, ToggleConfig> toggles
)

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});
}