Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Last active April 25, 2019 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/5d375872bc450849e0c298b83ec94415 to your computer and use it in GitHub Desktop.
Save MarcinusX/5d375872bc450849e0c298b83ec94415 to your computer and use it in GitHub Desktop.
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