Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added additional reverse list support #78

Open
wants to merge 33 commits into
base: feature/reverse
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
551a387
Updated error message formats
ened May 18, 2019
25a71e3
Updated SDK constraint to support new error message formats
ened May 18, 2019
1a0d8f6
Match latest SliverHitTest APIs
ened May 19, 2019
b2f5cd1
Merge pull request #26 from ened/flutter-1.6.0
letsar May 23, 2019
6673542
Update README.md
letsar Jul 10, 2019
2d7f2b1
Added not sticky feature
letsar Feb 14, 2020
f92f326
Removing author from pubspec
letsar Feb 14, 2020
44711e2
Add a controller which can be used to know the offset of the current …
letsar Feb 21, 2020
e388fb4
Create FUNDING.yml
letsar Jun 4, 2020
d24aa6c
Update FUNDING.yml
letsar Jun 25, 2020
e9ee3a0
Fixes static analysis issues
letsar Jul 21, 2020
c6676d2
Formatting
letsar Jul 21, 2020
fb4c23f
update version
letsar Jul 21, 2020
cd7dd40
Fixes null references issues on debug
letsar Jul 25, 2020
20456eb
Add a dependency to value_layout_builder
letsar Aug 29, 2020
b2f00df
changed the minimum version of Flutter
letsar Sep 1, 2020
602d501
Migrate to null-safety
ThexXTURBOXx Mar 29, 2021
a95e2ff
Migrate example
ThexXTURBOXx Apr 7, 2021
11fbf0f
Update dependencies and bump version
ThexXTURBOXx Apr 7, 2021
af51daf
Lowered flutter requirement
ThexXTURBOXx Apr 10, 2021
97f2695
Resolve discussions
ThexXTURBOXx Apr 10, 2021
ea97f54
Merge pull request #58 from Femtopedia/master
letsar Apr 10, 2021
9aa3c58
Fixing null-safety error with SliverStickyHeaderState
amitkot Apr 22, 2021
3b532b5
Advancing version to 0.6.1
amitkot Apr 22, 2021
035f665
Merge pull request #63 from amitkot/master
letsar Mar 1, 2022
c2e5b3f
upgrade example android target
letsar Mar 1, 2022
605bc8c
fixes not sticky hit test
letsar May 10, 2022
f29a9b6
bump version 0.6.2
letsar May 10, 2022
b030be3
fixes issue #75
letsar May 25, 2022
8d571f5
fixes nested sticky headers
letsar Jul 13, 2022
c5f289a
added reverse
Jul 19, 2022
9446db7
added reverse
charlesRmajor Jul 19, 2022
f13c1df
added reverse
charlesRmajor Jul 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github: letsar
patreon: romainrastel
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.buymeacoffee.com/romainrastel', 'paypal.me/RomainRastel']
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
## 0.6.4
### Fixed
* Not passing right overlap contraints to sliver child. Now we can create nested sticky headers!

## 0.6.3
### Fixed
* Hit Test on not sticky header

## 0.6.2
### Fixed
* Hit Test on not sticky header

## 0.6.1
### Fixed
* Error due to null-safety migration.

## 0.6.0
### Changed
* Migrated to sound null-safety.
* Increase the minimum version of Flutter.
* Increase the minimum version of Dart SDK.

## 0.5.0
### Changed
* The minimum version of Flutter.

## 0.4.6
### Added
* A new SliverStickyHeader.builder constructor instead of the deprecated SliverStickyHeaderBuilder.
* A dependency to value_layout_builder in order to manage the SliverStickyHeader.builder.

### Removed
* Custom code to make SliverStickyHeader.builder work.

## 0.4.5
### Fixed
* Null references issues in debug mode.

## 0.4.4
### Fixed
* Static analysis issues.

## 0.4.3
### Fixed
* Static analysis issues.

## 0.4.2
### Added
* A StickyHeaderController to get the scroll offset of the current sticky header.

## 0.4.1
### Added
* A sticky parameter to specify whether the header is sticky or not.

## 0.4.0

* Updated SDK constraint to support new error message formats.
* Updated error message formats

## 0.3.4
### Removed
* Print call for headerPosition
Expand Down
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ A Flutter implementation of sticky headers with a sliver as a child.
* Notifies when the header scrolls outside the viewport.
* Can scroll in any direction.
* Supports overlapping (AppBars for example).
* Supports not sticky headers (with `sticky: false` parameter).
* Supports a controller which notifies the scroll offset of the current sticky header.

## Getting started

Expand All @@ -22,7 +24,7 @@ In the `pubspec.yaml` of your flutter project, add the following dependency:
```yaml
dependencies:
...
flutter_sticky_header: "^0.3.4"
flutter_sticky_header:
```

In your library add the following import:
Expand All @@ -38,57 +40,57 @@ For help getting started with Flutter, view the online [documentation](https://f
You can place one or multiple `SliverStickyHeader`s inside a `CustomScrollView`.

```dart
new SliverStickyHeader(
header: new Container(
SliverStickyHeader(
header: Container(
height: 60.0,
color: Colors.lightBlue,
padding: EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft,
child: new Text(
child: Text(
'Header #0',
style: const TextStyle(color: Colors.white),
),
),
sliver: new SliverList(
delegate: new SliverChildBuilderDelegate(
(context, i) => new ListTile(
leading: new CircleAvatar(
child: new Text('0'),
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(context, i) => ListTile(
leading: CircleAvatar(
child: Text('0'),
),
title: new Text('List tile #$i'),
title: Text('List tile #$i'),
),
childCount: 4,
),
),
);
```

## SliverStickyHeaderBuilder
## SliverStickyHeader.builder

If you want to change the header layout during its scroll, you can use the `SliverStickyHeaderBuilder`.
If you want to change the header layout during its scroll, you can use the `SliverStickyHeader.builder` constructor.

The example belows changes the opacity of the header as it scrolls off the viewport.

```dart
new SliverStickyHeaderBuilder(
builder: (context, state) => new Container(
SliverStickyHeader.builder(
builder: (context, state) => Container(
height: 60.0,
color: (state.isPinned ? Colors.pink : Colors.lightBlue)
.withOpacity(1.0 - state.scrollPercentage),
padding: EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft,
child: new Text(
child: Text(
'Header #1',
style: const TextStyle(color: Colors.white),
),
),
sliver: new SliverList(
delegate: new SliverChildBuilderDelegate(
(context, i) => new ListTile(
leading: new CircleAvatar(
child: new Text('0'),
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(context, i) => ListTile(
leading: CircleAvatar(
child: Text('0'),
),
title: new Text('List tile #$i'),
title: Text('List tile #$i'),
),
childCount: 4,
),
Expand All @@ -98,6 +100,10 @@ new SliverStickyHeaderBuilder(

You can find more examples in the [Example](https://github.com/letsar/flutter_sticky_header/tree/master/example) project.

## Sponsoring

I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me. By doing so, I will prioritize your issues or your pull-requests before the others.

## Changelog

Please see the [Changelog](https://github.com/letsar/flutter_sticky_header/blob/master/CHANGELOG.md) page to know what's recently changed.
Expand Down
41 changes: 38 additions & 3 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.dart_tool/
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

build/
# Web related
lib/generated_plugin_registrant.dart

.flutter-plugins
# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
6 changes: 4 additions & 2 deletions example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b
channel: dev
revision: bbfbf1770cca2da7c82e887e4e4af910034800b6
channel: stable

project_type: app
12 changes: 10 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ A new Flutter project.

## Getting Started

For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
19 changes: 11 additions & 8 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
*.iml
*.class
.gradle
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
41 changes: 29 additions & 12 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,43 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 27
compileSdkVersion flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

lintOptions {
disable 'InvalidPackage'
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.letsar.fsh.example.example"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
applicationId "com.letsar.sh.example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
Expand All @@ -45,7 +64,5 @@ flutter {
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
7 changes: 7 additions & 0 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.letsar.sh.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Loading