In your pubspec.yaml
dependencies:
pagination_view: ^3.0.0
import 'package:pagination_view/pagination_view.dart';
PaginationView<User>(
preloadedItems: <User>[
User(faker.person.name(), faker.internet.email()),
User(faker.person.name(), faker.internet.email()),
],
itemBuilder: (BuildContext context, User user, int index) => ListTile(
title: Text(user.name),
subtitle: Text(user.email),
leading: IconButton(
icon: Icon(Icons.person),
onPressed: () => null,
),
),
header: Text('Header text'),
footer: Text('Footer text'),
paginationViewType: PaginationViewType.listView // optional
pageFetch: pageFetch,
onError: (Exception error) => Center(
child: Text('Some error occurred'),
),
onEmpty: Center(
child: Text('Sorry! This is empty'),
),
bottomLoader: Center( // optional
child: CircularProgressIndicator(),
),
initialLoader: Center( // optional
child: CircularProgressIndicator(),
),
),
Thanks goes to these wonderful people (emoji key):
Saif Allah Khaled ๐ป |
jezsung ๐ป |
psredzinski ๐ป |
Javier Torrus ๐ป |
Jonjo McKay ๐ป |
This project follows the all-contributors specification. Contributions of any kind welcome!