-
Notifications
You must be signed in to change notification settings - Fork 28
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
Showing
127 changed files
with
249 additions
and
1,126 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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,80 +1,16 @@ | ||
```dart | ||
import 'package:flutter/material.dart'; | ||
import 'package:states_rebuilder/states_rebuilder.dart'; | ||
import 'package:animator/animator.dart'; | ||
# example | ||
|
||
class MainBloc extends StatesRebuilder { | ||
bool toggleCurve = true; | ||
rebuild(State state) { | ||
toggleCurve = !toggleCurve; | ||
rebuildStates(states: [state]); | ||
} | ||
} | ||
A new Flutter project. | ||
|
||
final mainBloc = MainBloc(); | ||
## Getting Started | ||
|
||
void main() => runApp(AnimatedLogo()); | ||
This project is a starting point for a Flutter application. | ||
|
||
class AnimatedLogo extends StatelessWidget { | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
home: Scaffold( | ||
appBar: AppBar(), | ||
body: Body(), | ||
), | ||
); | ||
} | ||
} | ||
A few resources to get you started if this is your first Flutter project: | ||
|
||
class Body extends StatelessWidget { | ||
const Body({ | ||
Key key, | ||
}) : super(key: key); | ||
- [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return StateBuilder( | ||
builder: (State state) => Column( | ||
children: <Widget>[ | ||
Text('Widget is animated on rebuild'), | ||
Animator( | ||
builder: (anim) => Center( | ||
child: Transform.scale( | ||
scale: anim.value, | ||
child: FlutterLogo(size: 50), | ||
), | ||
), | ||
), | ||
Divider(), | ||
Text('Widget is not animatted on rebuild'), | ||
Animator( | ||
animateOnRebuild: false, | ||
builder: (anim) => Center( | ||
child: Transform.scale( | ||
scale: anim.value, | ||
child: FlutterLogo(size: 50), | ||
), | ||
), | ||
), | ||
Divider(), | ||
Text('Animation is reset on rebuild.'), | ||
Animator( | ||
resetAnimationOnRebuild: true, | ||
curve: mainBloc.toggleCurve ? Curves.linear : Curves.elasticOut, | ||
builder: (anim) => Center( | ||
child: Transform.scale( | ||
scale: anim.value, | ||
child: FlutterLogo(size: 50), | ||
), | ||
), | ||
), | ||
RaisedButton( | ||
child: Text('Rebuild'), | ||
onPressed: () => mainBloc.rebuild(state), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} | ||
``` | ||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.io/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. |
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
2 changes: 1 addition & 1 deletion
2
...android/app/src/debug/AndroidManifest.xml → ...android/app/src/debug/AndroidManifest.xml
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
2 changes: 1 addition & 1 deletion
2
...xample/basic_animation1/MainActivity.java → ...ava/com/example/example/MainActivity.java
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
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...droid/app/src/profile/AndroidManifest.xml → ...droid/app/src/profile/AndroidManifest.xml
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
example/basic_animation0/android/app/src/debug/AndroidManifest.xml
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
example/basic_animation0/android/app/src/main/AndroidManifest.xml
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...asic_animation0/android/app/src/main/java/com/example/basic_animation_0/MainActivity.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
example/basic_animation0/android/app/src/profile/AndroidManifest.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.