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

add separatorBuilder #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 38 additions & 38 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ packages:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.8.2"
azlistview:
dependency: "direct main"
description:
Expand All @@ -19,77 +19,77 @@ packages:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
common_utils:
dependency: "direct main"
description:
name: common_utils
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
decimal:
dependency: transitive
description:
name: decimal
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.3.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
flutter:
Expand All @@ -115,42 +115,42 @@ packages:
dependency: "direct main"
description:
name: lpinyin
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.3"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.2.1"
scrollable_positioned_list:
dependency: transitive
description:
name: scrollable_positioned_list
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0-nullsafety.0"
sky_engine:
Expand All @@ -162,56 +162,56 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.4.3"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
sdks:
Expand Down
5 changes: 5 additions & 0 deletions lib/src/az_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class AzListView extends StatefulWidget {
required this.data,
required this.itemCount,
required this.itemBuilder,
this.separatorBuilder,
this.itemScrollController,
this.itemPositionsListener,
this.physics,
Expand All @@ -29,6 +30,9 @@ class AzListView extends StatefulWidget {
this.indexBarOptions = const IndexBarOptions(),
}) : super(key: key);

/// Separator builder from ListView.builder
final IndexedWidgetBuilder? separatorBuilder;

/// with ISuspensionBean Data
final List<ISuspensionBean> data;

Expand Down Expand Up @@ -182,6 +186,7 @@ class _AzListViewState extends State<AzListView> {
data: widget.data,
itemCount: widget.itemCount,
itemBuilder: widget.itemBuilder,
separatorBuilder: widget.separatorBuilder,
itemScrollController: itemScrollController,
itemPositionsListener: itemPositionsListener,
susItemBuilder: widget.susItemBuilder,
Expand Down
7 changes: 6 additions & 1 deletion lib/src/suspension_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class SuspensionView extends StatefulWidget {
required this.data,
required this.itemCount,
required this.itemBuilder,
this.separatorBuilder,
this.itemScrollController,
this.itemPositionsListener,
this.susItemBuilder,
Expand All @@ -21,6 +22,9 @@ class SuspensionView extends StatefulWidget {
this.padding,
}) : super(key: key);

/// Separator builder from ListView.builder
final IndexedWidgetBuilder? separatorBuilder;

/// Suspension data.
final List<ISuspensionBean> data;

Expand Down Expand Up @@ -150,7 +154,8 @@ class _SuspensionViewState extends State<SuspensionView> {
children: <Widget>[
widget.itemCount == 0
? Container()
: ScrollablePositionedList.builder(
: ScrollablePositionedList.separated(
separatorBuilder: widget.separatorBuilder,
itemCount: widget.itemCount,
itemBuilder: (context, index) => _buildItem(context, index),
itemScrollController: itemScrollController,
Expand Down
Loading