pdrpulm 1.0.0 copy "pdrpulm: ^1.0.0" to clipboard
pdrpulm: ^1.0.0 copied to clipboard

discontinued
outdatedDart 1 only

Pull Down to Refresh & Pull Up to 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())));
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Pull Down to Refresh & Pull Up to Load More

Repository
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on pdrpulm