loadCookies method

Future<void> loadCookies()

Implementation

Future<void> loadCookies() async {
  String? source = await Service.get<CacheService>()
      .getString(key: 'odin_network_route_cookies');

  dynamic data = {};

  if (source != null) {
    data = json.decode(source);
  }

  Map<String, Cookie> result = {};

  data.forEach((key, value) {
    result[key] = Cookie(key, value);
  });

  _cookies = result;
}