Skip to content

Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/sliding_cards.dart Secret
Last active Apr 25, 2019

Embed
What would you like to do?
class SlidingCard extends StatelessWidget {
final double offset; //<-- How far is page from being displayed
...
@override
Widget build(BuildContext context) {
return ...
Image.asset(
'assets/$assetName',
height: MediaQuery.of(context).size.height * 0.3,
alignment: Alignment(-offset.abs(), 0), //<-- Set the alignment
fit: BoxFit.none,
),
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.