decrease the degree to which a memory cover widget is scaled when scrolled
This commit is contained in:
parent
72af4b9598
commit
67c0912fc7
2 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue