decrease the degree to which a memory cover widget is scaled when scrolled

This commit is contained in:
ashilkn 2024-01-17 11:52:05 +05:30
parent 72af4b9598
commit 67c0912fc7
2 changed files with 2 additions and 1 deletions

View file

@ -36,6 +36,7 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
void didChangeDependencies() {
super.didChangeDependencies();
final screenWidth = MediaQuery.sizeOf(context).width;
//factor will be 2 for most phones in portrait mode
final factor = (screenWidth / 220).ceil();
_maxWidth = screenWidth / (factor * 2);
_maxHeight = _maxWidth / MemoryCoverWidget.aspectRatio;

View file

@ -49,7 +49,7 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
builder: (context, child) {
final diff = (widget.controller.offset - widget.offsetOfItem) +
widthOfScreen / 7;
final scale = 1 - (diff / widthOfScreen).abs() / 3;
final scale = 1 - (diff / widthOfScreen).abs() / 3.7;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.5),
//Adding this row is a workaround for making height of memory cover