continuation_token 2.1.0 icon indicating copy to clipboard operation
continuation_token: ^2.1.0 copied to clipboard

Encode and decode continuation token values for stateless pagination APIs.

Encode and decode continuation token values for stateless pagination APIs.

Continuation data is a free-form Map that is:

  • encoded as JSON String
  • encoded as UTF-8 bytes
  • XOR-d with a given bytes of secret (optional)
  • encoded as BASE-64 String

Usage #

A simple usage example:

import 'package:continuation_token/continuation_token.dart';

main() {
  final codec = jsonMapContinuationCodec(secret: 'my-secret');

  final token = codec.encode({'id': 'abc123', 'asc': true});
  print(token); // FltEF0dZUAQWDkgfQEdPUAQHDlsXBxcWFxg

  final data = codec.decode(token);
  print(data); // {id: abc123, asc: true}
}
1
likes
140
pub points
36%
popularity

Publisher

unverified uploader

Encode and decode continuation token values for stateless pagination APIs.

Homepage

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

More

Packages that depend on continuation_token