v0.0.5
visual_effect
Flutter용 VisualEffect API로 위젯에 페인트 효과를 쉽게 추가할 수 있습니다.
70좋아요 1930일 다운로드140Pub 점수
AndroidiOSWebmacOSWindowsLinux
Flutter용 VisualEffect API
{"sdk":"flutter"}^1.9.1^2.1.4{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
VisualEffect API for Flutter to easily add paint effects on your widgets.
Warning This package is experimental for the moment. The API can change at any time.
The main purpose of this API is to provide an easy and efficiently way to apply scroll animations.
Warning The
addRepaintBoundariesMUST be set to false in the parent Sliver/ScrollView because we explicitely want in that case to repaint for every single scroll so we can add the effect.
For example this Card Stack effect can be obtained with the code below:
Card Stack
class _ScrolledItem extends StatelessWidget {
const _ScrolledItem();
@override
Widget build(BuildContext context) {
return ScrollEffect(
onGenerateVisualEffect: (effect, phase) {
return effect
.grayscale(phase.leadingLerp(to: 0.5))
.scale(
x: phase.isLeading ? phase.leadingLerp(from: 1, to: 0.9) : 1,
anchor: Alignment.topCenter,
)
.translate(y: effect.childSize.height * phase.leading);
},
child: const _CardItem(),
);
}
}