Skip to content

Commit

Permalink
Refactor example folder
Browse files Browse the repository at this point in the history
  • Loading branch information
GIfatahTH committed Mar 29, 2019
1 parent 326928d commit 6e3a661
Show file tree
Hide file tree
Showing 127 changed files with 249 additions and 1,126 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "Flutter",
"request": "launch",
"type": "dart",
"program": "example/basic_animation0/lib/main.dart"
"program": "example/lib/main.dart"
}
]
}
File renamed without changes.
File renamed without changes.
84 changes: 10 additions & 74 deletions example/README.md
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.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.basic_animation1"
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.basic_animation1">
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.basic_animation1">
package="com.example.example">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand All @@ -8,7 +8,7 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="basic_animation1"
android:label="example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.basic_animation1;
package com.example.example;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.basic_animation1">
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 0 additions & 16 deletions example/basic_animation0/README.md

This file was deleted.

61 changes: 0 additions & 61 deletions example/basic_animation0/android/app/build.gradle

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions example/basic_animation0/android/app/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

93 changes: 0 additions & 93 deletions example/basic_animation0/lib/main.dart

This file was deleted.

Loading

0 comments on commit 6e3a661

Please sign in to comment.