-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge See merge request tech_client/scroll_kit!3
- Loading branch information
Showing
34 changed files
with
6,388 additions
and
729 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## 0.0.1 | ||
## 1.0.0 | ||
|
||
* TODO: Describe initial release. | ||
- [✓] JumpTo(int index) | ||
- [✓] ScrollTo(int index) | ||
- [✓] Load list content from both leading and trailing direction. | ||
- [✓] Reuse Element and RenderObject of list item. | ||
- [✓] Provide life-cycle callbacks of list item. | ||
- [✓] Load more list items without refreshing the whole list. | ||
- [✓] Provides compatibility with refresh components(SmartRefresher). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Contributing | ||
|
||
Thank you for your interest in open source contributions. | ||
Not only the code, but also contributions such as issues and rich documents are also welcome. | ||
|
||
Please follow the guidelines in this article to make open source contributions to the UME project. | ||
|
||
- [Contributing](#contributing) | ||
- [How to contact author](#how-to-contact-author) | ||
- [How to raise an Issue](#how-to-raise-an-issue) | ||
- [How to raise a Pull Request](#how-to-raise-a-pull-request) | ||
- [Commit Message specification](#commit-message-specification) | ||
|
||
## How to contact author | ||
|
||
**Maybe...** | ||
|
||
- Found a bug in the code, or an error in the documentation | ||
- Produces an exception when you use the UME | ||
- UME is not compatible with the new version Flutter | ||
- Have a good idea or suggestion | ||
|
||
You can [submit an issue](#how-to-raise-an-issue) in any of the above situations。 | ||
|
||
**Maybe...** | ||
|
||
- Communicate with the author | ||
- Communicate with more community developers | ||
- Cooperate with UME | ||
|
||
Welcome to [Join the ByteDance Flutter Exchange Group](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=b07u55bb-68f0-4a4b-871d-687637766a68). | ||
|
||
Or contact [author](mailto:[email protected]). | ||
|
||
## How to raise an Issue | ||
|
||
1. Go to Issues. | ||
2. Search for similar situations, if there is a match, directly feedback in it. | ||
3. If there is not, press New issue to raise a new one. | ||
4. Select a template. | ||
5. Describe your situation, and fill in the template. | ||
6. It is better to attach a demo that can reproduce the problem. | ||
|
||
## How to raise a Pull Request | ||
|
||
1. Fork the repository. | ||
2. Clone your fork repository. | ||
3. Checkout to the correct develop branch, and then create a new brnach based on the develop branch. | ||
4. Edit code. | ||
5. Edit test code in example project, and test it manually. | ||
6. Edit unit test in test directory. | ||
7. Commit your changes and push it. Please follow the [Commit Message specification](#commit-message-specification) to write the commit message. | ||
8. Create Pull Request in GitHub, and fill in the template. | ||
|
||
## Commit Message specification | ||
|
||
1. Please use english. | ||
2. If you have references, please attach a link. | ||
3. Format: `[tags] description` | ||
1. `tags` is the type of PR, such as `fix`, `feat`, `improve`. | ||
2. `description` is used to describe changes. | ||
|
||
The following is a standard Commit message example: | ||
|
||
``` plaintext | ||
[fix] README.md document syntax error | ||
``` | ||
|
||
``` plaintext | ||
[feat] New feature description | ||
[https://flutter.dev/dash](https://flutter.dev/dash) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,65 @@ | ||
TODO: Add your license here. | ||
MIT License | ||
|
||
Copyright (c) 2022 ByteDance Inc. | ||
|
||
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. | ||
|
||
MIT License | ||
|
||
Copyright (c) 2019 Quire | ||
|
||
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. | ||
|
||
MIT License | ||
|
||
Copyright (c) 2018 Jpeng | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,66 @@ | ||
<!-- | ||
This README describes the package. If you publish this package to pub.dev, | ||
this README's contents appear on the landing page for your package. | ||
scroll_kit | ||
--- | ||
|
||
For information about how to write a good package README, see the guide for | ||
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages). | ||
For general information about developing packages, see the Dart guide for | ||
[creating packages](https://dart.dev/guides/libraries/create-library-packages) | ||
and the Flutter guide for | ||
[developing packages and plugins](https://flutter.dev/developing-packages). | ||
--> | ||
|
||
TODO: Put a short description of the package here that helps potential users | ||
know whether this package might be useful for them. | ||
ScrollKit provides additional features for list in Flutter Apps. | ||
|
||
## Features | ||
|
||
TODO: List what your package can do. Maybe include images, gifs, or videos. | ||
- [✓] JumpTo(int index). | ||
- [✓] ScrollTo(int index). | ||
- [✓] Load list content from both leading and trailing direction. | ||
- [✓] Reuse the Element and RenderObject of list item. | ||
- [✓] Provide life-cycle callbacks of list item. | ||
- [✓] Load more list items without refreshing the whole list. | ||
- [✓] Provides JumpTo, ScrollTo with compatibility of refresh components(SmartRefresher). | ||
|
||
## Getting started | ||
|
||
TODO: List prerequisites and provide or point to information on how to | ||
start using the package. | ||
```yaml | ||
scroll_kit: ^1.0.0 | ||
``` | ||
## Usage | ||
TODO: Include short and useful examples for package users. Add longer examples | ||
to `/example` folder. | ||
|
||
```dart | ||
const like = 'sample'; | ||
final scrollView = CustomScrollView( | ||
slivers: [ | ||
SKSliverList( | ||
delegate: SKSliverChildBuilderDelegate((c, i) { | ||
if (i % 2 == 0) { | ||
return Container( | ||
height: 100, | ||
child: Text(i.toString()), | ||
color: Colors.grey, | ||
margin: EdgeInsets.only(top: 3), | ||
); | ||
} else { | ||
return Container( | ||
height: 100, | ||
child: Text(i.toString()), | ||
color: Colors.red, | ||
margin: EdgeInsets.only(top: 3), | ||
); | ||
} | ||
}, onAppear: (i) { | ||
print("Appear: " + i.toString()); | ||
}, onDisAppear: (i) { | ||
print("Disappear: " + i.toString()); | ||
}, reuseIdentifier: (i) { | ||
if (i % 2 == 0) { | ||
return "type1"; | ||
} else { | ||
return "type2"; | ||
} | ||
}, childCount: 100)) | ||
], | ||
); | ||
``` | ||
|
||
## Additional information | ||
## Reference | ||
- [scroll_to_index](https://pub.dev/packages/scroll_to_index) | ||
- [pull_to_refresh](https://pub.dev/packages/pull_to_refresh) | ||
|
||
TODO: Tell users more about the package: where to find more information, how to | ||
contribute to the package, how to file issues, what response they can expect | ||
from the package authors, and more. | ||
## Contributing | ||
- This project is licensed under the MIT License. | ||
- Welcome to [Join the ByteDance Flutter Exchange Group](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=b07u55bb-68f0-4a4b-871d-687637766a68). | ||
- Any questions or suggestions, please feel free to contact me at [email protected]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (2022) Bytedance Inc. | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:scroll_kit/scroll_kit.dart'; | ||
|
||
class LifeCyclePage extends StatefulWidget { | ||
const LifeCyclePage({super.key}); | ||
@override | ||
State<StatefulWidget> createState() { | ||
return LifeCyclePageState(); | ||
} | ||
} | ||
|
||
class LifeCyclePageState extends State<LifeCyclePage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
final scrollView = CustomScrollView( | ||
slivers: [ | ||
SKSliverList( | ||
delegate: SKSliverChildBuilderDelegate((c, i) { | ||
if (i % 2 == 0) { | ||
return Container( | ||
height: 100, | ||
child: Text(i.toString()), | ||
color: Colors.grey, | ||
margin: EdgeInsets.only(top: 3), | ||
); | ||
} else { | ||
return Container( | ||
height: 100, | ||
child: Text(i.toString()), | ||
color: Colors.red, | ||
margin: EdgeInsets.only(top: 3), | ||
); | ||
} | ||
}, onAppear: (i) { | ||
print("Appear: $i"); | ||
}, onDisAppear: (i) { | ||
print("Disappear: $i"); | ||
}, reuseIdentifier: (i) { | ||
if (i % 2 == 0) { | ||
return "type1"; | ||
} else { | ||
return "type2"; | ||
} | ||
}, childCount: 100)) | ||
], | ||
); | ||
return Scaffold(appBar: AppBar(title: Text("LifeCycle")), body: scrollView); | ||
} | ||
} |
Oops, something went wrong.