Skip to content

Commit

Permalink
[auto_animated] Bump 1.4.0-dev.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeShkurko committed Dec 17, 2019
1 parent a4412a6 commit d0c4022
Show file tree
Hide file tree
Showing 12 changed files with 349 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/auto_animated/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.4.0-dev.1

* Added `AnimateOnVisibilityChange` & `AnimateOnVisibilityWrapper`

## 1.3.0

* Fixed lexical error in `AutoAnimatedIconButton` (`firstToolip` & `secondToolip` renamed to `firstTooltip` & secondTooltip)
Expand Down
3 changes: 2 additions & 1 deletion packages/auto_animated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Already added:
- `AutoAnimatedGrid`
- `AutoAnimatedSliverGrid`
- `AutoAnimatedIconButton`
- `AnimateOnVisibilityChange`

## Screenshots
<p float="left">
Expand All @@ -21,7 +22,7 @@ In your flutter project add the dependency:

[![pub package](https://img.shields.io/pub/v/auto_animated.svg)](https://pub.dartlang.org/packages/auto_animated)

```dart
```yaml
dependencies:
...
auto_animated: any
Expand Down
6 changes: 6 additions & 0 deletions packages/auto_animated/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:auto_animated_example/screens/animate_on_visibility.dart';
import 'package:auto_animated_example/screens/grid.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -29,6 +30,7 @@ class _MyAppState extends State<MyApp> {
AutoAnimatedGridExample(),
SliverExample(),
AutoAnimatedIconButtonExample(),
AnimateOnVisibilityExample(),
];

void _onItemTapped(int index) {
Expand Down Expand Up @@ -66,6 +68,10 @@ class _MyAppState extends State<MyApp> {
icon: Icon(Icons.check_circle),
title: Text('IconButton'),
),
BottomNavigationBarItem(
icon: Icon(Icons.remove_red_eye),
title: Text('On visibility'),
),
],
currentIndex: _selectedIndex,
// selectedItemColor: Colors.amber[800],
Expand Down
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,
),
),
],
),
),
),
),
);
}
}
24 changes: 24 additions & 0 deletions packages/auto_animated/example/lib/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,27 @@ Widget Function(
),
),
);

Widget Function(
BuildContext context,
Animation<double> animation,
) animationBuilder(Widget child, {double xOffset = 0}) => (
BuildContext context,
Animation<double> animation,
) =>
FadeTransition(
opacity: Tween<double>(
begin: 0,
end: 1,
).animate(animation),
child: SlideTransition(
position: Tween<Offset>(
begin: Offset(xOffset, 0.1),
end: Offset.zero,
).animate(animation),
child: Padding(
padding: EdgeInsets.all(16),
child: child,
),
),
);
26 changes: 24 additions & 2 deletions packages/auto_animated/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.3.0"
version: "1.4.0-dev.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -36,6 +36,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -53,6 +60,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_widgets:
dependency: transitive
description:
name: flutter_widgets
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.7+1"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+3"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -150,4 +171,5 @@ packages:
source: hosted
version: "2.0.8"
sdks:
dart: ">=2.2.2 <3.0.0"
dart: ">=2.3.0 <3.0.0"
flutter: ">=1.9.1 <2.0.0"
2 changes: 1 addition & 1 deletion packages/auto_animated/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: 'none'

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.3.0 <3.0.0"

dependencies:
flutter:
Expand Down
1 change: 1 addition & 0 deletions packages/auto_animated/lib/auto_animated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export 'src/icon_button.dart';
export 'src/list.dart';
export 'src/list_animation.dart'
show AutoAnimatedListItemBuilder, AutoAnimatedListRemovedItemBuilder;
export 'src/on_visibility_change.dart';
export 'src/sliver_grid.dart';
export 'src/sliver_list.dart';
Loading

0 comments on commit d0c4022

Please sign in to comment.