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

[ BUG ] : Appinio Swiper: Provided example for onSwipeEnd activity is not valid #266

Open
tannker opened this issue Apr 7, 2024 · 0 comments
Assignees
Labels
Appinio swiper This label is used to indicate that this issue belongs to Appinio swiper plugin

Comments

@tannker
Copy link

tannker commented Apr 7, 2024

Plugin name
Appinio Swiper

Describe the bug
For onSwipeEnd following example is given in documentation:

void _swipeEnd (int previousIndex, int targetIndex, SwiperActivity activity) {
    switch (activity) {
      case Swipe():
        log('The card was swiped to the : ${activity.direction}');
        log('previous index: $previousIndex, target index: $targetIndex');
        break;
      case Unswipe():
        log('A ${activity.direction.name} swipe was undone.');
        log('previous index: $previousIndex, target index: $targetIndex');
        break;
      case CancelSwipe():
        log('A swipe was cancelled');
        break;
      case DrivenActivity():
        log('Driven Activity');
        break;
    }

However, when implementing it, Swipe(), Unswipe(), CancelSwipe() and DriveActivity() are not actually constants with latest 2.10 version.

To Reproduce
If for example Swipe() is added as a case option, then following error is shown:

_The named parameter 'begin' is required, but there's no corresponding argument. (Documentation)  Try adding the required argument.

The named parameter 'end' is required, but there's no corresponding argument. (Documentation)  Try adding the required argument.

The constructor being called isn't a const constructor. (Documentation)  Try removing 'const' from the constructor invocation.

Case expressions must be constant._

Expected behavior
Swipe() and other proposed case options has to be constants

@tannker tannker changed the title [ BUG ] : Provided example for onSwipeEnd activity is not valid [ BUG ] : Appinio Swiper: Provided example for onSwipeEnd activity is not valid Apr 7, 2024
@khanmujeeb687 khanmujeeb687 added the Appinio swiper This label is used to indicate that this issue belongs to Appinio swiper plugin label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Appinio swiper This label is used to indicate that this issue belongs to Appinio swiper plugin
Projects
None yet
Development

No branches or pull requests

2 participants