A swiper widget with parallax effect with support for both swipe directions.
parallax_swiper: ^0.0.1 to your
Import it by adding to your file:
import 'package: parallax_swiper/parallax_swiper.dart'
ParallaxSwiper widget and pass the required parameters.
ParallaxSwiper( backgroundWidget: bgWidget, foregroundWidgets: <Widget>[fgWidget1, fgWidget2, fgWidget3], )
ParallaxSwiper( backgroundWidget: bgWidget, foregroundWidgets: <Widget>[fgWidget1, fgWidget2, fgWidget3], alignment: Alignment.center, returnDuration: Duration(milliseconds: 1000), returnCurve: Curves.easeOut, backgroundRotationFactor: 0.001, foregroundRotationFactor: 0.001, foregroundTranslationFactor: 0.2, swiperHeight: 300, swiperInitialPage: 0, swiperInfiniteSwipe = false, swipeDirection: Axis.vertical, swiperDuration: Duration(milliseconds: 500), swiperCurve: Curves.easeOut, onItemChanged: onItemChangeCallback, onTap: onTapCallback, onDoubleTap: onDoubleTapCallback, onLongPress: onLongPressCallback, )
The widget to be displayed in the background.
A list of widgets to be displayed in the foreground and be swiped.
The alignment in the widget stack, default
The amount of time for the widget to return to the center position after a drag ends.
The curve for the return animation after a drag ends.
The amount of rotation for the background.
The amount of rotation for the foreground.
The amount of translation for the foreground.
The height of the foreground swiper.
The initial page/item to be shown by the swiper.
Set the swipe to be infinite or limited to the amount of items in the foregroundWidgets list.
The direction of the swipe.
The duration of the animation of the swipe.
The curve of the animation of the swipe
Callback function for when an item changed in the swiper.
Callback function after a tap on the widget.
Callback function after a double tap on the widget.
Callback function after a long press on the widget.
- Foreign Function Interface for interoperability with the C programming language. [...]
- HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
- Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.