Skip to content

Commit

Permalink
- fix: EasyPaging.itemBuilder type inference (#762).
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelongqy committed Dec 29, 2023
1 parent f0dcfe3 commit b2b5eaa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Next
- fix: EasyPaging.itemBuilder type inference [#762](https://github.com/xuelongqy/flutter_easy_refresh/issues/762).
- fix: Event notification after dispose [#726](https://github.com/xuelongqy/flutter_easy_refresh/issues/726).
- fix: Using refreshOnStart, onRefresh may not be triggered [#789](https://github.com/xuelongqy/flutter_easy_refresh/issues/789).
- fix: Using refreshOnStart, scrolling to the bottom when the Header is visible cannot trigger loading [#787](https://github.com/xuelongqy/flutter_easy_refresh/issues/787).
Expand Down
2 changes: 1 addition & 1 deletion example/lib/page/sample/paging_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _PagingPageState extends State<PagingPage> {
title: Text('Paging example'.tr),
),
body: CustomPaging(
itemBuilder: <ItemType>(context, index, item) {
itemBuilder: <String>(context, index, item) {
return const SkeletonItem();
},
),
Expand Down
6 changes: 3 additions & 3 deletions lib/src/easy_paging.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
part of easy_paging;

/// Paging item builder.
typedef EasyPagingItemBuilder = Widget Function<ItemType>(
typedef EasyPagingItemBuilder<ItemType> = Widget Function(
BuildContext context, int index, ItemType item);

/// A flutter widget that convenient pagination.
Expand Down Expand Up @@ -59,7 +59,7 @@ abstract class EasyPaging<DataType, ItemType> extends StatefulWidget {
final Clip clipBehavior;

/// Item builder.
final EasyPagingItemBuilder? itemBuilder;
final EasyPagingItemBuilder<ItemType>? itemBuilder;

/// Refresh on start widget builder.
final WidgetBuilder? refreshOnStartWidgetBuilder;
Expand Down Expand Up @@ -249,7 +249,7 @@ abstract class EasyPagingState<DataType, ItemType> extends State<EasyPaging> {

/// Build item widget.
Widget buildItem(BuildContext context, int index, ItemType item) {
return widget.itemBuilder!<ItemType>(context, index, item);
return widget.itemBuilder!(context, index, item);
}

@override
Expand Down

0 comments on commit b2b5eaa

Please sign in to comment.