page 1.1.0

Data structure to help paginating (e.g. cursor- or next-token-driven) API calls.

The intended audience of this library is API implementations and backend clients, e.g. database drivers.

1.1.0 #

  • synchronizePages to synchronize/diff two pages (assuming the keys are sorted in ascending order).

1.0.0 #

  • Initial version.


import 'package:page/page.dart';

main() async {
  final Page page = await null; // There goes a call to the database.

  final iterator = page.asIterator();
  // iterator will request the next page when needed

  while (await iterator.moveNext()) {
    print(iterator.current); // prints current item

Use this package as a library

1. Depend on it

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

  page: ^1.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:page/page.dart';
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 Feb 13, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/page.dart. (-1 points)

Analysis of lib/page.dart reported 2 hints:

line 50 col 37: Unnecessary new keyword.

line 65 col 12: Unnecessary new keyword.

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

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

line 20 col 12: Unnecessary new keyword.

Fix lib/synchronize.dart. (-0.50 points)

Analysis of lib/synchronize.dart reported 1 hint:

line 113 col 10: Unnecessary new keyword.

Maintenance suggestions

Package is getting outdated. (-11.78 points)

The package was last published 58 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0