biscuits 1.1.0

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

Biscuits.dart

Runtime Release License Coverage Build

Service for interacting with the HTTP cookies in Dart.

Resources

License

Biscuits.dart is distributed under the MIT License.

Changelog

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: ^1.1.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';
  
Version Uploaded Documentation Archive
1.1.0 Aug 18, 2018 Go to the documentation of biscuits 1.1.0 Download biscuits 1.1.0 archive
1.0.0 Aug 16, 2018 Go to the documentation of biscuits 1.0.0 Download biscuits 1.0.0 archive
0.2.0 Jul 21, 2018 Go to the documentation of biscuits 0.2.0 Download biscuits 0.2.0 archive
0.1.0 Jul 9, 2018 Go to the documentation of biscuits 0.1.0 Download biscuits 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
68
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]
84
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: web

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

Suggestions

Format lib/src/cookie_options.dart.

Run dartfmt to format lib/src/cookie_options.dart.

Format lib/src/cookies.dart.

Run dartfmt to format lib/src/cookies.dart.

Format lib/src/simple_change.dart.

Run dartfmt to format lib/src/simple_change.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
intl ^0.15.7 0.15.7
json_annotation ^1.1.0 1.1.0
Transitive dependencies
path 1.6.2
Dev dependencies
build_runner ^0.10.1
build_test ^0.10.3
build_web_compilers ^0.4.2
grinder ^0.8.3
json_serializable ^1.1.0
test ^1.3.0