You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I faced a problem when used your cards(Gesture detector and Alignment type) with bloc.
If you want more details I think it will be better for you to check my original code. Also, here is the original issue in the bloc repository
I need to keep card which is in the process of removing(when card goes beyond the screen), because animation requires this instance. So I keep it in the special var deletingCard in the state. When animation is finished it resets this var to null.
But here is a problem. When new cards are loaded in the bloc I add them in the state and copy previous deletingCard var in the new state which I will yield:
But there is a delay between sending and receiving the state, so during the sending the deletingCard variable is not equal to null(for example, it's not always so) and we copy it to the new state, and when receiving the state the animation is already completed and the variable of old state is reset to null in the widget, but in the new state it is not so and the variable is not null.
As I understand, the animation is constantly rebuilding the widget while it removes the card.
So the situation is also possible when the last update of the widget occurs during the removal of the card, and during this comes a new state with a variable not equal to zero. The animation ended and the variable was reset, but a new state with a non-null variable returned this card back to the deck.
That is why the delay, which I specifically added, added and removed the problem with the different values.
Regards!
The text was updated successfully, but these errors were encountered:
Hello, I faced a problem when used your cards(Gesture detector and Alignment type) with bloc.
If you want more details I think it will be better for you to check my original code. Also, here is the original issue in the
bloc
repositoryI need to keep card which is in the process of removing(when card goes beyond the screen), because animation requires this instance. So I keep it in the special var
deletingCard
in the state. When animation is finished it resets this var to null.But here is a problem. When new cards are loaded in the
bloc
I add them in the state and copy previousdeletingCard
var in the new state which I willyield
:yield GameDeckLoadedState(state.isNeedToAnimate, state.deletingCard, result);
But there is a delay between sending and receiving the state, so during the sending the
deletingCard
variable is not equal to null(for example, it's not always so) and we copy it to the new state, and when receiving the state the animation is already completed and the variable of old state is reset to null in the widget, but in the new state it is not so and the variable is not null.As I understand, the animation is constantly rebuilding the widget while it removes the card.
So the situation is also possible when the last update of the widget occurs during the removal of the card, and during this comes a new state with a variable not equal to zero. The animation ended and the variable was reset, but a new state with a non-null variable returned this card back to the deck.
That is why the delay, which I specifically added, added and removed the problem with the different values.
Regards!
The text was updated successfully, but these errors were encountered: