Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
✍️: Update README.md and example
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeMoody01 committed Sep 6, 2022
1 parent 6fa9732 commit a496a91
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 8 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Since the original animate_do is not being maintained, I have decided to create
To see the road map, view the open [issues](https://github.com/LukeMoody01/animate_it/issues)

### Showcase
| Demo1 | Demo2 | Demo3 |
| --- | --- | --- |
|![](https://github.com/LukeMoody01/animate_it/blob/master/media/intro.gif) | ![](https://github.com/LukeMoody01/animate_it/blob/master/media/list.gif) | ![](https://github.com/LukeMoody01/animate_it/blob/master/media/grid.gif) |

| Demo1 | Demo2 | Demo3 |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| ![](https://github.com/LukeMoody01/animate_it/blob/master/media/intro.gif) | ![](https://github.com/LukeMoody01/animate_it/blob/master/media/list.gif) | ![](https://github.com/LukeMoody01/animate_it/blob/master/media/grid.gif) |

# Available **Animations**

Expand Down Expand Up @@ -101,16 +101,18 @@ To see the road map, view the open [issues](https://github.com/LukeMoody01/anima

## Example

To use the animations, wrap any widget you want inside any animation widget (as seen below):

```
home: Scaffold(
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
FadeInLeft(child: Text('Left') ),
FadeInUp(child: Text('Up') ),
FadeInDown(child: Text('Down') ),
FadeInRight(child: Text('Right') ),
LightSpeedInLeft(child: Text('Left')),
ShakeX(child: Text('ShakeX')),
ShakeY(child: Text('ShakeY')),
LightSpeedInRight(child: Text('Right')),
],
),
),
Expand Down
77 changes: 76 additions & 1 deletion example/main.dart
Original file line number Diff line number Diff line change
@@ -1 +1,76 @@
// TODO: Create example with new widgets
import 'package:animate_it/animate_it.dart';
import 'package:flutter/material.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'animate_it demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'animate_it demo'),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
_counter++;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: LightSpeedInLeft(
child: Text(widget.title),
),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const LightSpeedInRight(
child: Text(
'You have pushed the button this many times:',
),
),
JelloIn(
child: Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
),
],
),
),
floatingActionButton: BounceInDown(
child: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
),
);
}
}

0 comments on commit a496a91

Please sign in to comment.