parallax_swiper 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

parallax_swiper #

A swiper widget with parallax effect with support for both swipe directions.

Installation #

Add parallax_swiper: ^0.0.1 to your pubspec.yaml file. Import it by adding to your file:

import 'package: parallax_swiper/parallax_swiper.dart'

Use #

Create a ParallaxSwiper widget and pass the required parameters.

    backgroundWidget: bgWidget,
    foregroundWidgets: <Widget>[fgWidget1, fgWidget2, fgWidget3],

Parameters #

    backgroundWidget: bgWidget,
    foregroundWidgets: <Widget>[fgWidget1, fgWidget2, fgWidget3],
    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,

backgroundWidget - Widget
The widget to be displayed in the background.

foregroundWidgets - List<Widget>
A list of widgets to be displayed in the foreground and be swiped.

alignment - Alignment
The alignment in the widget stack, default

returnDuration - Duration
The amount of time for the widget to return to the center position after a drag ends.

returnCurve - Curve
The curve for the return animation after a drag ends.

backgroundRotationFactor - double
The amount of rotation for the background.

foregroundRotationFactor - double
The amount of rotation for the foreground.

foregroundTranslationFactor - double
The amount of translation for the foreground.

swiperHeight - double
The height of the foreground swiper.

swiperInitialPage - int
The initial page/item to be shown by the swiper.

swiperInfiniteSwipe - bool
Set the swipe to be infinite or limited to the amount of items in the foregroundWidgets list.

swipeDirection - Axis
The direction of the swipe.

swiperDuration - Duration
The duration of the animation of the swipe.

swiperCurve - Curve
The curve of the animation of the swipe

onItemChanged - Function
Callback function for when an item changed in the swiper.

onTap - Function
Callback function after a tap on the widget.

onDoubleTap - Function
Callback function after a double tap on the widget.

onLongPress - Function
Callback function after a long press on the widget.

Example #

Horizontal swipe

Vertical swipe

Credits #

Example images source: Super Mario Wiki
Example font: Super Mario 256 by fsuarez913

0.0.1 #

Initial release.


parallax_swiper_example #

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:

  parallax_swiper: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:

$ 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:

import 'package:parallax_swiper/parallax_swiper.dart';
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]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Maintenance suggestions

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies