client_cookie 2.1.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 81

client_cookie

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

Cookies

Lets create a cookie named Client with value jaguar_resty:

main() {
  var cookie = new ClientCookie('Client', 'jaguar_resty', 
    new DateTime.now());
}

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

main() {
  var cookie = new ClientCookie('Client', 'jaguar_resty', 
    new DateTime.now());
  print(cookie.header);
}

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 DateTime.now());
  var cookie2 = new ClientCookie('Client', 'jaguar_resty', new DateTime.now());
  print(ClientCookie.toHeader([cookie1, cookie2]));
}

Changelog

2.1.4

  • Dart 2 stable

2.1.2

  • Added cookie and cookiesMap to CookieStore

2.1.1

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

1.0.0

  • Added toHeader static method to ClientCookie

example/client_cookie_example.dart

// 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 DateTime.now());

  // Cookie to header string
  print(cookie1.asHeader);

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

Use this package as a library

1. Depend on it

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


dependencies:
  client_cookie: ^2.1.5

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.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
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

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 https://github.com/Jaguar-dart/client_cookie at the time of the analysis.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65 <3.0.0
http ^0.11.0 0.11.3+17 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