getCookiesByNames method

Future<Map<String, String?>> getCookiesByNames(
  1. List<String> names
)

Get multiple cookies by names Returns a map with only the requested cookies (empty values for missing cookies)

Implementation

Future<Map<String, String?>> getCookiesByNames(List<String> names) async {
  final allCookies = await getCookies();
  final result = <String, String?>{};

  for (final name in names) {
    result[name] = allCookies[name];
  }

  return result;
}