-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4412a6
commit d0c4022
Showing
12 changed files
with
349 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/auto_animated/example/lib/screens/animate_on_visibility.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:auto_animated_example/utils.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:auto_animated/auto_animated.dart'; | ||
|
||
class AnimateOnVisibilityExample extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final textStyle = | ||
Theme.of(context).textTheme.title.copyWith(color: Colors.black); | ||
|
||
return Scaffold( | ||
body: SafeArea( | ||
// Wrapper before Scroll view! | ||
child: AnimateOnVisibilityWrapper( | ||
showItemInterval: Duration(milliseconds: 150), | ||
child: SingleChildScrollView( | ||
child: Column( | ||
children: <Widget>[ | ||
SizedBox(height: 16), | ||
Text('Animate elements on visibility', style: textStyle), | ||
for (int i = 0; i < 20; i++) | ||
AnimateOnVisibilityChange( | ||
key: Key('$i'), | ||
builder: animationBuilder( | ||
SizedBox( | ||
width: double.infinity, | ||
height: 200, | ||
child: HorizontalItem( | ||
title: '$i', | ||
), | ||
), | ||
xOffset: i.isEven ? 0.15 : -0.15, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.