material_load_scrollview 1.0.2

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

material_load_scrollview

pub package

A widget that make the ScrollView to be push to load data,and click to refresh data,support custom footer,Theoretically compatible with all Scrollable Widgets.

Screenshot

Getting Started

In your pubspec.yaml:

dependencies:
  material_load_scrollview: lastVersion
import 'package:material_load_scrollview/material_load_scrollview.dart';
MaterialLoadScrollView(
          key: _key, //necessary for resetLoadStatus
          onRefresh: () {
          },
          onLoadMore: () {
          },
          child: ListView.builder(
            controller: ScrollController(), //necessary for scroll to top when onRefresh
            itemCount: _page * _itemCount,
            itemBuilder: (_, _i) => Container(
                  margin: EdgeInsets.only(bottom: 8.0),
                  color: Colors.white,
                  padding: EdgeInsets.all(8.0),
                  child: Text("$_i"),
                ),
          ),
        );

_key.currentState.reset();

Thanks

QuirijnGB / lazy-load-scrollview

0.0.1

  • TODO: Describe initial release.

example/README.md

material_load_scrollview_example

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  GlobalKey<MaterialLoadScrollViewState> _key =
      new GlobalKey(); //necessary for resetLoadStatus
  int _page = 1;
  final _itemCount = 30;

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('MaterialLoadScrollView example'),
        ),
        body: MaterialLoadScrollView(
          key: _key,
          onRefresh: () {
            Future.delayed(Duration(seconds: 3)).then((_) {
              setState(() {
                _page = 1;
                _resetLoadStatus();
              });
            });
          },
          onLoadMore: () {
            Future.delayed(Duration(seconds: 3)).then((_) {
              setState(() {
                _page++;
                _resetLoadStatus();
              });
            });
          },
          child: ListView.builder(
            controller: ScrollController(),
            //necessary for scroll to top when onRefresh
            itemCount: _page * _itemCount,
            itemBuilder: (_, _i) => Container(
                  margin: EdgeInsets.only(bottom: 8.0),
                  color: Colors.white,
                  padding: EdgeInsets.all(8.0),
                  child: Text("$_i"),
                ),
          ),
        ),
      ),
    );
  }

  _resetLoadStatus() {
    _key.currentState.reset();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  material_load_scrollview: ^1.0.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:material_load_scrollview/material_load_scrollview.dart';
  
Version Uploaded Documentation Archive
1.0.2 Dec 6, 2018 Go to the documentation of material_load_scrollview 1.0.2 Download material_load_scrollview 1.0.2 archive
1.0.1 Nov 26, 2018 Go to the documentation of material_load_scrollview 1.0.1 Download material_load_scrollview 1.0.1 archive
1.0.0 Nov 26, 2018 Go to the documentation of material_load_scrollview 1.0.0 Download material_load_scrollview 1.0.0 archive
0.0.1 Nov 26, 2018 Go to the documentation of material_load_scrollview 0.0.1 Download material_load_scrollview 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Dec 6, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8