RafaelBarbosatec / hidden_drawer_menu

Hidden Drawer Menu is a library for adding a beautiful drawer mode menu feature with perspective animation.
MIT License
352 stars 55 forks source link

Dragg from right #42

Open SamiraAriaeifar opened 4 years ago

SamiraAriaeifar commented 4 years ago

I want to dragg from right when i have typeOpen: TypeOpen.FROM_RIGHT,

SamiraAriaeifar commented 4 years ago

??

proformance commented 4 years ago

I can confirm this issue, dragging works very well from the left, but it's not working from the right.

proformance commented 4 years ago

I can see that the code is already prepared for dragging on the right side as well. The problem is due to

  void _myOnHorizontalDragStart(DragStartDetails detail) {
    if (!widget.isDraggable) return;
    if (detail.localPosition.dx <= WIDTH_GESTURE &&
        !(widget.withPaddingTop && detail.localPosition.dy <= HEIGHT_APPBAR)) {
      this.setState(() {
        dragging = true;
      });
    }
  }

in animated_drawer_content.dart:120

Increasing WIDTH_GESTURE or commenting out the inner if-statement will make dragging work for you on the right side too.

Best regards