pdrpulm 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 72

pdrpulm (Pull Down to Refresh & Pull Up to Load More)

A widget that supports "Pull Down to Refresh & Pull Up to Load More" idiom. Google Material never have "Pull Up to Load More" so implement as a package.

Getting Started

Widget build(BuildContext context) {
    return new ScrollIndicator(
        onLoadMore: onLoadMore,
        child: new ListView.builder(
            itemCount: itemCount,
            itemBuilder: (BuildContext context, int index) {
              return new Container(
                height: 150.0,
                decoration: new BoxDecoration(border: new Border.all()),
                child: new Indicator(index.toString()),
              );
            }));
  }

Roadmap

add custom indicator when refresh or loading more

[1.0.0] - 2018-01-01

  • refactor from clean
  • remove indicator

[0.0.1] - 2017-11-01

  • copy from materials/refresh_indicator.dart
  • add load more.

example/lib/main.dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:pdrpulm/pdrpulm.dart';

class Tank extends StatefulWidget {
  _TankState createState() => new _TankState();
}

class Indicator extends StatelessWidget {
  Indicator(this.text);

  final String text;

  Widget build(BuildContext context) {
    return new Container(
        height: 20.0,
        alignment: const Alignment(0.0, 0.0),
        child: new Text(text));
  }
}

class _TankState extends State<Tank> {
  int itemCount;

  @override
  initState() {
    super.initState();

    itemCount = 10;
  }

  Future<Null> onLoadMore() {
    final Completer<Null> completer = new Completer<Null>();
    new Timer(const Duration(microseconds: 1), () {
      completer.complete(null);
    });
    return completer.future.then((_) {
      setState(() {
        itemCount += 10;
      });
    });
  }

  Widget build(BuildContext context) {
    return new ScrollIndicator(
        onLoadMore: onLoadMore,
        child: new ListView.builder(
            itemCount: itemCount,
            itemBuilder: (BuildContext context, int index) {
              return new Container(
                height: 150.0,
                decoration: new BoxDecoration(border: new Border.all()),
                child: new Indicator(index.toString()),
              );
            }));
  }
}

void main() => runApp(new MaterialApp(
    home: new Scaffold(
        appBar: new AppBar(title: const Text("EXAMPLE FOR PDRPULM")),
        body: new Tank())));

1. Depend on it

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


dependencies:
  pdrpulm: "^1.0.1"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:pdrpulm/pdrpulm.dart';
        
Version Uploaded Documentation Archive
1.0.1 Jan 3, 2018 Go to the documentation of pdrpulm 1.0.1 Download pdrpulm 1.0.1 archive
1.0.0 Jan 1, 2018 Go to the documentation of pdrpulm 1.0.0 Download pdrpulm 1.0.0 archive
0.0.2 Dec 9, 2017 Go to the documentation of pdrpulm 0.0.2 Download pdrpulm 0.0.2 archive
0.0.1 Dec 9, 2017 Go to the documentation of pdrpulm 0.0.1 Download pdrpulm 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1
  • Flutter: 0.0.22

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
44 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
72

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
flutter 0.0.0
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
http 0.11.3+16
http_parser 3.1.1
meta 1.1.1 1.1.2
path 1.5.1
sky_engine 0.0.99
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.4 1.1.5
vector_math 2.0.5
Dev dependencies
flutter_test