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.
An example of the use of parallax_swiper.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: parallax_swiper: ^0.0.1
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.12.21
- Flutter: 1.9.1+hotfix.6
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of
0.0.*, it might mean that the author is still experimenting with the general direction of the API.