get static method

Future<Cookie?> get(
  1. String name
)

Get a single cookie by name. Returns null if not found.

Implementation

static Future<Cookie?> get(String name) async {
  final cookies = await all();
  try {
    return cookies.firstWhere((c) => c.name == name);
  } catch (_) {
    return null;
  }
}