-
Notifications
You must be signed in to change notification settings - Fork 149
/
ZoomInPageTransformer.dart
75 lines (64 loc) · 1.78 KB
/
ZoomInPageTransformer.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import 'package:example/buildin_transformers.dart';
import 'package:flutter/material.dart';
import 'package:transformer_page_view/transformer_page_view.dart';
import 'package:flutter/cupertino.dart';
// 1111111 !!!!!!
void main() => runApp(new MyApp());
List<Color> list = [Colors.yellow, Colors.green, Colors.blue];
List<String> images = [
"assets/Hepburn2.jpg",
"assets/Hepburn5.jpg",
"assets/Hepburn4.jpg",
];
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class TestWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<Color> list = [
Colors.redAccent,
Colors.blueAccent,
Colors.greenAccent
];
return new TransformerPageView(
loop: true,
transformer: new ZoomInPageTransformer(),
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);
}
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new TestWidget(),
);
}
}