finite_coverflow

Coverflow slider in flutter which helps you to create amazing slider, carousel and walkthrough sliders.

    

Getting Started

Simple Crousel Example

You can create simple crousel into your app by the following:

    FinitePager(
      scrollDirection: Axis.horizontal, // Scroll direction for pager
      children: <Widget>[ // Add your child here
        Container(
          color: Colors.deepPurple,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.red,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.yellow,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_3.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.lightBlue,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_4.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.green,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
      ],
    )

Here is the result for this example

Rotational Crousel Example

You can create rotational crousel into your app by adding rotation attribute in FinitePager:

    FinitePager(
      rotationY: 60, // Unselected item rotation value
      scrollDirection: Axis.horizontal, // Scroll direction for pager
      children: <Widget>[ // Add your child here
        Container(
          color: Colors.deepPurple,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.red,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.yellow,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_3.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.lightBlue,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_4.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.green,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
      ],
    )

Here is the result for this example

Scaled item Crousel Example

You can create Scaled item crousel into your project by adding or changing the attribute value of scaleX and scaleY, just like this:

    FinitePager(
      scaleX: 0.8, // Minimum scaleX value 
      scaleY: 0.4, // Minimum scaleY value 
      scrollDirection: Axis.horizontal, // Scroll direction for pager
      children: <Widget>[ // Add your child here
        Container(
          color: Colors.deepPurple,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.red,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.yellow,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_3.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.lightBlue,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_4.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.green,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
      ],
    )

Here is the result for this example

Opacity Crousel Example

You can create opacity crousel into your app by adding minimum opacity attribute value, just like this:

    FinitePager(
      opacity: 0.4, // Minimum opacity value for the items
      scrollDirection: Axis.horizontal, // Scroll direction for pager
      children: <Widget>[ // Add your child here
        Container(
          color: Colors.deepPurple,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.red,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.yellow,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_3.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.lightBlue,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_4.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.green,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
      ],
    )

Here is the result for this example

Stack Slider Example

You can create Stack Slider into your app by changing the type of FinitePager to PagerType.stack:

    FinitePager(
      pagerType: PagerType.stack, // Change the FinitePager behavior to stack slider
      scrollDirection: Axis.vertical, // Scroll direction for pager
      children: <Widget>[ // Add your child here
        Container(
          color: Colors.deepPurple,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.red,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.yellow,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_3.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.lightBlue,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_4.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.green,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
      ],
    )

Here is the result for this example

OverScroll Stack Slider Example

You can create Overflow Stack Slider into your app by adding type to PagerType.stack and change overscroll value.
***Note : overscroll is only applicable on PagerType.Stack ***

    FinitePager(
      overscroll: -300, // Over Scroll value when user slide in or slide off
      pagerType: PagerType.stack, // PagerType by default set to carousel
      scrollDirection: Axis.horizontal, // Scroll direction for pager
      children: <Widget>[ // Add your child here
        Container(
          color: Colors.deepPurple,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.red,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.yellow,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_3.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.lightBlue,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_4.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.green,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_1.jpg"),
            ),
          ),
        ),
        Container(
          color: Colors.orange,
          child: Center(
            child: Card(
              shape: CircleBorder(),
              child: Image.asset("images/watch_2.jpg"),
            ),
          ),
        ),
      ],
    )

Here is the result for this example

Finite Coverflow attribute list

Here is the detail of all attributes

Attribute NameDescriptionApplicable Type
pagerTypeSet the FinitePager type i.e. PagerType.Carousel & PagerType.Stack-
reverseMake reverse order if is set to trueBoth
scrollDirectionScrollDirection of your pager i.e. Axis.Horizontal & Axis.VerticalBoth
viewPortFractionSet the view port FractionCarousel
pageSnappingFor snapped your selected or current pageBoth
physicsIt hold ScrollPhysics effects scrolling velocity etc.Both
onPageChangedReturn callback and send back current index whenever selectedBoth
scaleXMinimum x-scale of unselected pageBoth
scaleYMinimum y-scale of unselected pageBoth
opacityset Opacity of unselected pageBoth
rotationXMaximum x-rotation of unselected pageCarousel
rotationYMaximum y-rotation of unselected pageCarousel
overscrollMake the last item overscrolled effectStack
keyGet key and set in pagerBoth
childrenget list of widget and add into pager item

MIT License

Copyright (c) 2020 Muhammad Saeed Younus

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Libraries

finite_coverflow