Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
thl committed Jun 3, 2019
1 parent 3cdb086 commit b8a1a0c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.2

* TODO: Open ScrollController, ScrollPhysics...

## 0.1.1

* TODO: fix IndexBar onTapUp.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ AzListView,Flutter 城市列表,联系人列表,自定义Header,索引

```yaml
dependencies:
azlistview: ^0.1.1 #latest version
azlistview: ^0.1.2 #latest version
```
### Example
Expand Down
28 changes: 21 additions & 7 deletions lib/src/az_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ class AzListView extends StatefulWidget {
this.data,
this.topData,
this.itemBuilder,
this.controller,
this.physics,
this.shrinkWrap = true,
this.padding = EdgeInsets.zero,
this.suspensionWidget,
this.isUseRealIndex: true,
this.itemHeight: 50,
this.suspensionHeight: 40,
this.isUseRealIndex = true,
this.itemHeight = 50,
this.suspensionHeight = 40,
this.onSusTagChanged,
this.header,
this.indexBarBuilder,
this.indexHintBuilder,
this.showIndexHint: true})
this.showIndexHint = true})
: assert(itemBuilder != null),
super(key: key);

Expand All @@ -51,6 +55,14 @@ class AzListView extends StatefulWidget {

final ItemWidgetBuilder itemBuilder;

final ScrollController controller;

final ScrollPhysics physics;

final bool shrinkWrap;

final EdgeInsetsGeometry padding;

///suspension widget.
final Widget suspensionWidget;

Expand Down Expand Up @@ -92,12 +104,12 @@ class _AzListViewState extends State<AzListView> {
@override
void initState() {
super.initState();
_scrollController = ScrollController();
_scrollController = widget.controller ?? ScrollController();
}

@override
void dispose() {
_scrollController.dispose();
_scrollController?.dispose();
super.dispose();
}

Expand Down Expand Up @@ -146,7 +158,9 @@ class _AzListViewState extends State<AzListView> {
data: widget.header == null ? _cityList : _cityList.sublist(1),
contentWidget: ListView.builder(
controller: _scrollController,
shrinkWrap: true,
physics: widget.physics,
shrinkWrap: widget.shrinkWrap,
padding: widget.padding,
itemCount: _cityList.length,
itemBuilder: (BuildContext context, int index) {
if (index == 0 && _cityList[index] is _Header) {
Expand Down
12 changes: 6 additions & 6 deletions lib/src/index_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const List<String> INDEX_DATA_DEF = const [
class IndexBar extends StatefulWidget {
IndexBar(
{Key key,
this.data: INDEX_DATA_DEF,
this.data = INDEX_DATA_DEF,
@required this.onTouch,
this.width: 30,
this.itemHeight: 16,
this.width = 30,
this.itemHeight = 16,
this.color = Colors.transparent,
this.textStyle =
const TextStyle(fontSize: 12.0, color: Color(0xFF666666)),
Expand Down Expand Up @@ -137,10 +137,10 @@ class _IndexBar extends StatefulWidget {

_IndexBar(
{Key key,
this.data: INDEX_DATA_DEF,
this.data = INDEX_DATA_DEF,
@required this.onTouch,
this.width: 30,
this.itemHeight: 16,
this.width = 30,
this.itemHeight = 16,
this.textStyle,
this.touchDownTextStyle})
: assert(onTouch != null),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/suspension_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class SuspensionView extends StatefulWidget {
@required this.contentWidget,
@required this.suspensionWidget,
@required this.controller,
this.suspensionHeight: 40,
this.itemHeight: 50,
this.suspensionHeight = 40,
this.itemHeight = 50,
this.onSusTagChanged,
this.onSusSectionInited,
this.header,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: azlistview
description: AzListView, SuspensionView, IndexBar. like as citylist, contactlist. index and hover effect.
version: 0.1.1
version: 0.1.2
authors:
- "wendux<[email protected]>"
- "sky24n<[email protected]>"
Expand Down

0 comments on commit b8a1a0c

Please sign in to comment.