INFRA: Set Up Project.
This commit is contained in:
25
lib/widget/story_view/utils.dart
Normal file
25
lib/widget/story_view/utils.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
enum LoadState { loading, success, failure }
|
||||
|
||||
enum Direction { up, down, left, right }
|
||||
|
||||
class VerticalDragInfo {
|
||||
bool cancel = false;
|
||||
|
||||
Direction? direction;
|
||||
|
||||
void update(double primaryDelta) {
|
||||
Direction tmpDirection;
|
||||
|
||||
if (primaryDelta > 0) {
|
||||
tmpDirection = Direction.down;
|
||||
} else {
|
||||
tmpDirection = Direction.up;
|
||||
}
|
||||
|
||||
if (direction != null && tmpDirection != direction) {
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
direction = tmpDirection;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user