ls_refresher 0.1.0

  • Readme
  • Changelog
  • Installing
  • 27

features #

  • Drag down refresh, pull up refresh.
  • Simply used within CustomScrollView.
  • Diy the widget displayed on over-scroll area. (use your own builder)
  • Gif image support, image changed along with drag offset.

LSTopRefresher

LSBottomRefresher

start: #

import 'package:ls_refresher/ls_refresher.dart';

then: #

new CustomScrollView(
            slivers: <Widget>[
//              new LSTopRefresher.image('images/test.gif', 'images/test2.gif',
//                  onRefresh: () {
//                return new Future<void>.delayed(const Duration(seconds: 2))
//                  ..then((re) {
//                    setState(() {
//                      changeRandomList();
//                    });
//                  });
//              }),
              new LSTopRefresher.simple(onRefresh: () {
                return new Future<void>.delayed(const Duration(seconds: 2))
                  ..then((re) {
                    setState(() {
                      changeRandomList();
                    });
                  });
              }),
              new SliverList(
                delegate: new SliverChildBuilderDelegate(
                  (BuildContext context, int index) {
                    return new _ListItem(
                      name: randomizedContacts[index][0] + '$index',
                      place: randomizedContacts[index][1],
                      date: randomizedContacts[index][2],
                      called: randomizedContacts[index][3] == 'true',
                    );
                  },
                  childCount: _listCount,
                ),
              ),
//              new LSBottomRefresher.simple(
//                onRefresh: () {
//                  return new Future<void>.delayed(const Duration(seconds: 2))
//                    ..then((re) {
////                      setState(() {
////                        _listCount += 1;
////                      });
//                    });
//                },
//              )
              new LSBottomRefresher.image(
                'images/test3.gif',
                'images/test4.gif',
                onRefresh: () {
                  return new Future<void>.delayed(const Duration(seconds: 2))
                    ..then((re) {
//                      setState(() {
//                        _listCount += 1;
//                      });
                    });
                },
              )
            ],
          ),

[0.1.0] - fix: BottomRefresher not performed correctly

[0.0.8] - fix: extent of BottomRefresher not performed correctly

[0.0.7] - feat: Support TopOffset For TopRefresher

[0.0.6] - fix: bottomRrfresher not working well on some Android Phone and some situation

[0.0.5] - fix: onRefreshExtent

[0.0.4] - expose const.dart

[0.0.2] - add liscense and guide infomation

       - fixed bugs

[0.0.1] - initialize.

Use this package as a library

1. Depend on it

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


dependencies:
  ls_refresher: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:ls_refresher/ls_refresher.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
20
Health:
Code health derived from static analysis. [more]
4
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
27
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

Fix lib/src/image_stream_completer.dart. (-82.29 points)

Analysis of lib/src/image_stream_completer.dart failed with 6 errors, 1 hint, including:

line 64 col 9: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.

line 163 col 11: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.

line 183 col 8: 'MyImageStreamCompleter.addListener' ('void Function(void Function(ImageInfo, bool), {onError: void Function(dynamic, StackTrace)})') isn't a valid override of 'ImageStreamCompleter.addListener' ('void Function(ImageStreamListener)').

line 187 col 23: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.

line 191 col 8: 'MyImageStreamCompleter.removeListener' ('void Function(void Function(ImageInfo, bool))') isn't a valid override of 'ImageStreamCompleter.removeListener' ('void Function(ImageStreamListener)').

Fix lib/src/top_refresher.dart. (-44.31 points)

Analysis of lib/src/top_refresher.dart failed with 2 errors, 2 hints:

line 144 col 23: The argument type 'Null Function(ImageInfo, dynamic)' can't be assigned to the parameter type 'ImageStreamListener'.

line 153 col 23: The argument type 'Null Function(ImageInfo, dynamic)' can't be assigned to the parameter type 'ImageStreamListener'.

line 55 col 17: 'ancestorStateOfType' is deprecated and shouldn't be used. Use findAncestorStateOfType instead. This feature was deprecated after v1.12.1..

line 55 col 43: 'TypeMatcher' is deprecated and shouldn't be used. TypeMatcher has been deprecated because it is no longer used in framework(only in deprecated methods). This feature was deprecated after v1.12.1..

Fix lib/src/bottom_refresher.dart. (-43.75 points)

Analysis of lib/src/bottom_refresher.dart failed with 2 errors:

line 263 col 25: The argument type 'Null Function(ImageInfo, dynamic)' can't be assigned to the parameter type 'ImageStreamListener'.

line 273 col 25: The argument type 'Null Function(ImageInfo, dynamic)' can't be assigned to the parameter type 'ImageStreamListener'.

Fix lib/src/image_provider.dart. (-25 points)

Analysis of lib/src/image_provider.dart failed with 1 error:

line 43 col 24: 'LSImageProvider.load' ('ImageStreamCompleter Function(AssetBundleImageKey)') isn't a valid override of 'ImageProvider.load' ('ImageStreamCompleter Function(AssetBundleImageKey, Future

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

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