Skip to content

Commit c2e95b6

Browse files
committed
fix bugs on Flutter 1.17.0
1 parent 71202f6 commit c2e95b6

File tree

9 files changed

+20
-30
lines changed

9 files changed

+20
-30
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.2.1
2+
- fix bugs on Flutter 1.17.0.
3+
14
## 0.2.0
25
- import widgets.dart instead of material.dart
36
- fix some bugs.

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# sticky_and_expandable_list
2-
32
Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView.
43

54
[![Pub](https://img.shields.io/pub/v/sticky_and_expandable_list.svg)](https://pub.dartlang.org/packages/sticky_and_expandable_list)
@@ -9,10 +8,10 @@ README i18n:[中文说明](https://github.com/tp7309/flutter_sticky_and_expandab
98

109
## Features
1110

12-
- Build a grouped list, which can expand/collapse section or sticky section header.
11+
- Build a grouped list, which support expand/collapse section and sticky header.
1312
- Use it with CustomScrollView、SliverAppBar.
1413
- Listen the scroll offset of current sticky header, current sticky header index and switching header index.
15-
- Only use one list widget, so it supports large data and a small memory usage.
14+
- Only use one list widget, so it supports large data and a normal memory usage.
1615
- More section customization support, you can return a new section widget by sectionBuilder, to customize background,expand/collapse animation, section layout, and so on.
1716
- Support add divider.
1817

@@ -22,7 +21,7 @@ In the `pubspec.yaml` of your flutter project, add the following dependency:
2221

2322
```yaml
2423
dependencies:
25-
sticky_and_expandable_list: ^0.2.0
24+
sticky_and_expandable_list: ^0.2.1
2625
```
2726
2827
## Basic Usage
@@ -56,7 +55,7 @@ dependencies:
5655

5756
```dart
5857
setState(() {
59-
section.setSectionExpanded(true);
58+
sectionList[i].setSectionExpanded(true);
6059
});
6160
```
6261

README_zh_CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sticky_and_expandable_list
22

3-
可拆叠列表的 Flutter 实现,支持固定组标题,可以与 Sliver 家族控件配合使用。
3+
可拆叠列表的 Flutter 实现,支持粘性头部,可以与 Sliver 家族控件配合使用。
44

55
[![Pub](https://img.shields.io/pub/v/sticky_and_expandable_list.svg)](https://pub.dartlang.org/packages/sticky_and_expandable_list)
66

@@ -21,7 +21,7 @@
2121

2222
```yaml
2323
dependencies:
24-
sticky_and_expandable_list: ^0.2.0
24+
sticky_and_expandable_list: ^0.2.1
2525
```
2626
2727
## 基础使用示例
@@ -55,7 +55,7 @@ dependencies:
5555

5656
```dart
5757
setState(() {
58-
section.setSectionExpanded(true);
58+
sectionList[i].setSectionExpanded(true);
5959
});
6060
```
6161

doc/images/sliverlist.gif

-2.16 MB
Loading
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.sshine.expandablelist.example
22

3-
import android.support.annotation.NonNull;
43
import io.flutter.embedding.android.FlutterActivity
54
import io.flutter.embedding.engine.FlutterEngine
65
import io.flutter.plugins.GeneratedPluginRegistrant
76

87
class MainActivity: FlutterActivity() {
9-
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
8+
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
109
GeneratedPluginRegistrant.registerWith(flutterEngine);
1110
}
1211
}

example/ios/Runner.xcodeproj/project.pbxproj

+1-13
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1412
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1713
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1814
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1915
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -26,8 +22,6 @@
2622
dstPath = "";
2723
dstSubfolderSpec = 10;
2824
files = (
29-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
30-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
3125
);
3226
name = "Embed Frameworks";
3327
runOnlyForDeploymentPostprocessing = 0;
@@ -38,13 +32,11 @@
3832
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3933
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4034
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
41-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4235
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4336
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4437
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4538
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
4639
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
47-
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
4840
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4941
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
5042
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -57,8 +49,6 @@
5749
isa = PBXFrameworksBuildPhase;
5850
buildActionMask = 2147483647;
5951
files = (
60-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
61-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
6252
);
6353
runOnlyForDeploymentPostprocessing = 0;
6454
};
@@ -68,9 +58,7 @@
6858
9740EEB11CF90186004384FC /* Flutter */ = {
6959
isa = PBXGroup;
7060
children = (
71-
3B80C3931E831B6300D905FE /* App.framework */,
7261
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
73-
9740EEBA1CF902C7004384FC /* Flutter.framework */,
7462
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7563
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
7664
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -201,7 +189,7 @@
201189
);
202190
runOnlyForDeploymentPostprocessing = 0;
203191
shellPath = /bin/sh;
204-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
192+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
205193
};
206194
9740EEB61CF901F6004384FC /* Run Script */ = {
207195
isa = PBXShellScriptBuildPhase;

lib/src/expandable_section_container.dart

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'package:flutter/rendering.dart';
44
import 'package:flutter/widgets.dart';
55
import '../sticky_and_expandable_list.dart';
66

7-
87
///Section widget information.
98
class ExpandableSectionContainerInfo {
109
Widget header;
@@ -301,7 +300,7 @@ class RenderExpandableSectionContainer extends RenderBox
301300
double maxScrollOffset = minScrollOffset + size.height;
302301

303302
//when [ExpandableSectionContainer] size changed, SliverList may give a wrong
304-
// layoutOffset at first tim, so check offsets for store right layoutOffset
303+
// layoutOffset at first time, so check offsets for store right layoutOffset
305304
// in [containerOffsets].
306305
if (_listIndex < _controller.containerOffsets.length) {
307306
currContainerOffset = _controller.containerOffsets[_listIndex];
@@ -379,8 +378,10 @@ class RenderExpandableSectionContainer extends RenderBox
379378
while (_controller.containerOffsets.length <= containerParentData.index) {
380379
_controller.containerOffsets.add(0);
381380
}
382-
_controller.containerOffsets[containerParentData.index] =
383-
containerParentData.layoutOffset;
381+
if (containerParentData.layoutOffset != null) {
382+
_controller.containerOffsets[containerParentData.index] =
383+
containerParentData.layoutOffset;
384+
}
384385
});
385386
}
386387

lib/src/sliver_expandable_list.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SliverExpandableChildDelegate<T, S extends ExpandableListSection<T>> {
5959
///sliver list builder
6060
SliverChildBuilderDelegate delegate;
6161

62-
///when section is collapsed, all child widget in content widget will be removed.
62+
///if value is true, when section is collapsed, all child widget in section widget will be removed.
6363
bool removeItemsOnCollapsed = true;
6464

6565
SliverExpandableChildDelegate(

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sticky_and_expandable_list
2-
description: Build a grouped list, which can expand/collapse section or sticky header, support use it with sliver widget.
3-
version: 0.2.0
2+
description: Build a grouped list, which support expand/collapse section and sticky header, support use it with sliver widget.
3+
version: 0.2.1
44
homepage: https://github.com/tp7309/flutter_sticky_and_expandable_list
55
issue_tracker: https://github.com/tp7309/flutter_sticky_and_expandable_list/issues
66

0 commit comments

Comments
 (0)