page 1.2.2 copy "page: ^1.2.2" to clipboard
page: ^1.2.2 copied to clipboard

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

example/page_example.dart

import 'package:page/page.dart';

Future<void> main() async {
  final page = await _page(); // 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
  }
}

Future<Page> _page() async => Page.empty();
1
likes
160
points
137
downloads

Publisher

verified publisheragilord.com

Weekly Downloads

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

Repository (GitHub)
View/report issues

Topics

#pagination #cursor #token

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on page