Skip to content

Instantly share code, notes, and snippets.

@ulusoyca
Last active January 23, 2022 21:26
Show Gist options
  • Save ulusoyca/f3e27857843adc861035c6d8c8b66ec7 to your computer and use it in GitHub Desktop.
Save ulusoyca/f3e27857843adc861035c6d8c8b66ec7 to your computer and use it in GitHub Desktop.
CalculateHeroopacity
/// Calculate opacity
final _opacityStart = 1.0;
final _opacityEnd = 0.0;
double opacity = _calculatePropertyValue(
currentScrollPosition: currentScrollPosition,
startPointInPx: (heroImageHeight / 2) - topBarHeight,
endPointInPx: heroImageHeight - topBarHeight,
lowerLimit: _opacityEnd,
upperLimit: _opacityStart,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment