Skip to content

Commit

Permalink
Merge pull request #41 from TatsuUkraine/release-3.0.0
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
TatsuUkraine authored Aug 5, 2020
2 parents 7a9571e + 5f389a2 commit 4b916c6
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 70 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

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

# Android related
**/android/**/gradle-wrapper.jar
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
## [3.0.0] - 2020-08-05

- stable v3 release

## [2.1.0+3] - 2020-07-26

- added reference to v3 version to docs

## [3.0.0-dev.2] - 2020-07-26

- define min flutter version

## [3.0.0-dev.1] - 2020-07-26

- update widget params according to current beta/dev Flutter changes

## [2.1.0+2] - 2020-07-15

- code format updates
Expand Down
14 changes: 14 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,17 @@ to calculate appropriate item size.

`initialHeaderBuild` is still available in `overlay` constructors and
affects header render like it was before in v1.x.x

## Migration From v2.x.x to v3.x.x

### Render object constructor changes

In newer Flutter versions key `overflow` in `Stack` widgets and render
objects was replaced with `clipBehavior`.

Since `StickyListItemRenderObject` inherits `RenderStack`, sticky header
render object also was updated due to changes in Flutters render object.

So if you use `StickyListItemRenderObject` ensure to replace `overflow`
param with `clipBehavior`. By default it's `Clip.hardEdge`, according to
default `overflow` key, which was `Overflow.clip` by default
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ benefits for performance that Flutter provides.
- dynamic header build on content scroll
- dynamic min offset calculation on content scroll

## Flutter before 1.20

If you're using Flutter version lower than 1.20 consider using v2.x.x.

## Migration guide

If you using older MAJOR versions, please
Expand Down Expand Up @@ -596,7 +600,7 @@ in [Reverse infinite scroll](#reverse-infinite-scroll)

## Flutter version related errors

### Named parameter overflow isn't defined error
### Named parameter clipBehavior isn't defined error

If you get this kind of error, most likely you are using beta or dev
Flutter channel. If so, please ensure that you're using 3.x.x version.
If you get this kind of error, most likely you are using Flutter 1.17.
If so, please ensure that you're using 2.x.x version.
8 changes: 4 additions & 4 deletions lib/render.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class StickyListItemRenderObject<I> extends RenderStack {
MinOffsetProvider<I> minOffsetProvider,
StreamSink<StickyState<I>> streamSink,
TextDirection textDirection,
Overflow overflow,
Clip clipBehavior = Clip.hardEdge,
bool overlayContent,
HeaderPositionAxis positionAxis = HeaderPositionAxis.mainAxis,
HeaderMainAxisAlignment mainAxisAlignment = HeaderMainAxisAlignment.start,
Expand All @@ -47,7 +47,7 @@ class StickyListItemRenderObject<I> extends RenderStack {
scrollable, mainAxisAlignment, crossAxisAlignment),
textDirection: textDirection,
fit: StackFit.loose,
overflow: overflow,
clipBehavior: clipBehavior,
);

StreamSink<StickyState<I>> get streamSink => _streamSink;
Expand Down Expand Up @@ -142,9 +142,9 @@ class StickyListItemRenderObject<I> extends RenderStack {
void paint(PaintingContext context, Offset paintOffset) {
updateHeaderOffset();

if (overflow == Overflow.clip && _headerOverflow) {
if (clipBehavior != Clip.none && _headerOverflow) {
context.pushClipRect(
needsCompositing, paintOffset, Offset.zero & size, paintStack);
needsCompositing, paintOffset, Offset.zero & size, paintStack, clipBehavior: clipBehavior);
} else {
paintStack(context, paintOffset);
}
Expand Down
8 changes: 5 additions & 3 deletions lib/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ class StickyListItem<I> extends Stack {
this.mainAxisAlignment = HeaderMainAxisAlignment.start,
this.crossAxisAlignment = HeaderCrossAxisAlignment.start,
this.positionAxis = HeaderPositionAxis.mainAxis,
Clip clipBehavior: Clip.hardEdge,
Key key,
}) : overlayContent = false,
assert(
Expand All @@ -454,7 +455,7 @@ class StickyListItem<I> extends Stack {
super(
key: key,
children: [content, header],
overflow: Overflow.clip,
clipBehavior: clipBehavior,
);

/// Default sticky item constructor with overlayed header positioning.
Expand All @@ -468,13 +469,14 @@ class StickyListItem<I> extends Stack {
this.streamSink,
this.mainAxisAlignment = HeaderMainAxisAlignment.start,
this.crossAxisAlignment = HeaderCrossAxisAlignment.start,
Clip clipBehavior: Clip.hardEdge,
Key key,
}) : overlayContent = true,
positionAxis = HeaderPositionAxis.mainAxis,
super(
key: key,
children: [content, header],
overflow: Overflow.clip,
clipBehavior: clipBehavior,
);

ScrollableState _getScrollableState(BuildContext context) =>
Expand All @@ -489,7 +491,7 @@ class StickyListItem<I> extends Stack {
positionAxis: positionAxis,
textDirection: textDirection ?? Directionality.of(context),
overlayContent: overlayContent,
overflow: overflow,
clipBehavior: clipBehavior,
itemIndex: itemIndex,
streamSink: streamSink,
minOffsetProvider: minOffsetProvider,
Expand Down
82 changes: 24 additions & 58 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,62 +1,55 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.4.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
clock:
dependency: transitive
description:
name: collection
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.0.1"
collection:
dependency: transitive
description:
name: convert
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.14.13"
fake_async:
dependency: transitive
description:
name: crypto
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -67,20 +60,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.8"
meta:
dependency: transitive
description:
Expand All @@ -94,21 +80,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "1.7.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -127,7 +99,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.9.5"
stream_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -155,27 +127,21 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.17"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.2.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
sdks:
dart: ">=2.6.0 <3.0.0"
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.20.0"
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ description: >-
Can be customized or with config options or with override.
version: 2.1.0+3
version: 3.0.0
homepage: https://github.com/TatsuUkraine/flutter_sticky_infinite_list
repository: https://github.com/TatsuUkraine/flutter_sticky_infinite_list
issue_tracker: https://github.com/TatsuUkraine/flutter_sticky_infinite_list/issues

environment:
sdk: ">=2.1.0 <3.0.0"
flutter: ">=1.20.0"

dependencies:
flutter:
Expand Down

0 comments on commit 4b916c6

Please sign in to comment.