paginationview to simplify pagination
flutter package to simplify pagination of list of items from the internet.
installing
in your pubspec.yaml
dependencies:
pagination_view: ^1.0.1
import 'package:pagination_view/pagination_view.dart';
basic usage
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,
),
),
paginationviewtype: paginationviewtype.listview // optional
pagefetch: pagefetch,
onerror: (dynamic error) => center(
child: text('some error occured'),
),
onempty: center(
child: text('sorry! this is empty'),
),
bottomloader: center( // optional
child: circularprogressindicator(),
),
initialloader: center( // optional
child: circularprogressindicator(),
),
),
getting started
this project is a starting point for a dart
package,
a library module containing code that can be shared easily across
multiple flutter or dart projects.
for help getting started with flutter, view our
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full api reference.
Comments are closed.