parallax_image 0.3.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 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';
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 21, 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 getting outdated. (-6.03 points)

The package was last published 55 weeks ago.


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 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8