File tree Expand file tree Collapse file tree 12 files changed +349
-7
lines changed
Expand file tree Collapse file tree 12 files changed +349
-7
lines changed Original file line number Diff line number Diff line change 1+ ## 1.4.0-dev.1
2+
3+ * Added ` AnimateOnVisibilityChange ` & ` AnimateOnVisibilityWrapper `
4+
15## 1.3.0
26
37* Fixed lexical error in ` AutoAnimatedIconButton ` (` firstToolip ` & ` secondToolip ` renamed to ` firstTooltip ` & secondTooltip)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Already added:
77- ` AutoAnimatedGrid `
88- ` AutoAnimatedSliverGrid `
99- ` AutoAnimatedIconButton `
10+ - ` AnimateOnVisibilityChange `
1011
1112## Screenshots
1213<p float =" left " >
@@ -21,7 +22,7 @@ In your flutter project add the dependency:
2122
2223[ ![ pub package] ( https://img.shields.io/pub/v/auto_animated.svg )] ( https://pub.dartlang.org/packages/auto_animated )
2324
24- ``` dart
25+ ``` yaml
2526dependencies :
2627 ...
2728 auto_animated : any
Original file line number Diff line number Diff line change 1+ import 'package:auto_animated_example/screens/animate_on_visibility.dart' ;
12import 'package:auto_animated_example/screens/grid.dart' ;
23import 'package:flutter/material.dart' ;
34import 'package:flutter/services.dart' ;
@@ -29,6 +30,7 @@ class _MyAppState extends State<MyApp> {
2930 AutoAnimatedGridExample (),
3031 SliverExample (),
3132 AutoAnimatedIconButtonExample (),
33+ AnimateOnVisibilityExample (),
3234 ];
3335
3436 void _onItemTapped (int index) {
@@ -66,6 +68,10 @@ class _MyAppState extends State<MyApp> {
6668 icon: Icon (Icons .check_circle),
6769 title: Text ('IconButton' ),
6870 ),
71+ BottomNavigationBarItem (
72+ icon: Icon (Icons .remove_red_eye),
73+ title: Text ('On visibility' ),
74+ ),
6975 ],
7076 currentIndex: _selectedIndex,
7177 // selectedItemColor: Colors.amber[800],
Original file line number Diff line number Diff line change 1+ import 'package:auto_animated_example/utils.dart' ;
2+ import 'package:flutter/material.dart' ;
3+ import 'package:auto_animated/auto_animated.dart' ;
4+
5+ class AnimateOnVisibilityExample extends StatelessWidget {
6+ @override
7+ Widget build (BuildContext context) {
8+ final textStyle =
9+ Theme .of (context).textTheme.title.copyWith (color: Colors .black);
10+
11+ return Scaffold (
12+ body: SafeArea (
13+ // Wrapper before Scroll view!
14+ child: AnimateOnVisibilityWrapper (
15+ showItemInterval: Duration (milliseconds: 150 ),
16+ child: SingleChildScrollView (
17+ child: Column (
18+ children: < Widget > [
19+ SizedBox (height: 16 ),
20+ Text ('Animate elements on visibility' , style: textStyle),
21+ for (int i = 0 ; i < 20 ; i++ )
22+ AnimateOnVisibilityChange (
23+ key: Key ('$i ' ),
24+ builder: animationBuilder (
25+ SizedBox (
26+ width: double .infinity,
27+ height: 200 ,
28+ child: HorizontalItem (
29+ title: '$i ' ,
30+ ),
31+ ),
32+ xOffset: i.isEven ? 0.15 : - 0.15 ,
33+ ),
34+ ),
35+ ],
36+ ),
37+ ),
38+ ),
39+ ),
40+ );
41+ }
42+ }
Original file line number Diff line number Diff line change @@ -81,3 +81,27 @@ Widget Function(
8181 ),
8282 ),
8383 );
84+
85+ Widget Function (
86+ BuildContext context,
87+ Animation <double > animation,
88+ ) animationBuilder (Widget child, {double xOffset = 0 }) => (
89+ BuildContext context,
90+ Animation <double > animation,
91+ ) =>
92+ FadeTransition (
93+ opacity: Tween <double >(
94+ begin: 0 ,
95+ end: 1 ,
96+ ).animate (animation),
97+ child: SlideTransition (
98+ position: Tween <Offset >(
99+ begin: Offset (xOffset, 0.1 ),
100+ end: Offset .zero,
101+ ).animate (animation),
102+ child: Padding (
103+ padding: EdgeInsets .all (16 ),
104+ child: child,
105+ ),
106+ ),
107+ );
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ packages:
1414 path: ".."
1515 relative: true
1616 source: path
17- version: "1.3.0 "
17+ version: "1.4.0-dev.1 "
1818 boolean_selector:
1919 dependency: transitive
2020 description:
@@ -36,6 +36,13 @@ packages:
3636 url: "https://pub.dartlang.org"
3737 source: hosted
3838 version: "1.14.11"
39+ csslib:
40+ dependency: transitive
41+ description:
42+ name: csslib
43+ url: "https://pub.dartlang.org"
44+ source: hosted
45+ version: "0.16.1"
3946 cupertino_icons:
4047 dependency: "direct main"
4148 description:
@@ -53,6 +60,20 @@ packages:
5360 description: flutter
5461 source: sdk
5562 version: "0.0.0"
63+ flutter_widgets:
64+ dependency: transitive
65+ description:
66+ name: flutter_widgets
67+ url: "https://pub.dartlang.org"
68+ source: hosted
69+ version: "0.1.7+1"
70+ html:
71+ dependency: transitive
72+ description:
73+ name: html
74+ url: "https://pub.dartlang.org"
75+ source: hosted
76+ version: "0.14.0+3"
5677 matcher:
5778 dependency: transitive
5879 description:
@@ -150,4 +171,5 @@ packages:
150171 source: hosted
151172 version: "2.0.8"
152173sdks:
153- dart: ">=2.2.2 <3.0.0"
174+ dart: ">=2.3.0 <3.0.0"
175+ flutter: ">=1.9.1 <2.0.0"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ version: 1.0.0
44publish_to : ' none'
55
66environment :
7- sdk : " >=2.1 .0 <3.0.0"
7+ sdk : " >=2.3 .0 <3.0.0"
88
99dependencies :
1010 flutter :
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ export 'src/icon_button.dart';
33export 'src/list.dart' ;
44export 'src/list_animation.dart'
55 show AutoAnimatedListItemBuilder, AutoAnimatedListRemovedItemBuilder;
6+ export 'src/on_visibility_change.dart' ;
67export 'src/sliver_grid.dart' ;
78export 'src/sliver_list.dart' ;
You can’t perform that action at this time.
0 commit comments