- Notifications
You must be signed in to change notification settings - Fork150
PageTransformer for flutter
License
best-flutter/transformer_page_view
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
PageTransformer for flutter
import 'package:transformer_page_view/transformer_page_view.dart';...new TransformerPageView(loop: true,transformer: new AccordionTransformer(),itemBuilder: (BuildContext context, int index) { return new Container( color: list[index%list.length], child: new Center( child: new Text("$index",style: new TextStyle(fontSize: 80.0,color: Colors.white),), ), );},itemCount: 3)
Almost the same as PageView.builder, simplely specify atransformer
toTransformerPageView
,which is a sub class ofPageTransformer
See codehere
See codehere
See codehere
See codehere
See codehere
See codehere
Add
transformer_page_view:
to your pubspec.yaml ,and run
flutter packages get
in your project's root directory.
Parameter | Default | Description |
---|---|---|
scrollDirection | Axis.horizontal | IfAxis.horizontal , the scroll view's children are arranged horizontally in a row instead of vertically in a column. |
loop | false | Set totrue to enable continuous loop mode. |
index | none | Index number of initial slide. if not set , it is controlled by the widget itself,otherwise, it is controlled by another widget, which is returned byitemBuilder |
onPageChanged | void onPageChanged(int index) | Called with the new index when the user swiped |
duration | new Duration(milliseconds:300) | The milliseconds of every transaction animation costs |
transformer | none | The most important property of this widget, it returns atransformed widget that based on the widget parameter. If the value is null, aitemBuilder must be specified |
itemCount | none | Number of the total items |
itemBuilder | none | A function that returns a widget based on index,if it's null,atransformer must be specified |
We provide 3 build-in parallaxes, which handle color、image and container
ParallaxColor
ParallaxColor handles the color transform, which controls the color transform from one to another.
ParallaxImage
ParallaxImage handles the image, which speed is slower than thePageView
ParallaxContainer
ParallaxContainer handles the text or other staff, which speed is faster than thePageView
3 build-in parallaxes are all used in subclass ofPageTransform
,group these parallaxes together, we can create very cool things.
Inspired bypage-transformer, and we have an easier way to create this.
See codehere
About
PageTransformer for flutter
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.