parallax_image 0.3.1+1

  • Example
  • Installing
  • Versions
  • 94

A Flutter widget that paints an image and moves it at a slower speed than the main scrolling content.


Installation #

Add dependency to your pubspec.yaml:

  parallax_image: [latest version]

Usage #

ParallaxImage can be used with any Scrollable (ListView for instance). When created, it subscribes to scroll updates on nearest Scrollable ancestor. It is also possible to specify custom ScrollController in which case this widget subscribes to updates on ScrollController.position (assumes that controller is attached to only one Scrollable).

class MyWidget extends StatefulWidget {
  MyWidgetState createState() => new MyWidgetState();

class MyWidgetState extends State<MyWidget> {
  final _controller = new ScrollController();

  Widget build(BuildContext context) {
    return new ListView(controller: _controller, children: [
      new ParallaxImage(
        image: new AssetImage('images/january.jpg'),
        // Extent of this widget in scroll direction.
        // In this case it is vertical scroll so extent defines
        // the height of this widget.
        // The image is scaled with BoxFit.fitWidth which makes it
        // occupy full width of this widget.
        // After image is scaled it should normally have height greater
        // than this value to allow for parallax effect to be
        // visible.
        extent: 100.0,
        // Optionally specify child widget.
        child: new Text('January'),
        // Optinally specify scroll controller.
        controller: _controller,
      // ...add more list items

See example/ folder for a complete demo.

Features and bugs #

Please file feature requests and bugs at the issue tracker.


  • Fixed analyzer warnings.


  • Enable hit testing so that ParallaxImage can be used inside GestureDetector.


  • Readme updates.


  • controller argument in ParallaxImage constructor is no longer required. If controller is not specified then ParallaxImage looks for nearest Scrollable ancestor and subscribes to scrolling updates on it.


  • Initial release


Parallax Image Demo #

Example of using ParallaxImage widget.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  parallax_image: ^0.3.1+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_image/parallax_image.dart';
Version Uploaded Documentation Archive
0.3.1+1 Dec 30, 2018 Go to the documentation of parallax_image 0.3.1+1 Download parallax_image 0.3.1+1 archive
0.3.1 Jul 24, 2018 Go to the documentation of parallax_image 0.3.1 Download parallax_image 0.3.1 archive
0.3.0 May 9, 2018 Go to the documentation of parallax_image 0.3.0 Download parallax_image 0.3.0 archive
0.2.0+1 Feb 23, 2018 Go to the documentation of parallax_image 0.2.0+1 Download parallax_image 0.2.0+1 archive
0.2.0 Feb 21, 2018 Go to the documentation of parallax_image 0.2.0 Download parallax_image 0.2.0 archive
0.1.0 Feb 20, 2018 Go to the documentation of parallax_image 0.1.0 Download parallax_image 0.1.0 archive
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 Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8