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

Thank you for this package but Match card stops working after re-initializing MatchMachine #33

Open
maxiggle opened this issue Dec 23, 2023 · 0 comments

Comments

@maxiggle
Copy link

I want to say a big thank you for creating this package. I love your package and it is helpful

I wanted to make sure that cards on the stack did not finish from the stack, so I re-initialized like below:

  void initState() {
    super.initState();
    _init();
  }

  void _init() {
    for (int i = 0; i < matches.length; i++) {
      _swipeItems.add(
        SwipeItem(
          content: MatchData(
              image: matches[i].image,
              userName: matches[i].userName,
              age: matches[i].age,
              gender: matches[i].gender,
              role: matches[i].role,
              travelingTo: matches[i].travelingTo,
              opt1: matches[i].opt1,
              opt2: matches[i].opt2,
              isVerified: matches[i].isVerified,
              numberOfTipsGiven: matches[i].numberOfTipsGiven,
              startMonth: matches[i].startMonth,
              endMonth: matches[i].endMonth,
              travelYear: matches[i].travelYear,
              travelAideRating: matches[i].travelAideRating,
              selectedOpt: matches[i].selectedOpt),
        ),
      );
    }
    _matchEngine = MatchEngine(swipeItems: _swipeItems);
    Provider.of<RequestProvider>(context, listen: false).matchEngine =
        _matchEngine!;
  }```

but methods from the matchmachine which I believe is the Controller, stops working unexpectedly

``` widget.matchEngine.currentItem?.nope();

How do I resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant