setListMapValue method

Future<void> setListMapValue(
  1. String key,
  2. List<Map<String, dynamic>> value
)

Implementation

Future<void> setListMapValue(String key, List<Map<String, dynamic>> value) async {
  final jsonString = jsonEncode(value);
  await _storage.write(key, jsonString);
  if (isWeb) {
    try {
      html.window.localStorage[key] = jsonString;
      html.document.cookie = '$key=${Uri.encodeComponent(jsonString)}; path=/; max-age=31536000';
    } catch (_) {}
  }
}