Home > Net >  flutter flash card looping the words the user selected as i don't know until he learns all of t
flutter flash card looping the words the user selected as i don't know until he learns all of t

Time:06-20

i am making a flash card app in which there is a flip card which have the english words and on the back it has the translation . and there are 2 buttons "i know button" and i don't know button if the user presses the i know button the game continues if the user presses i don't know the app should remember this and loop the words which the user could not know the answer. how can i do it? so far i have done till the part where i have the buttons working but they are just like next and previous buttons and not looping the wrong words. how i can make it? i am struggling with the logic of this.

i am new here.

a

CodePudding user response:

You need to create your own logic for this but let's give you an example. You have a deck with 10 cards, you are shown card 1, you press 'I know', this card should now be removed from the deck, by calling a setState for example. if you do this 9 more times you will run out of cards so you have finished your deck so you have learned everything. Now let's say you are shown the next card, and you press 'dont know'. Then, you should decide what you want to happen. do you:
1) at the button press, you add that card at the last position to be shown in the end, or
2) you put it at a random place in the deck. Maybe you might want to make sure it isn't the next card so add some logic for that. :)

  • Related