Skip to content

Commit 95f57e8

Browse files
committed
ReadMe
1 parent 7e8b8a3 commit 95f57e8

File tree

8 files changed

+342
-115
lines changed

8 files changed

+342
-115
lines changed

β€Ž.idea/workspace.xmlβ€Ž

Lines changed: 208 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€ŽREADME.mdβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies:
2323
2424
```dart
2525
import 'package:flutter_animation_set/widget/transition_animations.dart';
26-
import 'package:flutter_animation_set/widget/behavior_animation.dart';
26+
import 'package:flutter_animation_set/widget/behavior_animations.dart';
2727
```
2828

2929
**2、use**
@@ -157,7 +157,7 @@ child: YYRotatingPlane(),
157157
</tr>
158158
</table>
159159

160-
> behavior_animation
160+
> behavior_animations
161161
162162
<table>
163163
<tr>
@@ -221,7 +221,7 @@ Assemble the animation using an AnimatorSet Widget
221221

222222
```dart
223223
AnimatorSet(
224-
child: widget.child
224+
child: widget.child,
225225
animatorSet: [],
226226
)
227227
```

β€ŽREADME_CN.mdβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
2222
```dart
2323
import 'package:flutter_animation_set/widget/transition_animations.dart';
24-
import 'package:flutter_animation_set/widget/behavior_animation.dart';
24+
import 'package:flutter_animation_set/widget/behavior_animations.dart';
2525
```
2626

2727
**2、use**
@@ -155,7 +155,7 @@ child: YYRotatingPlane(),
155155
</tr>
156156
</table>
157157

158-
> behavior_animation θ‘ŒδΈΊεŠ¨η”»
158+
> behavior_animations θ‘ŒδΈΊεŠ¨η”»
159159
160160
<table>
161161
<tr>
@@ -219,7 +219,7 @@ import 'package:flutter_animation_set/animator.dart';
219219

220220
```dart
221221
AnimatorSet(
222-
child: widget.child
222+
child: widget.child,
223223
animatorSet: [],
224224
)
225225
```

β€Žexample/lib/main.dartβ€Ž

Lines changed: 119 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_animation_set/widget/behavior_animation.dart';
2+
import 'package:flutter_animation_set/widget/behavior_animations.dart';
33
import 'package:flutter_animation_set/widget/transition_animations.dart';
4+
import 'package:flutter_animation_set/animation_set.dart';
5+
import 'package:flutter_animation_set/animator.dart';
46

57
void main() => runApp(AnimatorSetActivity());
68

@@ -19,37 +21,81 @@ class AnimatorSetState extends State<AnimatorSetActivity> {
1921
primaryColor: Colors.white,
2022
),
2123
home: Scaffold(
22-
appBar: AppBar(),
23-
body: GridView.count(
24-
crossAxisCount: 4,
25-
children: <Widget>[
26-
BoxColor(child: YYRotatingPlane(), color: Color(0xFFD35413)),
27-
BoxColor(child: YYDoubleBounce(), color: Color(0xFF2F3E50)),
28-
BoxColor(child: YYWave(), color: Color(0xFF00BA9B)),
29-
BoxColor(child: YYWanderingCubes(), color: Color(0xFF3279B5)),
30-
BoxColor(child: YYFadingFour(), color: Color(0xFF323232)),
31-
BoxColor(child: YYFadingCube(), color: Color(0xFF58BD60)),
32-
BoxColor(child: YYPulse(), color: Color(0xFF7D8A8B)),
33-
BoxColor(child: YYThreeBounce(), color: Color(0xFFD35413)),
34-
BoxColor(child: YYThreeLine(), color: Color(0xFFF48A8B)),
35-
BoxColor(child: YYCubeGrid(), color: Color(0xFFD35413)),
36-
BoxColor(child: YYRotatingCircle(), color: Color(0xFF3279B5)),
37-
BoxColor(child: YYPumpingHeart(), color: Color(0xFFF4A352)),
38-
BoxColor(child: YYRipple(), color: Color(0xFF58BD60)),
39-
BoxColor(child: YYRotateLine(), color: Color(0xFF00BA9B)),
40-
BoxColor(child: YYCubeFadeIn(), color: Color(0xFFFCCB63)),
41-
BoxColor(child: YYBlinkGrid(), color: Color(0xFF323232)),
42-
BoxColor(child: YYFadeButton(), color: Color(0xFF3279B5)),
43-
BoxColor(child: YYSingleLike(), color: Color(0xFFF4A352)),
44-
BoxColor(child: YYLove(), color: Color(0xFF2F3E50)),
45-
BoxColor(child: YYSpringMenu(), color: Color(0xFF00BA9B)),
46-
BoxColor(child: YYFoldMenu(), color: Color(0xFF58BD60)),
47-
],
48-
)),
24+
appBar: AppBar(),
25+
body: CustomScrollView(
26+
slivers: <Widget>[
27+
SliverToBoxAdapter(
28+
child: Padding(
29+
padding: EdgeInsets.all(12.0),
30+
child: Text("Transition Animations"),
31+
),
32+
),
33+
SliverGrid.count(
34+
crossAxisCount: 4,
35+
children: <Widget>[
36+
BoxColor(child: YYRotatingPlane(), color: Color(0xFFD35413)),
37+
BoxColor(child: YYDoubleBounce(), color: Color(0xFF2F3E50)),
38+
BoxColor(child: YYWave(), color: Color(0xFF00BA9B)),
39+
BoxColor(child: YYWanderingCubes(), color: Color(0xFF3279B5)),
40+
BoxColor(child: YYFadingFour(), color: Color(0xFF323232)),
41+
BoxColor(child: YYFadingCube(), color: Color(0xFF58BD60)),
42+
BoxColor(child: YYPulse(), color: Color(0xFF7D8A8B)),
43+
BoxColor(child: YYThreeBounce(), color: Color(0xFFD35413)),
44+
BoxColor(child: YYThreeLine(), color: Color(0xFFF48A8B)),
45+
BoxColor(child: YYCubeGrid(), color: Color(0xFFD35413)),
46+
BoxColor(child: YYRotatingCircle(), color: Color(0xFF3279B5)),
47+
BoxColor(child: YYPumpingHeart(), color: Color(0xFFF4A352)),
48+
BoxColor(child: YYRipple(), color: Color(0xFF58BD60)),
49+
BoxColor(child: YYRotateLine(), color: Color(0xFF00BA9B)),
50+
BoxColor(child: YYCubeFadeIn(), color: Color(0xFFFCCB63)),
51+
BoxColor(child: YYBlinkGrid(), color: Color(0xFF323232)),
52+
],
53+
),
54+
SliverToBoxAdapter(
55+
child: Padding(
56+
padding: EdgeInsets.all(12.0),
57+
child: Text("Behavior Animations"),
58+
),
59+
),
60+
SliverGrid.count(
61+
crossAxisCount: 4,
62+
children: <Widget>[
63+
BoxColor(child: YYFadeButton(), color: Color(0xFF3279B5)),
64+
BoxColor(child: YYSingleLike(), color: Color(0xFFF4A352)),
65+
BoxColor(child: YYLove(), color: Color(0xFF2F3E50)),
66+
BoxColor(child: YYSpringMenu(), color: Color(0xFF00BA9B)),
67+
BoxColor(child: YYFoldMenu(), color: Color(0xFF58BD60)),
68+
],
69+
),
70+
SliverToBoxAdapter(
71+
child: Padding(
72+
padding: EdgeInsets.all(12.0),
73+
child: Text("Leaning Curves"),
74+
),
75+
),
76+
SliverList(
77+
delegate: SliverChildBuilderDelegate(
78+
(BuildContext context, int index) {
79+
return box[index];
80+
},
81+
childCount: 2,
82+
),
83+
),
84+
],
85+
),
86+
),
4987
);
5088
}
5189
}
5290

91+
var box = [
92+
BoxColor(
93+
child: CurvesLeaning(curve: Curves.linear), color: Color(0xFF000000)),
94+
BoxColor(
95+
child: CurvesLeaning(curve: Curves.bounceInOut),
96+
color: Color(0xFF000000)),
97+
];
98+
5399
class BoxColor extends StatefulWidget {
54100
BoxColor({this.child, this.color = Colors.black});
55101

@@ -74,3 +120,48 @@ class BoxColorState extends State<BoxColor> {
74120
);
75121
}
76122
}
123+
124+
class CurvesLeaning extends StatefulWidget {
125+
CurvesLeaning({this.curve});
126+
127+
Curve curve;
128+
129+
@override
130+
State<StatefulWidget> createState() {
131+
return CurvesLeaningState();
132+
}
133+
}
134+
135+
class CurvesLeaningState extends State<CurvesLeaning> {
136+
@override
137+
Widget build(BuildContext context) {
138+
return Padding(
139+
padding: EdgeInsets.all(12.0),
140+
child: Flex(
141+
direction: Axis.vertical,
142+
children: <Widget>[
143+
Container(
144+
width: MediaQuery.of(context).size.width,
145+
child: AnimatorSet(
146+
child: SizedBox(
147+
child: Container(
148+
color: Colors.white,
149+
),
150+
width: 20,
151+
height: 20,
152+
),
153+
animatorSet: [
154+
TX(
155+
duration: 2000,
156+
from: 0.0,
157+
to: 80.0,
158+
curve: widget.curve,
159+
)
160+
],
161+
),
162+
),
163+
],
164+
),
165+
);
166+
}
167+
}

β€Žlib/animation_set.dartβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
22

33
import 'animator.dart';
44

5+
export 'package:flutter_animation_set/animation_set.dart'
6+
show AnimatorSet, AnimationType;
7+
58
enum AnimationType {
69
repeat,
710
reverse,

β€Žlib/animator.dartβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:flutter/material.dart';
22

3+
export 'package:flutter_animation_set/animator.dart';
4+
35
abstract class Animator<T> {
46
T from;
57
T to;

β€Žlib/widget/behavior_animation.dartβ€Ž renamed to β€Žlib/widget/behavior_animations.dartβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import 'package:flutter/widgets.dart';
44
import '../animation_set.dart';
55
import '../animator.dart';
66

7+
export 'package:flutter_animation_set/widget/behavior_animations.dart';
8+
79
class YYFadeButton extends StatelessWidget {
810
@override
911
Widget build(BuildContext context) {

β€Žlib/widget/transition_animations.dartβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import 'package:flutter/widgets.dart';
66
import '../animation_set.dart';
77
import '../animator.dart';
88

9+
export 'package:flutter_animation_set/widget/transition_animations.dart';
10+
911
class YYRotatingPlane extends StatelessWidget {
1012
@override
1113
Widget build(BuildContext context) {

0 commit comments

Comments
Β (0)