flutter_pagination_helper 1.0.1+2

  • README.md
  • Installing
  • Versions
  • 83

Flutter Pagination Helper #

Flutter pagination helper is used to reduce boilerplate code for pagination.

Description #

Here we have optimised concept of Model from model-view-intent pattern as described by hannes dorfmann. So as a short note you can use this dependency for pagination by providing the state of model retrieved from your business logic. This state could be from progress bar visibility, data, error or data loading completion. Here to show paginated list you need to pass only list of widget as a data.

custom_progress default_progress

Implementation #

To add flutter pagination helper dependency add following dependency in pubspec.yaml

  flutter_pagination_helper: ^1.0.1+2

Common usage #

  • To use this dependency you have to assign PaginatedListWidget to the child of parent widget. In the code the prototype is mentioned to setup a paginated list. It can be retrived from list_helper.dart file.
  • In parameter you can optionally assign progressWidget if you need to design your custom widget as progress. You can change color for default progress by assigning colorSwatch parameter to your parent material app theme.
  • As 2nd parameter you have to assign itemListCallback which will be called each time user reach to end of listview. It can be retrived from item_list_callback.dart file.
import 'package:flutter_pagination_helper/pagination_helper/event_model.dart';
import 'package:flutter_pagination_helper/pagination_helper/item_list_callback.dart';
import 'package:flutter_pagination_helper/pagination_helper/list_helper.dart';

class CustomProgressWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: PaginatedListWidget(
            progressWidget: Center(
              child: Text("Loading..."),
            itemListCallback: OnScrollCallback()),
  • In itemListCallback you have to implement your custom Callback as mentioned in code. It will return Future of generic type EventModel.
class OnScrollCallback<T extends Widget> extends ItemListCallback {
  Future<EventModel<T>> getItemList() {
    // TODO: implement getItemList
    return null;
  • EventModel is ui model to distinguish state as mentioned in code. It will be retrieved from event_model.dart file.
    • Here progress indicates the visibility of progress bar while loading item.
    • data will be list of widgets which will be displayed in list view. [Note : This field will contain items which are not retrieved on previous call].
    • error is a error message when api fails and it will be displayed as SnackBar.
    • stopLoading will be true when all items are retrieved and we need to stop pagination.
class EventModel<T extends Widget> {
  final bool progress;
  final List<T> data;
  final String error;
  final bool stopLoading;

  EventModel({this.progress, this.data, this.error, this.stopLoading});

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.1+2] - 2019-01-22

Added #

  • Updated dependency and sdk version.

[1.0.0+6] - 2019-01-16

Added #

  • Update reference gifs.

[1.0.0+5] - 2019-01-15

Added #

[1.0.0+3] - 2019-01-15

Added #

[1.0.0+2] - 2019-01-15

Added #

[1.0.0+1] - 2019-01-14

Added #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_pagination_helper: ^1.0.1+2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_pagination_helper/example/main.dart';
import 'package:flutter_pagination_helper/pagination_helper/bloc_provider.dart';
import 'package:flutter_pagination_helper/pagination_helper/event_model.dart';
import 'package:flutter_pagination_helper/pagination_helper/item_list_callback.dart';
import 'package:flutter_pagination_helper/pagination_helper/list_helper.dart';
import 'package:flutter_pagination_helper/pagination_helper/list_widget.dart';
import 'package:flutter_pagination_helper/pagination_helper/pagination_bloc.dart';
import 'package:flutter_pagination_helper/pagination_helper/progressbar.dart';
import 'package:flutter_pagination_helper/pagination_helper/widget_list.dart';
Version Uploaded Documentation Archive
1.0.1+2 Jan 22, 2019 Go to the documentation of flutter_pagination_helper 1.0.1+2 Download flutter_pagination_helper 1.0.1+2 archive
1.0.1+1 Jan 20, 2019 Go to the documentation of flutter_pagination_helper 1.0.1+1 Download flutter_pagination_helper 1.0.1+1 archive
1.0.1 Jan 20, 2019 Go to the documentation of flutter_pagination_helper 1.0.1 Download flutter_pagination_helper 1.0.1 archive
1.0.0+9 Jan 20, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+9 Download flutter_pagination_helper 1.0.0+9 archive
1.0.0+8 Jan 20, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+8 Download flutter_pagination_helper 1.0.0+8 archive
1.0.0+7 Jan 17, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+7 Download flutter_pagination_helper 1.0.0+7 archive
1.0.0+6 Jan 16, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+6 Download flutter_pagination_helper 1.0.0+6 archive
1.0.0+5 Jan 15, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+5 Download flutter_pagination_helper 1.0.0+5 archive
1.0.0+4 Jan 15, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+4 Download flutter_pagination_helper 1.0.0+4 archive
1.0.0+3 Jan 15, 2019 Go to the documentation of flutter_pagination_helper 1.0.0+3 Download flutter_pagination_helper 1.0.0+3 archive

All 12 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_pagination_helper.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev.9.4 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies