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

Reaction box is showing off the screen. #33

Open
jigarfumakiya opened this issue Jan 10, 2022 · 12 comments · May be fixed by #47
Open

Reaction box is showing off the screen. #33

jigarfumakiya opened this issue Jan 10, 2022 · 12 comments · May be fixed by #47
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@jigarfumakiya
Copy link

Great package.

I have added this package as my reaction button but sometimes it starts from the left and goes off the screen. I have tested it multiple times.
Not see any exception in the console as well. I am attaching an image below

Take look.

test_image

@jigarfumakiya
Copy link
Author

@GeekAbdelouahed
Any help would be appreciated.
Thanks

@rlee1990
Copy link
Contributor

@GeekAbdelouahed I too am having the same issue but only on IOS.

@jigarfumakiya
Copy link
Author

I tried to find out the issue but was not able to find out how and why this is happing.

But as of now as a quick fix, this works for me to change this method In reaction_box.dart

double _getHorizontalPosition() {
    final buttonX = widget.buttonOffset.dx;
    final buttonRadius = (widget.buttonSize.width / 2);
    final screenWidth = MediaQuery
        .of(context)
        .size
        .width;

    if (buttonX + (_boxSizeAnimation.value?.width ?? 0) < screenWidth)
      return buttonX - buttonRadius;

    final value = buttonX + buttonRadius -
        (_boxSizeAnimation.value?.width ?? 0);

    //add this below code.
    if (value.isNegative) {
      return 20;   // this is 20 horizontal width is fix you can play with it as you want.
    }
    return buttonX + buttonRadius - (_boxSizeAnimation.value?.width ?? 0);
  }

@rlee1990
Copy link
Contributor

@jigarfumakiya where is this located?

@rlee1990
Copy link
Contributor

NVM

@rlee1990
Copy link
Contributor

@GeekAbdelouahed what @jigarfumakiya suggested does indeed fix the issue.

@jigarfumakiya
Copy link
Author

jigarfumakiya commented Jan 13, 2022

@jigarfumakiya where is this located?

Screenshot 2022-01-13 at 11 12 41 PM

Check flutter_reaction_button

@rlee1990
FYI-:No I am not sure that it fixes the issue from the core. that is just a quick fix. If I get time will look into more details and send PR.

@rlee1990
Copy link
Contributor

@jigarfumakiya from what I can see thats the right track. Im going to play around with it to find a way to have it centered.

@rlee1990
Copy link
Contributor

@GeekAbdelouahed any update on this?

@wdcs-kishangohel
Copy link

Same issue with 2.0.1 version

@GeekAbdelouahed GeekAbdelouahed self-assigned this Oct 20, 2023
@GeekAbdelouahed GeekAbdelouahed added bug Something isn't working enhancement New feature or request labels Oct 20, 2023
@GeekAbdelouahed
Copy link
Owner

@jigarfumakiya can you test this with version 3.0.0 or above?.

@julek-kal
Copy link

@GeekAbdelouahed I've checked it on 3.0.0+2 and result wasn't satisfying( easily reproduceable by multiple presses and holds along horizontal axis )

So I've created #47. In my humble opinion now it's behave significantly better.
It would be nice if you can take a look and express your opinion. Additionally I've exposed positioningStrategy which gave developers opportunity to manage reaction box position on theirs own.

@julek-kal julek-kal linked a pull request Oct 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants