client_cookie 2.1.6

  • Example
  • Installing
  • Versions
  • 68


Emulates Cookie store for dart:io and Flutter as if its a Browser.


Lets create a cookie named Client with value jaguar_resty:

main() {
  var cookie = new ClientCookie('Client', 'jaguar_resty', 

Use header getter obtain cookie in String format that can be directly added to HTTP request:

main() {
  var cookie = new ClientCookie('Client', 'jaguar_resty', 

Encoding a bunch of cookies

ClientCookie has a static method called toHeader that encodes multiple cookies into a header string:

main() {
  var cookie1 = new ClientCookie('Client', 'jaguar_resty', new;
  var cookie2 = new ClientCookie('Client', 'jaguar_resty', new;
  print(ClientCookie.toHeader([cookie1, cookie2]));



  • Dart 2 stable


  • Added cookie and cookiesMap to CookieStore


  • Renamed addOneCookie to parseOneCookie
  • Renamed addResponse to addFromResponse
  • Added addFromHeader


  • Added toHeader static method to ClientCookie


// Copyright (c) 2017, teja. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:client_cookie/client_cookie.dart';

main() {
  // Initializing a cookie
  var cookie1 = ClientCookie('Client', 'jaguar_resty', new;

  // Cookie to header string

  // Encoding many cookies
  var cookie2 = ClientCookie('Client', 'jaguar_resty', new;
  print(ClientCookie.toHeader([cookie1, cookie2]));

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  client_cookie: ^2.1.6

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:client_cookie/client_cookie.dart';
Version Uploaded Documentation Archive
2.1.6 Oct 30, 2018 Go to the documentation of client_cookie 2.1.6 Download client_cookie 2.1.6 archive
2.1.5 Aug 14, 2018 Go to the documentation of client_cookie 2.1.5 Download client_cookie 2.1.5 archive
2.1.4 Aug 7, 2018 Go to the documentation of client_cookie 2.1.4 Download client_cookie 2.1.4 archive
2.1.2 May 17, 2018 Go to the documentation of client_cookie 2.1.2 Download client_cookie 2.1.2 archive
2.1.1 May 17, 2018 Go to the documentation of client_cookie 2.1.1 Download client_cookie 2.1.1 archive
1.0.0 Apr 17, 2018 Go to the documentation of client_cookie 1.0.0 Download client_cookie 1.0.0 archive
0.1.0 Jul 14, 2017 Go to the documentation of client_cookie 0.1.0 Download client_cookie 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:client_cookie/client_cookie.dart.

Maintenance issues and suggestions

Homepage does not exists. (-20 points)

We were unable to access at the time of the analysis.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65 <3.0.0
http ^0.12.0 0.12.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.6
path 1.6.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
test ^1.3.0