Skip to content

Commit

Permalink
add: version 0.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
DaisukeNagata committed Oct 14, 2022
1 parent ea3b669 commit a858658
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,8 @@

## 0.2.10

* Refactor -> Change logic of setState
* Refactor -> Change logic of setState

## 0.2.11

* Refactor -> Call Back logic
13 changes: 4 additions & 9 deletions example/lib/wheel_example2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ class WheelPageState2 extends State<WheelPage2> {
) {
if (snapshot.hasData) {
return WheelExpandListHorizontal(
tapCall: (index) {
Future(() {
setState(() {
wheelLogic.indexCount = index;
});
});
},
pageStart: (index) {
wheelLogic.slideActionFlg
? wheelDataSet.startController(
Expand All @@ -100,10 +93,12 @@ class WheelPageState2 extends State<WheelPage2> {
Curves.easeOut,
);
},
pageEnd: (value) {
pageEnd: (index) {
Future(() {
setState(() {
wheelLogic.pageCounts[wheelLogic.pageCount] = value;
wheelLogic.valueSet = wheelLogic.valueSetReady + 1;
wheelLogic.pageCounts[wheelLogic.pageCount] =
wheelLogic.valueSetReady;
});
});
},
Expand Down
2 changes: 1 addition & 1 deletion example/lib/wheel_extension_logic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ extension WheelPageState2Ex on WheelPageState2 {
return IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => {
updateData(false),
Navigator.of(context).pop(true),
refresh(),
},
);
Expand Down
23 changes: 9 additions & 14 deletions lib/wheel_expand_list_horizontal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ class WheelExpandListHorizontal extends StatelessWidget {
super.key,
required this.pageStart,
required this.pageEnd,
required this.tapCall,
required this.wheelLogic,
required this.wheelDataModel,
required this.wheelPrimitiveWidget,
});

final Function(int) pageStart;
final Function(int) pageEnd;
final Function(int) tapCall;
final WheelLogic wheelLogic;
final WheelPrimitiveModel wheelDataModel;
final WheelPrimitiveWidget wheelPrimitiveWidget;
Expand All @@ -34,15 +32,6 @@ class WheelExpandListHorizontal extends StatelessWidget {
itemCount: wheelLogic.pageList.length,
itemBuilder: (context, index) {
return GestureDetector(
onTapDown: (_) {
wheelLogic.indexCount = index;
wheelLogic.pageCount = index;
wheelLogic.valueSetReady = wheelLogic.pageCounts[index];
wheelLogic.valueSet = wheelLogic.valueSetReady + 1;
},
onTapUp: (_) {
tapCall.call(index);
},
child: SafeArea(
child: SizedBox(
height: wheelLogic.heightLists[wheelLogic.pageCounts[index]]
Expand All @@ -57,12 +46,18 @@ class WheelExpandListHorizontal extends StatelessWidget {
: 3,
child: NotificationListener(
onNotification: (notificationInfo) {
if (notificationInfo is ScrollEndNotification) {
if (notificationInfo is ScrollStartNotification) {
// call.call(index);
wheelLogic.indexCount = index;

wheelLogic.pageCount = index;
wheelLogic.valueSetReady =
wheelLogic.pageCounts[index];
wheelLogic.valueSet =
wheelLogic.valueSetReady + 1;

} else if (notificationInfo
is ScrollEndNotification) {
pageEnd.call(wheelLogic.valueSetReady);
wheelLogic.streamController.sink.add([]);
}
return true;
},
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: wheel_expand_list
description: It works in 3D with horizontal scrolling. If the area is exceeded, vertical scrolling occurs.
version: 0.2.10
version: 0.2.11

homepage: https://github.com/daisukenagata/wheel_expand_list

Expand Down

0 comments on commit a858658

Please sign in to comment.