Skip to content

Commit 7c2a4a7

Browse files
committed
update readme.md
1 parent 692d1ed commit 7c2a4a7

File tree

24 files changed

+291
-217
lines changed

24 files changed

+291
-217
lines changed

CHANGELOG.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1+
## [0.2.1]
2+
* Upgrade example to AndroidX
3+
* Improved README
4+
## [0.2.0] - Added support for BouncingScrollPhysics.
5+
* Added support for `BouncingScrollPhysics` - ios default sroll physics
6+
* Improved readme
17
## [0.1.1]
2-
38
* Extracted inbox example to [`letter_refresh_indicator`](https://pub.dev/packages/letter_refresh_indicator) package
4-
59
## [0.1.0] - Initial version.
6-
710
* Added basic `CustomRefreshIndicator` widget with `CustomRefreshIndicatorData` class.
811
* Added `SimpleIndicatorContainer` widget which simulate default `RefreshIndicator` container
912
* Added examples:
1013
* inbox
1114
* simple
1215
* blur
1316

14-
## [0.2.0] - Added support for BouncingScrollPhysics.
15-
16-
* Added support for `BouncingScrollPhysics` - ios default sroll physics
17-
* Improved readme
1817

1918

README.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
11
# Flutter Custom Refresh Indicator
22

3-
- [Flutter Custom Refresh Indicator](#flutter-custom-refresh-indicator)
4-
- [Examples:](#examples)
5-
- [Use of `SimpleIndicatorContainer` with `Icon` as child LINK](#use-of-simpleindicatorcontainer-with-icon-as-child-link)
6-
- [Envelope indicator](#envelope-indicator)
7-
- [Blur indicator](#blur-indicator)
8-
- [Getting started](#getting-started)
9-
- [`CustomRefreshIndicator`](#customrefreshindicator)
10-
- [Arguments](#arguments)
11-
- [`CustomRefreshIndicatorData`](#customrefreshindicatordata)
12-
- [Props](#props)
13-
- [`CustomRefreshIndicatorState`](#customrefreshindicatorstate)
14-
- [`idle`](#idle)
15-
- [`draging`](#draging)
16-
- [`armed`](#armed)
17-
- [`hiding`](#hiding)
18-
- [`loading`](#loading)
19-
20-
This package adds `CustomRefreshIndicator` widget that make it easy to implement custom refresh indicator.
21-
22-
## Examples:
3+
This package adds `CustomRefreshIndicator` widget that make it easy to implement your own custom refresh indicator.
4+
5+
## Example use:
6+
```dart
7+
CustomRefreshIndicator(
8+
// Your custom indicator builder
9+
indicatorBuilder: (context, data) => SimpleIndicatorContainer(
10+
data: data,
11+
child: SimpleIndicatorContent(data: data),
12+
),
13+
onRefresh: myAsyncRefreshMethod,
14+
// Your child scroll widget
15+
child: ListView.separated(
16+
itemBuilder: (BuildContext context, int index) => const SizedBox(
17+
height: 100,
18+
),
19+
separatorBuilder: (BuildContext context, int index) =>
20+
const SizedBox(height: 20),
21+
),
22+
)
23+
```
24+
25+
## Working examples:
2326

2427
### Use of `SimpleIndicatorContainer` with `Icon` as child [LINK](example/lib/indicators/simple_indicator.dart)
2528
![simple_indicator](readme/simple_container.gif)
2629

27-
### [Envelope indicator](https://pub.dev/packages/letter_refresh_indicator)
30+
### Envelope indicator
2831
![letter_indicator](readme/letter_indicator.gif)
2932

30-
### [Blur indicator](example/lib/indicators/blur_indicator.dart)
31-
![blur_indicator](readme/blur_indicator.gif)
32-
3333
## Getting started
3434

3535
### `CustomRefreshIndicator`
36-
`CustomRefreshIndicator` is not the same as the` RefreshIndicator` widget. It has an absolute minimum functionality that allows you to create and set your own custom indicators.
36+
`CustomRefreshIndicator` has an absolute minimum functionality that allows you to create and set your own custom indicators.
3737

3838
#### Arguments
39-
| Argument | type | default value | required |
40-
| :--- | :--- | :---| :--- |
41-
| child | `Widget` | --- | true | |
42-
| onRefresh | `Future<void> Function()` | --- | true | |
43-
| indicatorBuilder | `Widget Function(BuildContext, CustomRefreshIndicatorData)` | --- | true | |
44-
| dragingToIdleDuration | `Duration` | `Duration(milliseconds: 300)` | false | |
45-
| armedToLoadingDuration | `Duration` | `Duration(milliseconds: 200)` | false | |
46-
| loadingToIdleDuration | `Duration` | `Duration(milliseconds: 100)` | false | |
47-
| leadingGlowVisible | `bool` | `false` | false | |
48-
| trailingGlowVisible | `bool` | `true` | false | |
49-
39+
| Argument | Type | Default value | Required |
40+
| :---------------------------------- | :-------------------------------------------------------------- | :----------------------------- | :---------------- |
41+
| child | `Widget` | none | true |
42+
| onRefresh | `Future<void> Function()` | none | true |
43+
| indicatorBuilder | `Widget Function(BuildContext, CustomRefreshIndicatorData) ` | none | true |
44+
| dragingToIdleDuration | `Duration` | `Duration(milliseconds: 300)` | false |
45+
| armedToLoadingDuration | `Duration` | `Duration(milliseconds: 200)` | false |
46+
| loadingToIdleDuration      | `Duration` | `Duration(milliseconds: 100)` | false |
47+
| leadingGlowVisible          | `bool` | `false` | false |
48+
| trailingGlowVisible          | `bool` | `true` | false |
5049

5150

5251
### `CustomRefreshIndicatorData`
@@ -55,7 +54,7 @@ Object containig data provided by `CustomRefreshIndicator`.
5554
#### Props
5655

5756
| prop | type |
58-
|--------------------|-------------------------------|
57+
| :----------------- | :---------------------------- |
5958
| value | `double` |
6059
| direction | `AxisDirection` |
6160
| scrollingDirection | `ScrollDirection` |
@@ -78,12 +77,12 @@ Enum which describes state of CustomRefreshIndicator.
7877
`CustomRefreshIndicator` is armed ending the scroll **WILL** result in:
7978
- `CustomRefreshIndicator.onRefresh` call
8079
- change of status to `loading`
81-
- decreasing `CustomRefreshIndicatorData.value` to `1` in duration specified by `CustomRefreshIndicator.armedToLoadingDuration`)
80+
- decreasing `CustomRefreshIndicatorData.value` to `1` in duration specified by `CustomRefreshIndicator.armedToLoadingDuration`)
8281

8382
(`CustomRefreshIndicatorData.value >= 1`)
8483

8584
#### `hiding`
86-
`CustomRefreshIndicator` is hiding indicator when `onRefresh` future is resolved or indicator was canceled (scroll ended when [CustomRefreshIndicatorState] was equal to `dragging` so `value` was less than `1` or the user started scrolling through the list)
85+
CustomRefreshIndicator is hiding indicator when `onRefresh` future is resolved or indicator was canceled (scroll ended when [CustomRefreshIndicatorState] was equal to `dragging` so `value` was less than `1` or the user started scrolling through the list)
8786

8887
(`CustomRefreshIndicatorData.value` decreases to `0` in duration specified by `CustomRefreshIndicator.dragingToIdleDuration`)
8988

example/.gitignore

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,50 +24,14 @@
2424
**/doc/api/
2525
.dart_tool/
2626
.flutter-plugins
27+
.flutter-plugins-dependencies
2728
.packages
2829
.pub-cache/
2930
.pub/
3031
/build/
3132

32-
# Android related
33-
**/android/**/gradle-wrapper.jar
34-
**/android/.gradle
35-
**/android/captures/
36-
**/android/gradlew
37-
**/android/gradlew.bat
38-
**/android/local.properties
39-
**/android/**/GeneratedPluginRegistrant.java
40-
41-
# iOS/XCode related
42-
**/ios/**/*.mode1v3
43-
**/ios/**/*.mode2v3
44-
**/ios/**/*.moved-aside
45-
**/ios/**/*.pbxuser
46-
**/ios/**/*.perspectivev3
47-
**/ios/**/*sync/
48-
**/ios/**/.sconsign.dblite
49-
**/ios/**/.tags*
50-
**/ios/**/.vagrant/
51-
**/ios/**/DerivedData/
52-
**/ios/**/Icon?
53-
**/ios/**/Pods/
54-
**/ios/**/.symlinks/
55-
**/ios/**/profile
56-
**/ios/**/xcuserdata
57-
**/ios/.generated/
58-
**/ios/Flutter/App.framework
59-
**/ios/Flutter/Flutter.framework
60-
**/ios/Flutter/Generated.xcconfig
61-
**/ios/Flutter/app.flx
62-
**/ios/Flutter/app.zip
63-
**/ios/Flutter/flutter_assets/
64-
**/ios/Flutter/flutter_export_environment.sh
65-
**/ios/ServiceDefinitions.json
66-
**/ios/Runner/GeneratedPluginRegistrant.*
33+
# Web related
34+
lib/generated_plugin_registrant.dart
6735

6836
# Exceptions to above rules.
69-
!**/ios/**/default.mode1v3
70-
!**/ios/**/default.mode2v3
71-
!**/ios/**/default.pbxuser
72-
!**/ios/**/default.perspectivev3
7337
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

example/.metadata

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 68587a0916366e9512a78df22c44163d041dd5f3
7+
revision: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
88
channel: stable
99

1010
project_type: app

example/android/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java

example/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ android {
4343
targetSdkVersion 28
4444
versionCode flutterVersionCode.toInteger()
4545
versionName flutterVersionName
46-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
46+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4747
}
4848

4949
buildTypes {
@@ -62,6 +62,6 @@ flutter {
6262
dependencies {
6363
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6464
testImplementation 'junit:junit:4.12'
65-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
66-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
65+
androidTestImplementation 'androidx.test:runner:1.1.1'
66+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
6767
}
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.example.example">
3-
43
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
54
calls FlutterMain.startInitialization(this); in its onCreate method.
65
In most cases you can leave this as-is, but you if you want to provide
@@ -14,20 +13,18 @@
1413
android:name=".MainActivity"
1514
android:launchMode="singleTop"
1615
android:theme="@style/LaunchTheme"
17-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1817
android:hardwareAccelerated="true"
1918
android:windowSoftInputMode="adjustResize">
20-
<!-- This keeps the window background of the activity showing
21-
until Flutter renders its first frame. It can be removed if
22-
there is no splash screen (such as the default splash screen
23-
defined in @style/LaunchTheme). -->
24-
<meta-data
25-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
26-
android:value="true" />
2719
<intent-filter>
2820
<action android:name="android.intent.action.MAIN"/>
2921
<category android:name="android.intent.category.LAUNCHER"/>
3022
</intent-filter>
3123
</activity>
24+
<!-- Don't delete the meta-data below.
25+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
26+
<meta-data
27+
android:name="flutterEmbedding"
28+
android:value="2" />
3229
</application>
3330
</manifest>
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package com.example.example
22

3-
import android.os.Bundle
4-
5-
import io.flutter.app.FlutterActivity
3+
import androidx.annotation.NonNull;
4+
import io.flutter.embedding.android.FlutterActivity
5+
import io.flutter.embedding.engine.FlutterEngine
66
import io.flutter.plugins.GeneratedPluginRegistrant
77

88
class MainActivity: FlutterActivity() {
9-
override fun onCreate(savedInstanceState: Bundle?) {
10-
super.onCreate(savedInstanceState)
11-
GeneratedPluginRegistrant.registerWith(this)
12-
}
9+
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10+
GeneratedPluginRegistrant.registerWith(flutterEngine);
11+
}
1312
}

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.71'
2+
ext.kotlin_version = '1.3.50'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.1'
9+
classpath 'com.android.tools.build:gradle:3.5.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/android/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true

0 commit comments

Comments
 (0)