-
Notifications
You must be signed in to change notification settings - Fork 111
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
Support full-screen cards #65
base: master
Are you sure you want to change the base?
Conversation
Alignment does not work when card is full-screen.
orientation = CardSwipeOrientation.recover; | ||
} | ||
|
||
if (widget.swipeCompleteCallback != null) { | ||
widget.swipeCompleteCallback(orientation, index); | ||
widget.swipeCompleteCallback(orientation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any Reason why we are not sending the current card Index being swiped in the call back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, because index = 0
is now the front card. You don't need to track _currentFront
- the code becomes a lot simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but on the client-side how do we track which card was swiped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's always card[0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So how do we handle a case e.g ,
I have a set of 5 cards and I would like to show some text associated with each card.
so basically there will be a
List<String> ['A','B','C','D','E'];
so in order to show a appropriate text with each card we will need the index of the card being swiped.
Let me know If I am wrong or missing anything :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have left the index
argument in, but it would be 0
every single time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is it like if I have List mapped to cards.on each swipe complete callback I should remove the first element of this list.
And then the first element of the resulting list will be associated with the current card?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for asking too many questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the top/first card gets special treatment - it's the only one that can be swiped, and then it's removed from the list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the explanation
Do we know if this will get reviewed and closed? |
cc: @ShaunRain |
The main purpose of this PR is to allow cards to be full-screen without the odd behaviour mentioned in #55.
In order to achieve this I've had to make a number of changes:
Transform
is used to translate and scale the card instead ofAlign
andSizedBox
SizedBox
means that text on the card is resized instead of moved to different lines when the card size animates.