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

Clean Up and Migration to PanUpdate #31

Open
wants to merge 3 commits 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
4 changes: 3 additions & 1 deletion lib/direct_select_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ class DirectSelectContainerState extends State<DirectSelectContainer>
Rect? rect = RectGetter.getRectFromKey(
_currentList.paddingItemController.paddingGlobalKey);
if (rect != null) {
paddingLeft = rect.left;
// paddingLeft = rect.left;
paddingLeft = 0;
//will leave menus as centered.
}
}

Expand Down
45 changes: 36 additions & 9 deletions lib/direct_select_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,46 @@ class DirectSelectState<T> extends State<DirectSelectList<T>> {
animatedStateKey.currentState
?.runScaleTransition(reverse: true);
},
onVerticalDragEnd: (dragDetails) async {
// onVerticalDragEnd: (dragDetails) async {
// debugPrint('DirectSelectList onVerticalDragEnd');
// transitionEnded = true;
// _dragEnd();
// },
// onHorizontalDragEnd: (horizontalDetails) async {
// debugPrint('DirectSelectList onVerticalDragEnd');
// transitionEnded = true;
// _dragEnd();
// },
// onVerticalDragUpdate: (dragInfo) {
// debugPrint('DirectSelectList onVerticalDragUpdate');
// if (!_isShowUpAnimationRunning) {
// _showListOverlay(dragInfo.primaryDelta);
// }
// },
onPanEnd: (dragInfo) async {
debugPrint('DirectSelectList onPanEnd');
transitionEnded = true;
_dragEnd();
},
onHorizontalDragEnd: (horizontalDetails) async {
transitionEnded = true;
_dragEnd();
},
onVerticalDragUpdate: (dragInfo) {
if (!_isShowUpAnimationRunning) {
_showListOverlay(dragInfo.primaryDelta);
onPanUpdate: (dragInfo) {
if (dragInfo.delta.dx > 0)
print("Dragging in +X direction");
else
print("Dragging in -X direction");

if (dragInfo.delta.dy > 0) {
print("Dragging in +Y direction");
if (!_isShowUpAnimationRunning) {
_showListOverlay(dragInfo.delta.dy);
}
} else {
print("Dragging in -Y direction");
if (!_isShowUpAnimationRunning) {
_showListOverlay(dragInfo.delta.dy);
}
}
});
},
);
});
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ environment:
dependencies:
flutter:
sdk: flutter
rect_getter: ^1.0.0
rect_getter: ^1.1.0

dev_dependencies:
flutter_test:
sdk: flutter

flutter:
uses-material-design: true
uses-material-design: true