platform/packages/paginate/example/main.dart
2021-06-26 19:55:17 +08:00

15 lines
434 B
Dart

import 'package:angel3_paginate/angel3_paginate.dart';
void main() {
var iterable = [1, 2, 3, 4];
var p = 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)
}