platform/packages/paginate/example/main.dart
Tobe O c6d7d5f416 Add 'packages/paginate/' from commit 'a2daba88abb3c4c73b67922d3f93f2032b14e1da'
git-subtree-dir: packages/paginate
git-subtree-mainline: 12aa791a8e
git-subtree-split: a2daba88ab
2020-02-15 18:28:46 -05:00

15 lines
430 B
Dart

import 'package:angel_paginate/angel_paginate.dart';
main() {
var iterable = [1, 2, 3, 4];
var p = new Paginator(iterable);
// Get the current page (default: page 1)
var page = p.current;
print(page.total);
print(page.startIndex);
print(page.data); // The actual items on this page.
p.next(); // Advance a page
p.back(); // Back one page
p.goToPage(10); // Go to page number (1-based, not a 0-based index)
}