-
-
Save MarcinusX/5d375872bc450849e0c298b83ec94415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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