biscuits 2.3.0

Biscuits.dart #

Runtime Release License Build

Service for interacting with the HTTP cookies in Dart.

Documentation #

Development #

License #

Biscuits.dart is distributed under the MIT License.

Changelog #

Version 2.3.0

  • Added the CookieOptions.maxAge property.
  • Raised the Dart SDK constraint.
  • Using new language features: collection if.
  • Updated the package dependencies.

Version 2.2.0

  • Raised the Dart SDK constraint.
  • Updated the package dependencies.

Version 2.1.0

  • Updated the package dependencies.
  • Updated the URL of the Git repository.

Version 2.0.0

  • Raised the Dart SDK constraint.
  • Updated the package dependencies.

Version 1.3.0

  • Updated the package dependencies.

Version 1.2.0

  • Updated the package dependencies.

Version 1.1.0

  • The Cookies constructor now accepts a Document instance instead of an HtmlDocument one.
  • The SimpleChange class is now generic.
  • Added a defaultValue argument to the get() and getObject() methods of the Cookies class.
  • Added the Cookies.toJson() method.
  • Added new unit tests.

Version 1.0.0

  • First stable release.
  • Raised the Dart SDK constraint.
  • Updated the package dependencies.

Version 0.2.0

  • Raised the Dart SDK constraint.
  • Updated the package dependencies.

Version 0.1.0 #

  • Initial release.

example/main.dart

import 'package:biscuits/biscuits.dart';

/// Tests the cookie service.
void main() {
  final cookies = Cookies();

  // Write the cookies.
  print(cookies.containsKey('foo')); // false
  print(cookies.containsKey('baz')); // false
  print(cookies.length); // 0

  cookies['foo'] = 'bar';
  print(cookies.containsKey('foo')); // true
  print(cookies.length); // 1

  cookies.setObject('baz', <String, int>{'qux': 123});
  print(cookies.containsKey('baz')); // true
  print(cookies.length); // 2

  // Read the cookies.
  print(cookies['foo'].runtimeType); // "String"
  print(cookies['foo']); // "bar"

  print(cookies.getObject('baz').runtimeType); // "_JsonMap"
  print(cookies.getObject('baz')); // {"qux": 123}
  print(cookies.getObject('baz')['qux']); // 123

  // Delete the cookies.
  cookies.remove('foo');
  print(cookies.containsKey('foo')); // false
  print(cookies.length); // 1

  cookies.clear();
  print(cookies.containsKey('baz')); // false
  print(cookies.length); // 0
}

Use this package as a library

1. Depend on it

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


dependencies:
  biscuits: ^2.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:biscuits/biscuits.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
72
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: web

Primary library: package:biscuits/biscuits.dart with components: html.

Health suggestions

Fix lib/src/cookies.dart. (-0.50 points)

Analysis of lib/src/cookies.dart reported 1 hint:

line 108 col 7: DO use curly braces for all flow control structures.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
intl ^0.15.8 0.15.8
json_annotation ^2.3.0 2.4.0
Transitive dependencies
path 1.6.2
Dev dependencies
build_runner ^1.4.0
build_test ^0.10.7
build_web_compilers ^2.0.0
grinder ^0.8.3
json_serializable ^2.3.0
test ^1.6.3

Admin