flutter_easyrefresh 1.1.4

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

flutter_easyrefresh

License Awesome Flutter Pub

English | 中文

正如名字一样,EasyRefresh很容易就能在Flutter应用上实现下拉刷新以及上拉加载操作,它支持几乎所有的Flutter控件,但前提是需要包裹成ScrollView。它的功能与Android的SmartRefreshLayout很相似,同样也吸取了很多三方库的优点。EasyRefresh中集成了多种风格的Header和Footer,但是它并没有局限性,你可以很轻松的自定义。使用Flutter强大的动画,甚至随便一个简单的控件也可以完成。EasyRefresh的目标是为Flutter打造一个强大,稳定,成熟的下拉刷新框架。

特点功能:

  • 支持Andorid(光晕),ios(越界回弹)效果
  • 支持任意的ScrollView控件,如果不是进行简单封装即可(所以理论是所有控件)
  • 支持自定义并且已经集成了很多炫酷的 Header 和 Footer
  • 支持下拉刷新、上拉加载(可自动)
  • 支持 Header 和 Footer 列表嵌入以及视图浮动两种形式

传送门

Demo

下载 APK-Demo

项目演示

基本样式自动加载
BasicPageAutoLoadPage
浮动效果个人中心
FloatPageUserProfilePage
CustomScroolViewSwiper
SliverPageSwiperPage
列表嵌入Cupertino
ListEmbedPageCupertinoPage

样式演示

MaterialBallPulse
MaterialPageBallPulsePage
BezierCircleBezierHourGlass
BezierCirclePageBezierHourGlassPage
PhoenixDelivery
PhoenixPageTaurusPage
SpaceDelivery
SpacePageDeliveryPage

简单用例

1.在 pubspec.yaml 中添加依赖

//pub方式
dependencies:
  flutter_easyrefresh: ^1.1.4

//导入方式
dependencies:
  flutter_easyrefresh:
    path: 项目路径

2.在布局文件中添加 EasyreFresh

import 'package:flutter_easyrefresh/easy_refresh.dart';
....
  GlobalKey<EasyRefreshState> _easyRefreshKey = new GlobalKey<EasyRefreshState>();
....
  new EasyRefresh(
    key: _easyRefreshKey,
    child: ScrollView(),
    onRefresh: () async{
      ....
    },
    loadMore: () async {
      ....
    },
  )

3.触发刷新和加载动作

  // 如果不需要可以不用设置EasyRefresh的key
  _easyRefreshKey.currentState.callRefresh();
  _easyRefreshKey.currentState.callLoadMore();
import 'package:flutter_easyrefresh/easy_refresh.dart';
....
  GlobalKey<RefreshHeaderState> _headerKey = new GlobalKey<RefreshHeaderState>();
  GlobalKey<RefreshFooterState> _footerKey = new GlobalKey<RefreshFooterState>();
....
  // 因为EasyRefresh会对Header和Footer进行更新,为了与用户保持统一的操作状态,必须设置key
  // 不同的Header和Footer可能有不同的参数设置
  new EasyRefresh(
    refreshHeader: MaterialHeader(
        key: _headerKey,
    ),
    refreshFooter: MaterialFooter(
        key: _footerKey,
    ),
    child: ScrollView(),
    ....
  )

捐赠

如果你喜欢我的项目,请在项目右上角 "Star" 一下。你的支持是我最大的鼓励! ^_^ 你也还可以扫描下面的二维码,或者通过Donate to this project using Paypal,对作者进行打赏。

如果在捐赠留言中备注名称,将会被记录到列表中~ 如果你也是github开源作者,捐赠时可以留下github项目地址或者个人主页地址,链接将会被添加到列表中起到互相推广的作用
捐赠列表

QQ讨论群 - 554981921

进群须知

这个群不仅仅是解决EasyreFresh的问题,任何Flutter相关的问题都可以进行讨论。正如它的名字一样,有问必答,只要群主有时间,都会帮大家一起解决问题。

感谢

PullToRefresh_Flutter
flutter_pulltorefresh
SmartRefreshLayout
flutter_spinkit

开源协议

 
MIT License

Copyright (c) 2018 xuelongqy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

 

Change log

V 1.0.0

Add: Drop-down refresh and pull-up loading
Add: Rebound effect and halo effect
Add: Custom Headers and Footers
Add: Material and BallPulse style

V 1.0.1

Adjustment: Height of trigger loading
Add: BezierCircleHeader
Add: BezierHourGlassHeader
Add: BezierBounceFooter

V 1.0.2

Adjustment: Drag coefficient of pull-up loading
Repair: Problem of multiple pull-ups that may get stuck
Repair: Automatic triggering BallPulse without animation problems

V 1.0.3

Repair: Using CustomScrollView load error
Repair: Partial view than SafeArea deviation
Add: CustomScrollView usage examples

V 1.0.4

Modify: UserProfilePage
Add: limitScroll attribute (scrollable list during refresh or loading)

V 1.0.5

Repair: Not setting onRefresh causes more problems without triggering load

V 1.0.6

Add: RefreshSafeArea,resolved Sliding Conflict

V 1.0.7

Repair: loadMore conflicts with autoLoad
Repair: Drag a list repeatedly triggers a cross-border event

V 1.0.8

Add: Header and Footer listeners for quick and easy customization
Add: Header and Footer connectors for placing Header and Footer in any position
Add:Manual control load refresh finish
Repair: Trigger loading problem across borders
Repair: BallPulse animation problem
Repair: Exception when the refresh process exited
Add: ClassicHeader and ClassicFooter animation
Repair: Manually calling refresh or loading does not trigger callbacks

V 1.0.9

Repair: Classic style arrow reverse

V 1.1.0

Repair: Classic style arrows don't recover
Add: Cupertino style example

V 1.1.1

Repair: Pulling down too fast triggers scrolling up and causing slow rebound
Add: Taurus and Phoenix style

V 1.1.2

Add: Flare animation - Space
Add: Delivery animation

V 1.1.3

Repair: ios repeatedly pull down, the distance becomes longer
Modify: Delivery animation height

V 1.1.4

Repair: HeaderListener and FooterListener use both highly updated fusions
Adjustment: Delivery animation speed
Add: Close callback for Header and Footer
Add: First refresh
Add: Empty widget

example/README.md

example

Easy refresh example.

Getting Started

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_easyrefresh: ^1.1.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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_easyrefresh/ball_pulse_footer.dart';
import 'package:flutter_easyrefresh/ball_pulse_header.dart';
import 'package:flutter_easyrefresh/bezier_bounce_footer.dart';
import 'package:flutter_easyrefresh/bezier_circle_header.dart';
import 'package:flutter_easyrefresh/bezier_hour_glass_header.dart';
import 'package:flutter_easyrefresh/delivery_header.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_easyrefresh/material_footer.dart';
import 'package:flutter_easyrefresh/material_header.dart';
import 'package:flutter_easyrefresh/phoenix_footer.dart';
import 'package:flutter_easyrefresh/phoenix_header.dart';
import 'package:flutter_easyrefresh/space_footer.dart';
import 'package:flutter_easyrefresh/space_header.dart';
import 'package:flutter_easyrefresh/taurus_footer.dart';
import 'package:flutter_easyrefresh/taurus_header.dart';
  
Version Uploaded Documentation Archive
1.1.4 Jan 21, 2019 Go to the documentation of flutter_easyrefresh 1.1.4 Download flutter_easyrefresh 1.1.4 archive
1.1.3 Jan 18, 2019 Go to the documentation of flutter_easyrefresh 1.1.3 Download flutter_easyrefresh 1.1.3 archive
1.1.2 Jan 17, 2019 Go to the documentation of flutter_easyrefresh 1.1.2 Download flutter_easyrefresh 1.1.2 archive
1.1.1 Jan 9, 2019 Go to the documentation of flutter_easyrefresh 1.1.1 Download flutter_easyrefresh 1.1.1 archive
1.1.0 Jan 7, 2019 Go to the documentation of flutter_easyrefresh 1.1.0 Download flutter_easyrefresh 1.1.0 archive
1.0.9 Jan 7, 2019 Go to the documentation of flutter_easyrefresh 1.0.9 Download flutter_easyrefresh 1.0.9 archive
1.0.8 Jan 7, 2019 Go to the documentation of flutter_easyrefresh 1.0.8 Download flutter_easyrefresh 1.0.8 archive
1.0.7 Dec 27, 2018 Go to the documentation of flutter_easyrefresh 1.0.7 Download flutter_easyrefresh 1.0.7 archive
1.0.6 Dec 24, 2018 Go to the documentation of flutter_easyrefresh 1.0.6 Download flutter_easyrefresh 1.0.6 archive
1.0.5 Dec 24, 2018 Go to the documentation of flutter_easyrefresh 1.0.5 Download flutter_easyrefresh 1.0.5 archive

All 15 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
81
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms:

Error(s) prevent platform classification:

Error(s) in lib/space_footer.dart: Target of URI doesn't exist: 'package:flare_flutter/flare/math/mat2d.dart'.

Health issues and suggestions

Fix lib/space_footer.dart. (-76.62 points)

Analysis of lib/space_footer.dart failed with 5 errors, 3 hints, including:

line 5 col 8: Target of URI doesn't exist: 'package:flare_flutter/flare/math/mat2d.dart'.

line 46 col 75: Classes and mixins can only implement classes.

line 46 col 75: Undefined class 'FlareController'.

line 78 col 25: Undefined class 'Mat2D'.

line 146 col 11: The argument type 'SpaceFooterState' can't be assigned to the parameter type 'FlareController'.

Fix lib/space_header.dart. (-76.62 points)

Analysis of lib/space_header.dart failed with 5 errors, 3 hints, including:

line 5 col 8: Target of URI doesn't exist: 'package:flare_flutter/flare/math/mat2d.dart'.

line 46 col 75: Classes and mixins can only implement classes.

line 46 col 75: Undefined class 'FlareController'.

line 78 col 25: Undefined class 'Mat2D'.

line 146 col 9: The argument type 'SpaceHeaderState' can't be assigned to the parameter type 'FlareController'.

Fix lib/src/footer/footer.dart. (-10.89 points)

Analysis of lib/src/footer/footer.dart reported 23 hints, including:

line 55 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 60 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 65 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 70 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 75 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix additional 18 files with analysis or formatting issues. (-21.35 points)

Additional issues in the following files:

  • lib/src/header/header.dart (22 hints)
  • lib/material_footer.dart (8 hints)
  • lib/bezier_circle_header.dart (3 hints)
  • lib/bezier_hour_glass_header.dart (3 hints)
  • lib/ball_pulse_footer.dart (2 hints)
  • lib/ball_pulse_header.dart (2 hints)
  • lib/bezier_bounce_footer.dart (2 hints)
  • lib/src/scrollPhysics/scroll_physics.dart (2 hints)
  • lib/delivery_header.dart (Run flutter format to format lib/delivery_header.dart.)
  • lib/easy_refresh.dart (Run flutter format to format lib/easy_refresh.dart.)
  • lib/material_header.dart (Run flutter format to format lib/material_header.dart.)
  • lib/phoenix_footer.dart (Run flutter format to format lib/phoenix_footer.dart.)
  • lib/phoenix_header.dart (Run flutter format to format lib/phoenix_header.dart.)
  • lib/src/behavior/behavior.dart (Run flutter format to format lib/src/behavior/behavior.dart.)
  • lib/src/refresh_safe_area.dart (Run flutter format to format lib/src/refresh_safe_area.dart.)
  • lib/src/refresher.dart (Run flutter format to format lib/src/refresher.dart.)
  • lib/taurus_footer.dart (Run flutter format to format lib/taurus_footer.dart.)
  • lib/taurus_header.dart (Run flutter format to format lib/taurus_header.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Error(s) in lib/space_footer.dart: Target of URI doesn't exist: 'package:flare_flutter/flare/math/mat2d.dart'.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flare_flutter ^1.0.11 1.1.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
flare_dart 1.1.0
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test