├── res └── values │ └── strings_en.arb ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── animations_flutter │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Info.plist │ └── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── easing.gif ├── offset.gif ├── parent.gif ├── trans.gif ├── value.gif ├── animtions.gif ├── .metadata ├── lib ├── ac │ ├── ac.dart │ ├── flight.dart │ ├── gradient.dart │ └── charts.dart ├── main.dart ├── ui │ ├── value.dart │ ├── trans.dart │ ├── spring.dart │ ├── easing.dart │ ├── mask.dart │ ├── offset.dart │ └── parent.dart └── curves_d.dart ├── test └── widget_test.dart ├── .gitignore ├── pubspec.yaml ├── pubspec.lock └── README.md /res/values/strings_en.arb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /easing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/easing.gif -------------------------------------------------------------------------------- /offset.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/offset.gif -------------------------------------------------------------------------------- /parent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/parent.gif -------------------------------------------------------------------------------- /trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/trans.gif -------------------------------------------------------------------------------- /value.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/value.gif -------------------------------------------------------------------------------- /animtions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/animtions.gif -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlgchg/animations_flutter/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/animations_flutter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.animations_flutter; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/ac/ac.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'charts.dart'; 4 | import 'flight.dart'; 5 | import 'gradient.dart'; 6 | 7 | /* 8 | * @Date: 2019-03-28 14:21 9 | * @Description TODO 10 | */ 11 | 12 | class AnimatedC extends StatefulWidget { 13 | @override 14 | _AnimatedCState createState() => _AnimatedCState(); 15 | } 16 | 17 | class _AnimatedCState extends State { 18 | @override 19 | Widget build(BuildContext context) { 20 | List list = [ 21 | Charts(), 22 | Flight(), 23 | GradientP(), 24 | ]; 25 | return Scaffold( 26 | appBar: AppBar( 27 | title: Text('AnimatedContainer'), 28 | ), 29 | body: ListView( 30 | children: list.map((widget) { 31 | return ListTile( 32 | title: Text(widget.toString()), 33 | onTap: () { 34 | Navigator.of(context).push( 35 | MaterialPageRoute(builder: (context) => widget), 36 | ); 37 | }, 38 | ); 39 | }).toList(), 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:animations_flutter/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/ac/flight.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 14:36 6 | * @Description TODO 7 | */ 8 | 9 | class Flight extends StatefulWidget { 10 | @override 11 | _FlightState createState() => _FlightState(); 12 | } 13 | 14 | class _FlightState extends State { 15 | var _alignment = Alignment.bottomCenter; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar(), 21 | body: AnimatedContainer( 22 | duration: Duration(seconds: 2), 23 | padding: EdgeInsets.all(10.0), 24 | alignment: _alignment, 25 | child: Container( 26 | child: Icon( 27 | Icons.airplanemode_active, 28 | size: 50.0, 29 | color: Colors.blueAccent, 30 | ), 31 | ), 32 | ), 33 | floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, 34 | floatingActionButton: FloatingActionButton.extended( 35 | onPressed: () { 36 | setState(() { 37 | _alignment = Alignment.center; 38 | }); 39 | }, 40 | icon: Icon(Icons.airplanemode_active), 41 | label: Text('Flight'), 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'ui/easing.dart'; 3 | import 'ui/offset.dart'; 4 | import 'ui/parent.dart'; 5 | import 'ui/trans.dart'; 6 | import 'ui/value.dart'; 7 | import 'ui/mask.dart'; 8 | import 'ui/spring.dart'; 9 | import 'ac/ac.dart'; 10 | import 'curves_d.dart'; 11 | 12 | void main() => runApp(MyApp()); 13 | 14 | class MyApp extends StatelessWidget { 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | 19 | return MaterialApp( 20 | title: 'Flutter Demo', 21 | theme: ThemeData( 22 | primarySwatch: Colors.blue, 23 | ), 24 | home: Main(), 25 | ); 26 | } 27 | } 28 | 29 | class Main extends StatelessWidget { 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | List list = [ 34 | EasingAnimation(), 35 | OffsetAnimation(), 36 | ParentAnimation(), 37 | TransAnimation(), 38 | ValueAnimation(), 39 | SpringAnimation(), 40 | MaskAnimation(), 41 | AnimatedC(), 42 | CurvesDemo(), 43 | ]; 44 | return Scaffold( 45 | appBar: AppBar( 46 | title: Text('Animations'), 47 | ), 48 | body: ListView( 49 | children: list.map((widget) { 50 | return ListTile( 51 | title: Text(widget.toString()), 52 | onTap: () { 53 | Navigator.of(context).push( 54 | MaterialPageRoute(builder: (context) => widget), 55 | ); 56 | }, 57 | ); 58 | }).toList(), 59 | ), 60 | ); 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /lib/ac/gradient.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 14:42 6 | * @Description TODO 7 | */ 8 | 9 | class GradientP extends StatefulWidget { 10 | @override 11 | _GradientState createState() => _GradientState(); 12 | } 13 | 14 | class _GradientState extends State { 15 | var top = FractionalOffset.topCenter; 16 | var bottom = FractionalOffset.bottomCenter; 17 | var list = [ 18 | Colors.lightGreen, 19 | Colors.redAccent, 20 | ]; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar(), 26 | body: Center( 27 | child: AnimatedContainer( 28 | height: 300.0, 29 | width: 300.0, 30 | duration: Duration(seconds: 1), 31 | decoration: BoxDecoration( 32 | gradient: LinearGradient( 33 | begin: top, 34 | end: bottom, 35 | colors: list, 36 | stops: [0.0, 1.0], 37 | ), 38 | color: Colors.lightGreen, 39 | ), 40 | ), 41 | ), 42 | floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, 43 | floatingActionButton: FloatingActionButton.extended( 44 | onPressed: () { 45 | setState(() { 46 | top = FractionalOffset.bottomLeft; 47 | bottom = FractionalOffset.topRight; 48 | list = [Colors.blueAccent, Colors.yellowAccent]; 49 | }); 50 | }, 51 | icon: Icon(Icons.update), 52 | label: Text("Transform"), 53 | ), 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/ui/value.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 10:08 6 | * @Description TODO 7 | */ 8 | 9 | class ValueAnimation extends StatefulWidget { 10 | @override 11 | _ValueAnimationState createState() => _ValueAnimationState(); 12 | } 13 | 14 | class _ValueAnimationState extends State with TickerProviderStateMixin { 15 | AnimationController controller; 16 | Animation animation; 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | 22 | controller = AnimationController( 23 | duration: const Duration(milliseconds: 1000), vsync: this); 24 | final Animation curve = 25 | CurvedAnimation(parent: controller, curve: Curves.easeOut); 26 | animation = IntTween(begin: 0, end: 10).animate(curve) 27 | ..addStatusListener((status) { 28 | if (status == AnimationStatus.completed) { 29 | controller.reverse(); 30 | } 31 | if (status == AnimationStatus.dismissed) { 32 | Navigator.pop(context); 33 | } 34 | }); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | controller.forward(); 40 | return AnimatedBuilder( 41 | animation: controller, 42 | builder: (BuildContext context, Widget child) { 43 | return Scaffold( 44 | body: new Center( 45 | child: Text(animation.value.toString(), style: TextStyle(fontSize: 48.0)), 46 | )); 47 | }); 48 | } 49 | 50 | @override 51 | void dispose() { 52 | controller.dispose(); 53 | super.dispose(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | animations_flutter 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.animations_flutter" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /lib/ui/trans.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 09:59 6 | * @Description TODO 7 | */ 8 | 9 | class TransAnimation extends StatefulWidget { 10 | @override 11 | _TransAnimationState createState() => _TransAnimationState(); 12 | } 13 | 14 | class _TransAnimationState extends State 15 | with TickerProviderStateMixin { 16 | AnimationController controller; 17 | Animation animation, borderAnimation; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | controller = AnimationController( 23 | vsync: this, 24 | duration: Duration(milliseconds: 2000), 25 | )..addStatusListener((status) { 26 | if (status == AnimationStatus.completed) { 27 | controller.reverse(); 28 | } 29 | if (status == AnimationStatus.dismissed) { 30 | Navigator.pop(context); 31 | } 32 | }); 33 | 34 | animation = Tween(begin: 50.0, end: 200.0).animate( 35 | CurvedAnimation( 36 | parent: controller, 37 | curve: Curves.ease, 38 | ), 39 | ); 40 | 41 | borderAnimation = BorderRadiusTween( 42 | begin: BorderRadius.circular(75.0), 43 | end: BorderRadius.circular(0.0), 44 | ).animate(CurvedAnimation( 45 | parent: controller, 46 | curve: Curves.ease, 47 | )); 48 | 49 | controller.forward(); 50 | } 51 | 52 | @override 53 | void dispose() { 54 | controller.dispose(); 55 | super.dispose(); 56 | } 57 | 58 | @override 59 | Widget build(BuildContext context) { 60 | return Scaffold( 61 | appBar: AppBar(title: Text(widget.toString()),), 62 | body: AnimatedBuilder(animation: controller, builder: (context, child) { 63 | return Center( 64 | child: Container( 65 | width: animation.value, 66 | height: animation.value, 67 | decoration: BoxDecoration( 68 | borderRadius: borderAnimation.value, 69 | color: Colors.pink, 70 | ), 71 | ), 72 | ); 73 | }), 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/ac/charts.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 14:23 6 | * @Description TODO 7 | */ 8 | 9 | class Charts extends StatefulWidget { 10 | @override 11 | _ChartsState createState() => _ChartsState(); 12 | } 13 | 14 | class _ChartsState extends State { 15 | var height = 100.0; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar(), 21 | body: Center( 22 | child: Container( 23 | height: 400, 24 | alignment: AlignmentDirectional.bottomStart, 25 | child: InkWell( 26 | onTap: (){ 27 | setState(() { 28 | height = 320; 29 | }); 30 | }, 31 | child: Row( 32 | crossAxisAlignment: CrossAxisAlignment.end, 33 | mainAxisAlignment: MainAxisAlignment.center, 34 | children: [ 35 | AnimatedContainer( 36 | duration: Duration(seconds: 1), 37 | width: 40.0, 38 | height: height - 40, 39 | color: Colors.greenAccent, 40 | ), 41 | AnimatedContainer( 42 | margin: EdgeInsets.only(left: 10.0), 43 | duration: Duration(seconds: 2), 44 | width: 40.0, 45 | height: height - 10, 46 | color: Colors.yellow, 47 | ), 48 | AnimatedContainer( 49 | margin: EdgeInsets.only(left: 10.0), 50 | duration: Duration(seconds: 3), 51 | width: 40.0, 52 | height: height - 60, 53 | color: Colors.red, 54 | ), 55 | AnimatedContainer( 56 | margin: EdgeInsets.only(left: 10.0), 57 | duration: Duration(seconds: 2), 58 | width: 40.0, 59 | height: height - 50, 60 | color: Colors.blue, 61 | ), 62 | ], 63 | ), 64 | ), 65 | ), 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/ui/spring.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/physics.dart'; 4 | /* 5 | * @Date: 2019-03-28 10:10 6 | * @Description TODO 7 | */ 8 | 9 | class SpringAnimation extends StatefulWidget { 10 | @override 11 | _SpringAnimationState createState() => _SpringAnimationState(); 12 | } 13 | 14 | class _SpringAnimationState extends Statewith SingleTickerProviderStateMixin { 15 | 16 | double _squareEdgeSize = 200.0; 17 | SpringDescription _spring = new SpringDescription(mass: 1.0, stiffness: 100.0, damping: 10.0); 18 | SpringSimulation _springSimulation; 19 | AnimationController _animationController; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | final double height = MediaQuery.of(context).size.height; 24 | _springSimulation = new SpringSimulation(_spring, _squareEdgeSize, height, _animationController.velocity); 25 | startAnimationWithDelay(); 26 | return AnimatedBuilder( 27 | animation: _animationController, 28 | builder: (BuildContext context, Widget child) { 29 | return Scaffold( 30 | body: Transform( 31 | transform: Matrix4.translationValues(0.0, _squareEdgeSize - 200.0, 0.0), 32 | child: new Align( 33 | alignment: Alignment.topCenter, 34 | child: Container( 35 | width: 200.0, 36 | height: 200.0, 37 | color: Colors.black12, 38 | )), 39 | )); 40 | }); 41 | } 42 | 43 | @override 44 | initState() { 45 | super.initState(); 46 | _animationController = new AnimationController( 47 | vsync: this, 48 | lowerBound: double.negativeInfinity, 49 | upperBound: double.infinity, 50 | )..addListener(() { 51 | setState(() { 52 | _squareEdgeSize = _animationController.value; 53 | }); 54 | }); 55 | } 56 | 57 | void startAnimationWithDelay() async { 58 | if (!_animationController.isAnimating) { 59 | await new Future.delayed(const Duration(milliseconds: 500)); 60 | _animationController.animateWith(_springSimulation); 61 | } 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /lib/ui/easing.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @TIME 2019-03-27 21:58 6 | * @DES TODO 7 | */ 8 | 9 | class EasingAnimation extends StatefulWidget { 10 | @override 11 | _EasingAnimationState createState() => _EasingAnimationState(); 12 | } 13 | 14 | class _EasingAnimationState extends State 15 | with TickerProviderStateMixin { 16 | AnimationController _controller; 17 | Animation _animation; 18 | 19 | @override 20 | void initState() { 21 | // TODO: implement initState 22 | super.initState(); 23 | 24 | _controller = AnimationController( 25 | vsync: this, 26 | duration: const Duration(seconds: 2), 27 | ); 28 | _animation = Tween(begin: -1.0, end: 0.0).animate( 29 | CurvedAnimation( 30 | parent: _controller, 31 | curve: Curves.fastOutSlowIn, 32 | ), 33 | )..addStatusListener(_handler); 34 | } 35 | 36 | _handler(status) { 37 | if (status == AnimationStatus.completed) { 38 | _animation.removeStatusListener(_handler); 39 | _controller.reset(); 40 | _animation = Tween(begin: 0.0, end: 1.0).animate( 41 | CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn), 42 | )..addStatusListener( 43 | (status) { 44 | if (status == AnimationStatus.completed) { 45 | Navigator.pop(context); 46 | } 47 | }, 48 | ); 49 | _controller.forward(); 50 | } 51 | } 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | final double width = MediaQuery.of(context).size.width; 56 | _controller.forward(); 57 | return Scaffold( 58 | appBar: AppBar( 59 | title: Text(widget.toString()), 60 | ), 61 | body: AnimatedBuilder( 62 | animation: _controller, 63 | builder: (context, child) { 64 | return Transform( 65 | transform: Matrix4.translationValues( 66 | _animation.value * width, 67 | 0.0, 68 | 0.0, 69 | ), 70 | child: Center( 71 | child: Container( 72 | width: 200.0, 73 | height: 200.0, 74 | color: Colors.blue, 75 | ), 76 | ), 77 | ); 78 | }, 79 | ), 80 | ); 81 | } 82 | 83 | @override 84 | void dispose() { 85 | _controller.dispose(); 86 | super.dispose(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/ui/mask.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 10:11 6 | * @Description TODO 7 | */ 8 | 9 | class MaskAnimation extends StatefulWidget { 10 | @override 11 | _MaskAnimationState createState() => _MaskAnimationState(); 12 | } 13 | 14 | class _MaskAnimationState extends State 15 | with TickerProviderStateMixin { 16 | AnimationController _controller; 17 | Animation transitionTween; 18 | Animation borderRadius; 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | 24 | _controller = 25 | AnimationController(duration: const Duration(seconds: 2), vsync: this) 26 | ..addStatusListener((status) { 27 | if (status == AnimationStatus.completed) { 28 | Navigator.pop(context); 29 | } 30 | }); 31 | 32 | transitionTween = Tween( 33 | begin: 50.0, 34 | end: 200.0, 35 | ).animate( 36 | CurvedAnimation( 37 | parent: _controller, 38 | curve: Curves.ease, 39 | ), 40 | ); 41 | borderRadius = BorderRadiusTween( 42 | begin: BorderRadius.circular(75.0), 43 | end: BorderRadius.circular(0.0), 44 | ).animate( 45 | CurvedAnimation( 46 | parent: _controller, 47 | curve: Curves.ease, 48 | ), 49 | ); 50 | _controller.forward(); 51 | } 52 | 53 | @override 54 | void dispose() { 55 | _controller.dispose(); 56 | super.dispose(); 57 | } 58 | 59 | @override 60 | Widget build(BuildContext context) { 61 | return AnimatedBuilder( 62 | animation: _controller, 63 | builder: (BuildContext context, Widget child) { 64 | return Scaffold( 65 | body: new Center( 66 | child: new Stack( 67 | children: [ 68 | new Center( 69 | child: Container( 70 | width: 200.0, 71 | height: 200.0, 72 | color: Colors.black12, 73 | )), 74 | new Center( 75 | child: Container( 76 | alignment: Alignment.bottomCenter, 77 | width: transitionTween.value, 78 | height: transitionTween.value, 79 | decoration: BoxDecoration( 80 | color: Colors.black12, 81 | borderRadius: borderRadius.value, 82 | ), 83 | )), 84 | ], 85 | ))); 86 | }, 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: animations_flutter 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | 31 | 32 | # For information on the generic Dart part of this file, see the 33 | # following page: https://www.dartlang.org/tools/pub/pubspec 34 | 35 | # The following section is specific to Flutter. 36 | flutter: 37 | 38 | # The following line ensures that the Material Icons font is 39 | # included with your application, so that you can use the icons in 40 | # the material Icons class. 41 | uses-material-design: true 42 | 43 | # To add assets to your application, add an assets section, like this: 44 | # assets: 45 | # - images/a_dot_burr.jpeg 46 | # - images/a_dot_ham.jpeg 47 | 48 | # An image asset can refer to one or more resolution-specific "variants", see 49 | # https://flutter.io/assets-and-images/#resolution-aware. 50 | 51 | # For details regarding adding assets from package dependencies, see 52 | # https://flutter.io/assets-and-images/#from-packages 53 | 54 | # To add custom fonts to your application, add a fonts section here, 55 | # in this "flutter" section. Each entry in this list should have a 56 | # "family" key with the font family name, and a "fonts" key with a 57 | # list giving the asset and other descriptors for the font. For 58 | # example: 59 | # fonts: 60 | # - family: Schyler 61 | # fonts: 62 | # - asset: fonts/Schyler-Regular.ttf 63 | # - asset: fonts/Schyler-Italic.ttf 64 | # style: italic 65 | # - family: Trajan Pro 66 | # fonts: 67 | # - asset: fonts/TrajanPro.ttf 68 | # - asset: fonts/TrajanPro_Bold.ttf 69 | # weight: 700 70 | # 71 | # For details regarding fonts from package dependencies, 72 | # see https://flutter.io/custom-fonts/#from-packages 73 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /lib/ui/offset.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 09:13 6 | * @Description TODO 7 | */ 8 | 9 | class OffsetAnimation extends StatefulWidget { 10 | @override 11 | _OffsetAnimationState createState() => _OffsetAnimationState(); 12 | } 13 | 14 | class _OffsetAnimationState extends State 15 | with TickerProviderStateMixin { 16 | AnimationController _controller; 17 | Animation _animation, _lateAnimation; 18 | 19 | @override 20 | void initState() { 21 | // TODO: implement initState 22 | super.initState(); 23 | _controller = 24 | AnimationController(vsync: this, duration: Duration(seconds: 2)); 25 | _animation = Tween(begin: -1.0, end: 0.0).animate( 26 | CurvedAnimation( 27 | parent: _controller, 28 | curve: Curves.fastOutSlowIn, 29 | ), 30 | )..addStatusListener(_handler); 31 | _lateAnimation = Tween(begin: -1.0, end: 0.0).animate( 32 | CurvedAnimation( 33 | parent: _controller, 34 | curve: Interval(0.2, 1.0, curve: Curves.fastOutSlowIn), 35 | ), 36 | ); 37 | } 38 | 39 | _handler(status) { 40 | if (status == AnimationStatus.completed) { 41 | _animation.removeStatusListener(_handler); 42 | _controller.reset(); 43 | _animation = Tween(begin: 0.0, end: 1.0).animate( 44 | CurvedAnimation( 45 | parent: _controller, 46 | curve: Curves.fastOutSlowIn, 47 | ), 48 | ); 49 | _lateAnimation = Tween(begin: 0.0, end: 1.0).animate( 50 | CurvedAnimation( 51 | parent: _controller, 52 | curve: Interval(0.2, 1.0, curve: Curves.fastOutSlowIn), 53 | ), 54 | )..addStatusListener((status) { 55 | if (status == AnimationStatus.completed) { 56 | Navigator.pop(context); 57 | } 58 | }); 59 | _controller.forward(); 60 | } 61 | } 62 | 63 | @override 64 | Widget build(BuildContext context) { 65 | final double width = MediaQuery.of(context).size.width; 66 | _controller.forward(); 67 | return Scaffold( 68 | appBar: AppBar( 69 | title: Text(widget.toString()), 70 | ), 71 | body: AnimatedBuilder( 72 | animation: _controller, 73 | builder: (context, child) { 74 | return Center( 75 | child: Column( 76 | children: [ 77 | Transform( 78 | transform: Matrix4.translationValues( 79 | _animation.value * width, 0.0, 0.0), 80 | child: Container( 81 | margin: EdgeInsets.all(10), 82 | width: 200, 83 | height: 50, 84 | color: Colors.red, 85 | ), 86 | ), 87 | Transform( 88 | transform: Matrix4.translationValues( 89 | _animation.value * width, 0.0, 0.0), 90 | child: Container( 91 | margin: EdgeInsets.all(10), 92 | width: 200, 93 | height: 50, 94 | color: Colors.red, 95 | ), 96 | ), 97 | Transform( 98 | transform: Matrix4.translationValues( 99 | _lateAnimation.value * width, 0.0, 0.0), 100 | child: Container( 101 | margin: EdgeInsets.all(10), 102 | width: 200, 103 | height: 50, 104 | color: Colors.red, 105 | ), 106 | ), 107 | ], 108 | ), 109 | ); 110 | }, 111 | ), 112 | ); 113 | } 114 | 115 | @override 116 | void dispose() { 117 | _controller.dispose(); 118 | super.dispose(); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.0.8" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.0.4" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.14.11" 32 | cupertino_icons: 33 | dependency: "direct main" 34 | description: 35 | name: cupertino_icons 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "0.1.2" 39 | flutter: 40 | dependency: "direct main" 41 | description: flutter 42 | source: sdk 43 | version: "0.0.0" 44 | flutter_test: 45 | dependency: "direct dev" 46 | description: flutter 47 | source: sdk 48 | version: "0.0.0" 49 | matcher: 50 | dependency: transitive 51 | description: 52 | name: matcher 53 | url: "https://pub.flutter-io.cn" 54 | source: hosted 55 | version: "0.12.3+1" 56 | meta: 57 | dependency: transitive 58 | description: 59 | name: meta 60 | url: "https://pub.flutter-io.cn" 61 | source: hosted 62 | version: "1.1.6" 63 | path: 64 | dependency: transitive 65 | description: 66 | name: path 67 | url: "https://pub.flutter-io.cn" 68 | source: hosted 69 | version: "1.6.2" 70 | pedantic: 71 | dependency: transitive 72 | description: 73 | name: pedantic 74 | url: "https://pub.flutter-io.cn" 75 | source: hosted 76 | version: "1.4.0" 77 | quiver: 78 | dependency: transitive 79 | description: 80 | name: quiver 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "2.0.1" 84 | sky_engine: 85 | dependency: transitive 86 | description: flutter 87 | source: sdk 88 | version: "0.0.99" 89 | source_span: 90 | dependency: transitive 91 | description: 92 | name: source_span 93 | url: "https://pub.flutter-io.cn" 94 | source: hosted 95 | version: "1.5.4" 96 | stack_trace: 97 | dependency: transitive 98 | description: 99 | name: stack_trace 100 | url: "https://pub.flutter-io.cn" 101 | source: hosted 102 | version: "1.9.3" 103 | stream_channel: 104 | dependency: transitive 105 | description: 106 | name: stream_channel 107 | url: "https://pub.flutter-io.cn" 108 | source: hosted 109 | version: "1.6.8" 110 | string_scanner: 111 | dependency: transitive 112 | description: 113 | name: string_scanner 114 | url: "https://pub.flutter-io.cn" 115 | source: hosted 116 | version: "1.0.4" 117 | term_glyph: 118 | dependency: transitive 119 | description: 120 | name: term_glyph 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "1.1.0" 124 | test_api: 125 | dependency: transitive 126 | description: 127 | name: test_api 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "0.2.2" 131 | typed_data: 132 | dependency: transitive 133 | description: 134 | name: typed_data 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "1.1.6" 138 | vector_math: 139 | dependency: transitive 140 | description: 141 | name: vector_math 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "2.0.8" 145 | sdks: 146 | dart: ">=2.1.0 <3.0.0" 147 | -------------------------------------------------------------------------------- /lib/curves_d.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 17:01 6 | * @Description TODO 7 | */ 8 | 9 | class CurvesDemo extends StatefulWidget { 10 | @override 11 | _CurvesDemoState createState() => _CurvesDemoState(); 12 | } 13 | 14 | class _CurvesDemoState extends State with TickerProviderStateMixin { 15 | AnimationController controller; 16 | List list = [ 17 | 'easeAnimation', 18 | 'easeInAnimation', 19 | 'easeInToLinearAnimation', 20 | 'easeInSineAnimation', 21 | 'easeInQuadAnimation', 22 | 'easeInCubicAnimation', 23 | 'easeInQuartAnimation', 24 | 'easeInQuintAnimation', 25 | 'easeInExpoAnimation', 26 | 'easeInCricAnimation', 27 | 'easeInBackAnimation', 28 | 'easeOutAnimation', 29 | 'linearToEaseOutAnimation', 30 | 'easeOutSineAnimation', 31 | 'easeOutQuadAnimation', 32 | 'easeOutCubicAnimation', 33 | 'easeOutQuintAnimation', 34 | 'easeOutQuartAnimation', 35 | 'easeOutExpoAnimation', 36 | 'easeOutCircAnimation', 37 | 'easeOutBackAnimation', 38 | 'easeInOutAnimation', 39 | 'easeInOutQuadAnimation', 40 | 'easeInOutSineAnimation', 41 | 'easeInOutCubicAnimation', 42 | 'easeInOutQuartAnimation', 43 | 'easeInOutQuintAnimation', 44 | 'easeInOutExpoAnimation', 45 | 'easeInOutCircAnimation', 46 | 'easeInOutBackAnimation', 47 | 'fastOutSlowInAnimation', 48 | 'fastLinearToSlowEaseInAnimation', 49 | ]; 50 | List cubics = [ 51 | Curves.easeIn, 52 | Curves.easeInToLinear, 53 | Curves.easeInSine, 54 | Curves.easeInQuad, 55 | Curves.easeInCubic, 56 | Curves.easeInQuart, 57 | Curves.easeInQuint, 58 | Curves.easeInExpo, 59 | Curves.easeInCirc, 60 | Curves.easeInBack, 61 | Curves.easeOut, 62 | Curves.linearToEaseOut, 63 | Curves.easeOutSine, 64 | Curves.easeOutQuad, 65 | Curves.easeOutCubic, 66 | Curves.easeOutQuint, 67 | Curves.easeOutQuart, 68 | Curves.easeOutExpo, 69 | Curves.easeOutCirc, 70 | Curves.easeOutBack, 71 | Curves.easeInOut, 72 | Curves.easeInOutQuad, 73 | Curves.easeInOutSine, 74 | Curves.easeInOutCubic, 75 | Curves.easeInOutQuart, 76 | Curves.easeInOutQuint, 77 | Curves.easeInOutExpo, 78 | Curves.easeInOutCirc, 79 | Curves.easeInOutBack, 80 | Curves.fastOutSlowIn, 81 | Curves.fastLinearToSlowEaseIn 82 | ]; 83 | 84 | List animations = []; 85 | 86 | bool end = false; 87 | 88 | @override 89 | void initState() { 90 | super.initState(); 91 | _init(); 92 | } 93 | 94 | _init() { 95 | controller = 96 | AnimationController(vsync: this, duration: Duration(seconds: 2)); 97 | for (var i = 0; i < cubics.length; i++) { 98 | Animation animation = Tween(begin: -1.0, end: 0.0).animate( 99 | CurvedAnimation( 100 | parent: controller, 101 | curve: cubics[i], 102 | ), 103 | )..addStatusListener(_handler); 104 | animations.add(animation); 105 | } 106 | } 107 | 108 | 109 | _handler(status) { 110 | if (status == AnimationStatus.completed) { 111 | animations.map((animation) { 112 | animation.removeStatusListener(_handler); 113 | }); 114 | animations.clear(); 115 | controller.reset(); 116 | for (var i = 0; i < cubics.length; i++) { 117 | Animation animation = Tween(begin: 0.0, end: 1.0).animate( 118 | CurvedAnimation( 119 | parent: controller, 120 | curve: cubics[i], 121 | ), 122 | )..addStatusListener((status){ 123 | if(status == AnimationStatus.completed) { 124 | animations.map((animation) { 125 | animation.removeStatusListener(_handler); 126 | }); 127 | animations.clear(); 128 | controller.reset(); 129 | _init(); 130 | controller.forward(); 131 | } 132 | }); 133 | animations.add(animation); 134 | } 135 | end = !end; 136 | controller.forward(); 137 | } 138 | } 139 | 140 | @override 141 | Widget build(BuildContext context) { 142 | final double width = MediaQuery.of(context).size.width; 143 | controller.forward(); 144 | return Scaffold( 145 | appBar: AppBar( 146 | title: Text('Curves Type Demo'), 147 | ), 148 | body: AnimatedBuilder( 149 | animation: controller, 150 | builder: (context, child) { 151 | return ListView.builder( 152 | itemBuilder: (context, i) { 153 | return Center( 154 | child: Column( 155 | crossAxisAlignment: CrossAxisAlignment.center, 156 | mainAxisAlignment: MainAxisAlignment.center, 157 | children: [ 158 | Transform( 159 | transform: Matrix4.translationValues( 160 | animations[i].value * width, 161 | 0.0, 162 | 0.0, 163 | ), 164 | child: Container( 165 | width: 50.0, 166 | height: 50.0, 167 | color: Colors.black12, 168 | ), 169 | ), 170 | Text(list[i].toString()), 171 | ], 172 | ), 173 | ); 174 | }, 175 | itemCount: animations.length, 176 | ); 177 | }, 178 | ), 179 | ); 180 | } 181 | 182 | @override 183 | void dispose() { 184 | controller.dispose(); 185 | super.dispose(); 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /lib/ui/parent.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | /* 5 | * @Date: 2019-03-28 09:30 6 | * @Description TODO 7 | */ 8 | 9 | class ParentAnimation extends StatefulWidget { 10 | @override 11 | _ParentAnimationState createState() => _ParentAnimationState(); 12 | } 13 | 14 | class _ParentAnimationState extends State 15 | with TickerProviderStateMixin { 16 | AnimationController _controller; 17 | Animation _animation, _growAnimation; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | _controller = 23 | AnimationController(vsync: this, duration: Duration(seconds: 2)); 24 | _growAnimation = Tween(begin: 10.0, end: 100.0) 25 | .animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn)); 26 | _animation = Tween(begin: -0.25, end: 0.0).animate( 27 | CurvedAnimation( 28 | parent: _controller, 29 | curve: Curves.easeIn, 30 | ), 31 | )..addStatusListener((status) { 32 | if (status == AnimationStatus.completed) { 33 | _controller.reverse(); 34 | } 35 | if (status == AnimationStatus.dismissed) { 36 | Navigator.pop(context); 37 | } 38 | }); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | final double width = MediaQuery.of(context).size.width; 44 | _controller.forward(); 45 | return Scaffold( 46 | appBar: AppBar( 47 | title: Text(widget.toString()), 48 | ), 49 | body: AnimatedBuilder( 50 | animation: _controller, 51 | builder: (context, child) { 52 | return Column( 53 | crossAxisAlignment: CrossAxisAlignment.center, 54 | mainAxisAlignment: MainAxisAlignment.center, 55 | children: [ 56 | Transform( 57 | transform: Matrix4.translationValues( 58 | _animation.value * width, 0.0, 0.0), 59 | child: Center( 60 | child: Container( 61 | height: _growAnimation.value, 62 | width: _growAnimation.value * 2, 63 | color: Colors.black12, 64 | ))), 65 | Transform( 66 | transform: Matrix4.translationValues( 67 | _animation.value * width, 68 | 0.0, 69 | 0.0, 70 | ), 71 | child: Center( 72 | child: Container( 73 | padding: EdgeInsets.only(top: 16.0), 74 | child: Container( 75 | width: 200.0, 76 | height: 100.0, 77 | color: Colors.black12, 78 | ), 79 | ), 80 | ), 81 | ) 82 | ], 83 | ); 84 | }, 85 | ), 86 | ); 87 | } 88 | 89 | @override 90 | void dispose() { 91 | _controller.dispose(); 92 | super.dispose(); 93 | } 94 | } 95 | 96 | /* 97 | * import 'package:flutter/material.dart'; 98 | import 'package:flutter/cupertino.dart'; 99 | 100 | /* 101 | * @Date: 2019-03-28 09:30 102 | * @Description TODO 103 | */ 104 | 105 | class ParentAnimation extends StatefulWidget { 106 | @override 107 | _ParentAnimationState createState() => _ParentAnimationState(); 108 | } 109 | 110 | class _ParentAnimationState extends State 111 | with TickerProviderStateMixin { 112 | Animation growingAnimation; 113 | Animation animation; 114 | AnimationController controller; 115 | 116 | @override 117 | void initState() { 118 | super.initState(); 119 | controller = 120 | AnimationController(duration: const Duration(seconds: 2), vsync: this); 121 | growingAnimation = Tween(begin: 10.0, end: 100.0) 122 | .animate(CurvedAnimation(parent: controller, curve: Curves.easeIn)); 123 | animation = Tween(begin: -0.25, end: 0.0).animate(CurvedAnimation( 124 | parent: controller, 125 | curve: Curves.easeIn, 126 | )) 127 | ..addStatusListener((status) { 128 | if (status == AnimationStatus.completed) { 129 | controller.reverse(); 130 | } 131 | if (status == AnimationStatus.dismissed) { 132 | Navigator.pop(context); 133 | } 134 | }); 135 | } 136 | 137 | @override 138 | Widget build(BuildContext context) { 139 | final double width = MediaQuery.of(context).size.width; 140 | controller.forward(); 141 | return Scaffold( 142 | appBar: AppBar( 143 | title: Text(widget.toString()), 144 | ), 145 | body: AnimatedBuilder( 146 | animation: controller, 147 | builder: (context, child) { 148 | return Column( 149 | crossAxisAlignment: CrossAxisAlignment.center, 150 | mainAxisAlignment: MainAxisAlignment.center, 151 | children: [ 152 | Transform( 153 | transform: Matrix4.translationValues( 154 | animation.value * width, 0.0, 0.0), 155 | child: Center( 156 | child: Container( 157 | height: growingAnimation.value, 158 | width: growingAnimation.value * 2, 159 | color: Colors.black12, 160 | ))), 161 | Transform( 162 | transform: Matrix4.translationValues( 163 | animation.value * width, 164 | 0.0, 165 | 0.0, 166 | ), 167 | child: Center( 168 | child: Container( 169 | padding: EdgeInsets.only(top: 16.0), 170 | child: Container( 171 | width: 200.0, 172 | height: 100.0, 173 | color: Colors.black12, 174 | ), 175 | ), 176 | ), 177 | ) 178 | ], 179 | ); 180 | }, 181 | ), 182 | ); 183 | } 184 | 185 | @override 186 | void dispose() { 187 | controller.dispose(); 188 | super.dispose(); 189 | } 190 | } 191 | 192 | * */ 193 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # animations_flutter 2 | 3 | Flutter 动画的基本使用 4 | 5 | ![easing](https://github.com/dlgchg/animations_flutter/blob/master/easing.gif?raw=true) 6 | ![offset](https://github.com/dlgchg/animations_flutter/blob/master/offset.gif?raw=true) 7 | ![parent](https://github.com/dlgchg/animations_flutter/blob/master/parent.gif?raw=true) 8 | ![trans](https://github.com/dlgchg/animations_flutter/blob/master/trans.gif?raw=true) 9 | ![value](https://github.com/dlgchg/animations_flutter/blob/master/value.gif?raw=true) 10 | 11 | 12 | 在使用Flutter动画的时候,我们通常使用这几个组件. 13 | * `AnimationController`,控制动画的抽象类 14 | * `Animation`,给定值,转换为动画 15 | * `Tween`, 执行范围 16 | * `AnimatedBuilder`, 处理动画的Widget 17 | 18 | ## 简单平移 19 | 20 | 首先使用有状态的`StatefulWidget`,创建`AnimationController`和`Animation`,并在`initState`中初始化这两个对象. 21 | `vsync`需要使用`with TickerProviderStateMixin`,这样才是正常的进行动画的操作. 22 | 在`initState`方法中,声明这个动画执行时间为2秒.给`animation`添加一个监听事件,在动画完成后,将移除这个简单,并将`AnimationController`还原为初始状态,在执行一次动画. 23 | ```dart 24 | AnimationController _controller; 25 | Animation _animation; 26 | 27 | @override 28 | void initState() { 29 | super.initState(); 30 | 31 | _controller = AnimationController( 32 | vsync: this, 33 | duration: const Duration(seconds: 2), 34 | ); 35 | _animation = Tween(begin: -1.0, end: 0.0).animate( 36 | CurvedAnimation( 37 | parent: _controller, 38 | curve: Curves.fastOutSlowIn, 39 | ), 40 | )..addStatusListener(_handler); 41 | } 42 | 43 | _handler(status) { 44 | if (status == AnimationStatus.completed) { 45 | _animation.removeStatusListener(_handler); 46 | _controller.reset(); 47 | _animation = Tween(begin: 0.0, end: 1.0).animate( 48 | CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn), 49 | )..addStatusListener( 50 | (status) { 51 | if (status == AnimationStatus.completed) { 52 | Navigator.pop(context); 53 | } 54 | }, 55 | ); 56 | _controller.forward(); 57 | } 58 | } 59 | ``` 60 | 61 | 在`build`方法,使用`AnimatedBuilder`控件来对动画进行控制和处理,其中`animation`绑定之前定义的`AnimationController`. 62 | `Transform`控件可以将动画执行中的变量值处理反馈在子控件上. 63 | `Matrix4.translationValues`这里将子控件在x轴上进行平移. 64 | 通过`AnimationController`的`forward()`方法来执行动画. 65 | 66 | ```dart 67 | @override 68 | Widget build(BuildContext context) { 69 | final double width = MediaQuery.of(context).size.width; 70 | _controller.forward(); 71 | return Scaffold( 72 | appBar: AppBar( 73 | title: Text(widget.toString()), 74 | ), 75 | body: AnimatedBuilder( 76 | animation: _controller, 77 | builder: (context, child) { 78 | return Transform( 79 | transform: Matrix4.translationValues( 80 | _animation.value * width, 81 | 0.0, 82 | 0.0, 83 | ), 84 | child: Center( 85 | child: Container( 86 | width: 200.0, 87 | height: 200.0, 88 | color: Colors.blue, 89 | ), 90 | ), 91 | ); 92 | }, 93 | ), 94 | ); 95 | } 96 | ``` 97 | 98 | 最后一定要将`AnimationController`进行销毁. 99 | ```dart 100 | @override 101 | void dispose() { 102 | _controller.dispose(); 103 | super.dispose(); 104 | } 105 | ``` 106 | 下面就是刚刚的效果. 107 | 108 | ![easing](https://github.com/dlgchg/animations_flutter/blob/master/easing.gif?raw=true) 109 | 110 | 111 | ## 偏移和延迟 112 | 113 | 偏移和延迟代码还是按照上面的代码来,执行三个控件,并将其中一个延迟执行. 114 | 实现延迟操作,需要使用`Interval`来进行操作,`Interval`是一个可以返回`CurveAnimation`的一个类,设置`begin`和`end`的值,让动画知道在哪个点才开始执行. 115 | ```dart 116 | AnimationController _controller; 117 | Animation _animation, _lateAnimation; 118 | 119 | @override 120 | void initState() { 121 | // TODO: implement initState 122 | super.initState(); 123 | _controller = 124 | AnimationController(vsync: this, duration: Duration(seconds: 2)); 125 | _animation = Tween(begin: -1.0, end: 0.0).animate( 126 | CurvedAnimation( 127 | parent: _controller, 128 | curve: Curves.fastOutSlowIn, 129 | ), 130 | )..addStatusListener(_handler); 131 | _lateAnimation = Tween(begin: -1.0, end: 0.0).animate( 132 | CurvedAnimation( 133 | parent: _controller, 134 | curve: Interval(0.2, 1.0, curve: Curves.fastOutSlowIn), 135 | ), 136 | ); 137 | } 138 | 139 | _handler(status) { 140 | if (status == AnimationStatus.completed) { 141 | _animation.removeStatusListener(_handler); 142 | _controller.reset(); 143 | _animation = Tween(begin: 0.0, end: 1.0).animate( 144 | CurvedAnimation( 145 | parent: _controller, 146 | curve: Curves.fastOutSlowIn, 147 | ), 148 | ); 149 | _lateAnimation = Tween(begin: 0.0, end: 1.0).animate( 150 | CurvedAnimation( 151 | parent: _controller, 152 | curve: Interval(0.2, 1.0, curve: Curves.fastOutSlowIn), 153 | ), 154 | )..addStatusListener((status) { 155 | if (status == AnimationStatus.completed) { 156 | Navigator.pop(context); 157 | } 158 | }); 159 | _controller.forward(); 160 | } 161 | } 162 | 163 | @override 164 | Widget build(BuildContext context) { 165 | final double width = MediaQuery.of(context).size.width; 166 | _controller.forward(); 167 | return Scaffold( 168 | appBar: AppBar( 169 | title: Text(widget.toString()), 170 | ), 171 | body: AnimatedBuilder( 172 | animation: _controller, 173 | builder: (context, child) { 174 | return Center( 175 | child: Column( 176 | children: [ 177 | Transform( 178 | transform: Matrix4.translationValues( 179 | _animation.value * width, 0.0, 0.0), 180 | child: Container( 181 | margin: EdgeInsets.all(10), 182 | width: 200, 183 | height: 50, 184 | color: Colors.red, 185 | ), 186 | ), 187 | Transform( 188 | transform: Matrix4.translationValues( 189 | _animation.value * width, 0.0, 0.0), 190 | child: Container( 191 | margin: EdgeInsets.all(10), 192 | width: 200, 193 | height: 50, 194 | color: Colors.red, 195 | ), 196 | ), 197 | Transform( 198 | transform: Matrix4.translationValues( 199 | _lateAnimation.value * width, 0.0, 0.0), 200 | child: Container( 201 | margin: EdgeInsets.all(10), 202 | width: 200, 203 | height: 50, 204 | color: Colors.red, 205 | ), 206 | ), 207 | ], 208 | ), 209 | ); 210 | }, 211 | ), 212 | ); 213 | } 214 | 215 | @override 216 | void dispose() { 217 | _controller.dispose(); 218 | super.dispose(); 219 | } 220 | ``` 221 | 222 | 来看看效果. 223 | 224 | ![easing](https://github.com/dlgchg/animations_flutter/blob/master/offset.gif?raw=true) 225 | 226 | 227 | ## 转换 228 | 229 | 这里使用`BorderRadiusTween`来完成一个空间的转换动画,圆形转方形. 230 | 这里将初始化设为50的一个圆,`BorderRadiusTween`设置圆的弧度. 231 | 232 | ```dart 233 | AnimationController controller; 234 | Animation animation, borderAnimation; 235 | 236 | @override 237 | void initState() { 238 | super.initState(); 239 | controller = AnimationController( 240 | vsync: this, 241 | duration: Duration(milliseconds: 2000), 242 | )..addStatusListener((status) { 243 | if (status == AnimationStatus.completed) { 244 | controller.reverse(); 245 | } 246 | if (status == AnimationStatus.dismissed) { 247 | Navigator.pop(context); 248 | } 249 | }); 250 | 251 | animation = Tween(begin: 50.0, end: 200.0).animate( 252 | CurvedAnimation( 253 | parent: controller, 254 | curve: Curves.ease, 255 | ), 256 | ); 257 | 258 | borderAnimation = BorderRadiusTween( 259 | begin: BorderRadius.circular(75.0), 260 | end: BorderRadius.circular(0.0), 261 | ).animate(CurvedAnimation( 262 | parent: controller, 263 | curve: Curves.ease, 264 | )); 265 | 266 | controller.forward(); 267 | } 268 | 269 | @override 270 | void dispose() { 271 | controller.dispose(); 272 | super.dispose(); 273 | } 274 | 275 | @override 276 | Widget build(BuildContext context) { 277 | return Scaffold( 278 | appBar: AppBar(title: Text(widget.toString()),), 279 | body: AnimatedBuilder(animation: controller, builder: (context, child) { 280 | return Center( 281 | child: Container( 282 | width: animation.value, 283 | height: animation.value, 284 | decoration: BoxDecoration( 285 | borderRadius: borderAnimation.value, 286 | color: Colors.pink, 287 | ), 288 | ), 289 | ); 290 | }), 291 | ); 292 | } 293 | ``` 294 | 295 | ![trans](https://github.com/dlgchg/animations_flutter/blob/master/trans.gif?raw=true) 296 | 297 | 298 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXCopyFilesBuildPhase section */ 24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 25 | isa = PBXCopyFilesBuildPhase; 26 | buildActionMask = 2147483647; 27 | dstPath = ""; 28 | dstSubfolderSpec = 10; 29 | files = ( 30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 32 | ); 33 | name = "Embed Frameworks"; 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 43 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 44 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 62 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 9740EEB11CF90186004384FC /* Flutter */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 3B80C3931E831B6300D905FE /* App.framework */, 73 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 74 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 78 | ); 79 | name = Flutter; 80 | sourceTree = ""; 81 | }; 82 | 97C146E51CF9000F007C117D = { 83 | isa = PBXGroup; 84 | children = ( 85 | 9740EEB11CF90186004384FC /* Flutter */, 86 | 97C146F01CF9000F007C117D /* Runner */, 87 | 97C146EF1CF9000F007C117D /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 97C146EF1CF9000F007C117D /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 97C146EE1CF9000F007C117D /* Runner.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 97C146F01CF9000F007C117D /* Runner */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 103 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 104 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 105 | 97C147021CF9000F007C117D /* Info.plist */, 106 | 97C146F11CF9000F007C117D /* Supporting Files */, 107 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 108 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 109 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 110 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 111 | ); 112 | path = Runner; 113 | sourceTree = ""; 114 | }; 115 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 97C146ED1CF9000F007C117D /* Runner */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 128 | buildPhases = ( 129 | 9740EEB61CF901F6004384FC /* Run Script */, 130 | 97C146EA1CF9000F007C117D /* Sources */, 131 | 97C146EB1CF9000F007C117D /* Frameworks */, 132 | 97C146EC1CF9000F007C117D /* Resources */, 133 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 134 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = Runner; 141 | productName = Runner; 142 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 97C146E61CF9000F007C117D /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 0910; 152 | ORGANIZATIONNAME = "The Chromium Authors"; 153 | TargetAttributes = { 154 | 97C146ED1CF9000F007C117D = { 155 | CreatedOnToolsVersion = 7.3.1; 156 | LastSwiftMigration = 0910; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = English; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = 97C146E51CF9000F007C117D; 169 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 97C146ED1CF9000F007C117D /* Runner */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 97C146EC1CF9000F007C117D /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 184 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 185 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 186 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 187 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXResourcesBuildPhase section */ 192 | 193 | /* Begin PBXShellScriptBuildPhase section */ 194 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 195 | isa = PBXShellScriptBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | ); 199 | inputPaths = ( 200 | ); 201 | name = "Thin Binary"; 202 | outputPaths = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | shellPath = /bin/sh; 206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 207 | }; 208 | 9740EEB61CF901F6004384FC /* Run Script */ = { 209 | isa = PBXShellScriptBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | inputPaths = ( 214 | ); 215 | name = "Run Script"; 216 | outputPaths = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 221 | }; 222 | /* End PBXShellScriptBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 97C146EA1CF9000F007C117D /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 230 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXVariantGroup section */ 237 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 97C146FB1CF9000F007C117D /* Base */, 241 | ); 242 | name = Main.storyboard; 243 | sourceTree = ""; 244 | }; 245 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 97C147001CF9000F007C117D /* Base */, 249 | ); 250 | name = LaunchScreen.storyboard; 251 | sourceTree = ""; 252 | }; 253 | /* End PBXVariantGroup section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 257 | isa = XCBuildConfiguration; 258 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_COMMA = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INFINITE_RECURSION = YES; 274 | CLANG_WARN_INT_CONVERSION = YES; 275 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_NS_ASSERTIONS = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = NO; 298 | SDKROOT = iphoneos; 299 | TARGETED_DEVICE_FAMILY = "1,2"; 300 | VALIDATE_PRODUCT = YES; 301 | }; 302 | name = Profile; 303 | }; 304 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 305 | isa = XCBuildConfiguration; 306 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 310 | DEVELOPMENT_TEAM = S8QB4VV633; 311 | ENABLE_BITCODE = NO; 312 | FRAMEWORK_SEARCH_PATHS = ( 313 | "$(inherited)", 314 | "$(PROJECT_DIR)/Flutter", 315 | ); 316 | INFOPLIST_FILE = Runner/Info.plist; 317 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 318 | LIBRARY_SEARCH_PATHS = ( 319 | "$(inherited)", 320 | "$(PROJECT_DIR)/Flutter", 321 | ); 322 | PRODUCT_BUNDLE_IDENTIFIER = com.example.animationsFlutter; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | SWIFT_VERSION = 4.0; 325 | VERSIONING_SYSTEM = "apple-generic"; 326 | }; 327 | name = Profile; 328 | }; 329 | 97C147031CF9000F007C117D /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_ANALYZER_NONNULL = YES; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_COMMA = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 344 | CLANG_WARN_EMPTY_BODY = YES; 345 | CLANG_WARN_ENUM_CONVERSION = YES; 346 | CLANG_WARN_INFINITE_RECURSION = YES; 347 | CLANG_WARN_INT_CONVERSION = YES; 348 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 349 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 352 | CLANG_WARN_STRICT_PROTOTYPES = YES; 353 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 354 | CLANG_WARN_UNREACHABLE_CODE = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | DEBUG_INFORMATION_FORMAT = dwarf; 359 | ENABLE_STRICT_OBJC_MSGSEND = YES; 360 | ENABLE_TESTABILITY = YES; 361 | GCC_C_LANGUAGE_STANDARD = gnu99; 362 | GCC_DYNAMIC_NO_PIC = NO; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_OPTIMIZATION_LEVEL = 0; 365 | GCC_PREPROCESSOR_DEFINITIONS = ( 366 | "DEBUG=1", 367 | "$(inherited)", 368 | ); 369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 370 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 371 | GCC_WARN_UNDECLARED_SELECTOR = YES; 372 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 373 | GCC_WARN_UNUSED_FUNCTION = YES; 374 | GCC_WARN_UNUSED_VARIABLE = YES; 375 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 376 | MTL_ENABLE_DEBUG_INFO = YES; 377 | ONLY_ACTIVE_ARCH = YES; 378 | SDKROOT = iphoneos; 379 | TARGETED_DEVICE_FAMILY = "1,2"; 380 | }; 381 | name = Debug; 382 | }; 383 | 97C147041CF9000F007C117D /* Release */ = { 384 | isa = XCBuildConfiguration; 385 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 386 | buildSettings = { 387 | ALWAYS_SEARCH_USER_PATHS = NO; 388 | CLANG_ANALYZER_NONNULL = YES; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_MODULES = YES; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 394 | CLANG_WARN_BOOL_CONVERSION = YES; 395 | CLANG_WARN_COMMA = YES; 396 | CLANG_WARN_CONSTANT_CONVERSION = YES; 397 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 398 | CLANG_WARN_EMPTY_BODY = YES; 399 | CLANG_WARN_ENUM_CONVERSION = YES; 400 | CLANG_WARN_INFINITE_RECURSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 403 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 406 | CLANG_WARN_STRICT_PROTOTYPES = YES; 407 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 413 | ENABLE_NS_ASSERTIONS = NO; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_NO_COMMON_BLOCKS = YES; 417 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 421 | GCC_WARN_UNUSED_FUNCTION = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 424 | MTL_ENABLE_DEBUG_INFO = NO; 425 | SDKROOT = iphoneos; 426 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 427 | TARGETED_DEVICE_FAMILY = "1,2"; 428 | VALIDATE_PRODUCT = YES; 429 | }; 430 | name = Release; 431 | }; 432 | 97C147061CF9000F007C117D /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | CLANG_ENABLE_MODULES = YES; 438 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 439 | ENABLE_BITCODE = NO; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "$(PROJECT_DIR)/Flutter", 443 | ); 444 | INFOPLIST_FILE = Runner/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | LIBRARY_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/Flutter", 449 | ); 450 | PRODUCT_BUNDLE_IDENTIFIER = com.example.animationsFlutter; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 453 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 454 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 455 | SWIFT_VERSION = 4.0; 456 | VERSIONING_SYSTEM = "apple-generic"; 457 | }; 458 | name = Debug; 459 | }; 460 | 97C147071CF9000F007C117D /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 463 | buildSettings = { 464 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 465 | CLANG_ENABLE_MODULES = YES; 466 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 467 | ENABLE_BITCODE = NO; 468 | FRAMEWORK_SEARCH_PATHS = ( 469 | "$(inherited)", 470 | "$(PROJECT_DIR)/Flutter", 471 | ); 472 | INFOPLIST_FILE = Runner/Info.plist; 473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 474 | LIBRARY_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | PRODUCT_BUNDLE_IDENTIFIER = com.example.animationsFlutter; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 481 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 482 | SWIFT_VERSION = 4.0; 483 | VERSIONING_SYSTEM = "apple-generic"; 484 | }; 485 | name = Release; 486 | }; 487 | /* End XCBuildConfiguration section */ 488 | 489 | /* Begin XCConfigurationList section */ 490 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 491 | isa = XCConfigurationList; 492 | buildConfigurations = ( 493 | 97C147031CF9000F007C117D /* Debug */, 494 | 97C147041CF9000F007C117D /* Release */, 495 | 249021D3217E4FDB00AE95B9 /* Profile */, 496 | ); 497 | defaultConfigurationIsVisible = 0; 498 | defaultConfigurationName = Release; 499 | }; 500 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | 97C147061CF9000F007C117D /* Debug */, 504 | 97C147071CF9000F007C117D /* Release */, 505 | 249021D4217E4FDB00AE95B9 /* Profile */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | /* End XCConfigurationList section */ 511 | 512 | }; 513 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 514 | } 515 | --------------------------------------------------------------------------------