├── example ├── linux │ ├── .gitignore │ ├── main.cc │ ├── flutter │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ ├── generated_plugins.cmake │ │ └── CMakeLists.txt │ └── my_application.h ├── test │ └── widget_test.dart ├── 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 │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcodeproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── .gitignore ├── macos │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Runner │ │ ├── Configs │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ ├── Warnings.xcconfig │ │ │ └── AppInfo.xcconfig │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_64.png │ │ │ │ ├── app_icon_1024.png │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_512.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Release.entitlements │ │ ├── DebugProfile.entitlements │ │ ├── MainFlutterWindow.swift │ │ └── Info.plist │ ├── .gitignore │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner.xcodeproj │ │ └── project.xcworkspace │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ └── Icon-512.png │ ├── manifest.json │ └── index.html ├── android │ ├── gradle.properties │ ├── .gitignore │ ├── 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 │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── sharp3dges │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── windows │ ├── runner │ │ ├── resources │ │ │ └── app_icon.ico │ │ ├── resource.h │ │ ├── CMakeLists.txt │ │ ├── utils.h │ │ ├── runner.exe.manifest │ │ ├── run_loop.h │ │ ├── flutter_window.h │ │ ├── main.cpp │ │ ├── utils.cpp │ │ ├── flutter_window.cpp │ │ └── run_loop.cpp │ ├── flutter │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ └── .gitignore ├── .metadata ├── README.md ├── .gitignore └── pubspec.yaml ├── demo_app ├── test │ └── widget_test.dart ├── ios │ ├── Flutter │ │ ├── .last_build_id │ │ ├── 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 │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Runner.xcodeproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── .gitignore ├── web │ ├── icons │ │ ├── Icon-192.png │ │ └── Icon-512.png │ ├── manifest.json │ └── index.html ├── android │ ├── gradle.properties │ ├── .gitignore │ ├── 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 │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ └── values │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── sharp3dges │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── README.md ├── .gitignore ├── lib │ ├── lightspeed.dart │ ├── specials.dart │ ├── sliding_exits.dart │ ├── sliding_entrances.dart │ ├── slit_exits.dart │ ├── slit_entrances.dart │ ├── flippers.dart │ ├── zooming_exits.dart │ ├── zooming_entrances.dart │ ├── bouncing_exits.dart │ ├── bouncing_entrances.dart │ ├── rotating_exits.dart │ ├── rotating_entrances.dart │ └── animator_group.dart └── pubspec.yaml ├── test └── flutter_animator_test.dart ├── animations ├── flippers.gif ├── specials.gif ├── light_speed.gif ├── slit_exits.gif ├── fading_exits.gif ├── sliding_exits.gif ├── zooming_exits.gif ├── bouncing_exits.gif ├── fading_entrances.gif ├── rotating_exits.gif ├── slit_entrances.gif ├── attention_seekers.gif ├── bouncing_entrances.gif ├── rotating_entrances.gif ├── sliding_entrances.gif └── zooming_entrances.gif ├── lib ├── utils │ ├── force_unwrap.dart │ ├── math.dart │ ├── pair.dart │ └── perspective.dart ├── animation │ ├── animator_play_states.dart │ ├── tween_percentage.dart │ ├── animation_preferences.dart │ └── animation_definition.dart └── widgets │ ├── in_out_animation.dart │ ├── fading_entrances │ └── fade_in.dart │ ├── fading_exits │ └── fade_out.dart │ ├── slit_entrances │ ├── slit_in_vertical.dart │ ├── slit_in_horizontal.dart │ └── slit_in_diagonal.dart │ ├── slit_exits │ ├── slit_out_vertical.dart │ ├── slit_out_horizontal.dart │ └── slit_out_diagonal.dart │ ├── attention_seekers │ ├── flash.dart │ └── pulse.dart │ ├── sliding_exits │ ├── slide_out_up.dart │ ├── slide_out_down.dart │ ├── slide_out_left.dart │ └── slide_out_right.dart │ └── sliding_entrances │ ├── slide_in_up.dart │ ├── slide_in_down.dart │ ├── slide_in_left.dart │ └── slide_in_right.dart ├── pubspec.yaml ├── LICENSE └── .gitignore /example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /demo_app/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /test/flutter_animator_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /demo_app/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | bc9f62b376a6cffc7df87f43a002b828 -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /demo_app/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /demo_app/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /demo_app/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /animations/flippers.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/flippers.gif -------------------------------------------------------------------------------- /animations/specials.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/specials.gif -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/web/favicon.png -------------------------------------------------------------------------------- /animations/light_speed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/light_speed.gif -------------------------------------------------------------------------------- /animations/slit_exits.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/slit_exits.gif -------------------------------------------------------------------------------- /animations/fading_exits.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/fading_exits.gif -------------------------------------------------------------------------------- /animations/sliding_exits.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/sliding_exits.gif -------------------------------------------------------------------------------- /animations/zooming_exits.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/zooming_exits.gif -------------------------------------------------------------------------------- /lib/utils/force_unwrap.dart: -------------------------------------------------------------------------------- 1 | /// Force unwraps a value of type T or T? 2 | T? forceUnwrap(T? value) => value; 3 | -------------------------------------------------------------------------------- /animations/bouncing_exits.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/bouncing_exits.gif -------------------------------------------------------------------------------- /animations/fading_entrances.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/fading_entrances.gif -------------------------------------------------------------------------------- /animations/rotating_exits.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/rotating_exits.gif -------------------------------------------------------------------------------- /animations/slit_entrances.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/slit_entrances.gif -------------------------------------------------------------------------------- /demo_app/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/web/icons/Icon-192.png -------------------------------------------------------------------------------- /demo_app/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /animations/attention_seekers.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/attention_seekers.gif -------------------------------------------------------------------------------- /animations/bouncing_entrances.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/bouncing_entrances.gif -------------------------------------------------------------------------------- /animations/rotating_entrances.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/rotating_entrances.gif -------------------------------------------------------------------------------- /animations/sliding_entrances.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/sliding_entrances.gif -------------------------------------------------------------------------------- /animations/zooming_entrances.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/animations/zooming_entrances.gif -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /demo_app/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /demo_app/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/demo_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/senorprogramador/animator/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /demo_app/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | 8 | void fl_register_plugins(FlPluginRegistry* registry) { 9 | } 10 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | 8 | void RegisterPlugins(flutter::PluginRegistry* registry) { 9 | } 10 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /demo_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/utils/math.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | ///Shorthand to convert degrees to Radians. (multiply degrees with this value) 4 | const double toRad = pi / 180.0; 5 | 6 | ///Shorthand to convert radians to Degrees. (multiply radians with this value) 7 | const double toDeg = 180.0 / pi; 8 | -------------------------------------------------------------------------------- /example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/animation/animator_play_states.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_animator/flutter_animator.dart'; 2 | 3 | ///Defines states for [AnimationPreferences] used by [AnimatorWidget]. 4 | enum AnimationPlayStates { 5 | None, 6 | Forward, 7 | Reverse, 8 | Loop, 9 | PingPong, 10 | } 11 | -------------------------------------------------------------------------------- /example/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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo_app/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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo_app/.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: fabeb2a16f1d008ab8230f450c49141d35669798 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/.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: fabeb2a16f1d008ab8230f450c49141d35669798 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void fl_register_plugins(FlPluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void RegisterPlugins(flutter::PluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /demo_app/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo_app/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo_app/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. -------------------------------------------------------------------------------- /example/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. -------------------------------------------------------------------------------- /example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/animation/tween_percentage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | ///[TweenPercentage] is used by the the [TweenList], it defines a value and 4 | ///optional curve at a certain percentage of the animation. 5 | class TweenPercentage { 6 | final double percent; 7 | final T value; 8 | final Curve curve; 9 | 10 | const TweenPercentage({ 11 | required this.percent, 12 | required this.value, 13 | this.curve = Curves.ease, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /demo_app/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: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/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: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_animator 2 | description: Create animations with less code in a chaining manner. This package allows you to combine and chain multiple animations based on percentages of the duration. 3 | version: 3.2.2 4 | homepage: https://github.com/sharp3dges/animator 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | vector_math: ^2.1.0 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | flutter: 19 | -------------------------------------------------------------------------------- /example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /demo_app/android/app/src/main/kotlin/com/sharp3dges/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.sharp3dges.example 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity 5 | import io.flutter.embedding.engine.FlutterEngine 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { 10 | GeneratedPluginRegistrant.registerWith(flutterEngine); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/sharp3dges/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.sharp3dges.example 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity 5 | import io.flutter.embedding.engine.FlutterEngine 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { 10 | GeneratedPluginRegistrant.registerWith(flutterEngine); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /demo_app/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /demo_app/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /demo_app/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /demo_app/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "run_loop.cpp" 8 | "utils.cpp" 9 | "win32_window.cpp" 10 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 11 | "Runner.rc" 12 | "runner.exe.manifest" 13 | ) 14 | apply_standard_settings(${BINARY_NAME}) 15 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 16 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 17 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 18 | add_dependencies(${BINARY_NAME} flutter_assemble) 19 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.sharp3dges.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2020 com.sharp3dges. All rights reserved. 15 | -------------------------------------------------------------------------------- /demo_app/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /demo_app/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /demo_app/.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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/.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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /demo_app/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /demo_app/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Sjoerd van den Berg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /demo_app/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | example 15 | 16 | 17 | 18 | 21 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | example 15 | 16 | 17 | 18 | 21 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_RUN_LOOP_H_ 2 | #define RUNNER_RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterEngine* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterEngine* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUNNER_RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "run_loop.h" 10 | #include "win32_window.h" 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | bool OnCreate() override; 24 | void OnDestroy() override; 25 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 26 | LPARAM const lparam) noexcept override; 27 | 28 | private: 29 | // The run loop driving events for this window. 30 | RunLoop* run_loop_; 31 | 32 | // The project to run. 33 | flutter::DartProject project_; 34 | 35 | // The Flutter instance hosted by this window. 36 | std::unique_ptr flutter_controller_; 37 | }; 38 | 39 | #endif // RUNNER_FLUTTER_WINDOW_H_ 40 | -------------------------------------------------------------------------------- /lib/utils/pair.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /// Holds 2 values of same or different classes. 26 | class Pair { 27 | final A a; 28 | final B b; 29 | 30 | Pair(this.a, this.b); 31 | } 32 | -------------------------------------------------------------------------------- /example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | RunLoop run_loop; 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(&run_loop, project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"example", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | run_loop.Run(); 39 | 40 | ::CoUninitialize(); 41 | return EXIT_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /demo_app/lib/lightspeed.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class LightSpeed extends AnimatorGroup { 7 | LightSpeed({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | LightSpeedState createState() => LightSpeedState(); 12 | } 13 | 14 | class LightSpeedState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 2; 17 | 18 | List labels = [ 19 | "LightSpeedIn", 20 | "LightSpeedOut", 21 | ]; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Column( 26 | mainAxisSize: MainAxisSize.max, 27 | children: List.generate(numKeys, (int index) { 28 | switch (index) { 29 | case 0: 30 | return LightSpeedIn( 31 | key: keys[index], 32 | child: AnimatorCard(labels[index], colors[index]), 33 | preferences: AnimationPreferences(autoPlay: playState), 34 | ); 35 | case 1: 36 | return LightSpeedOut( 37 | key: keys[index], 38 | child: AnimatorCard(labels[index], colors[index]), 39 | preferences: AnimationPreferences(autoPlay: playState), 40 | ); 41 | } 42 | return SizedBox(); 43 | }), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/utils/perspective.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | ///Provides a static function to create a perspective-like [Matrix4]. 28 | class Perspective { 29 | ///Returns a perspective-like [Matrix4]. 30 | static Matrix4 matrix(num pv) { 31 | return Matrix4( 32 | 1.0, 0.0, 0.0, 0.0, // 33 | 0.0, 1.0, 0.0, 0.0, // 34 | 0.0, 0.0, 1.0, pv * 0.001, // 35 | 0.0, 0.0, 0.0, 1.0, 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Provides examples using the Animated Widgets from the Animator package 3 | version: 1.0.0+1 4 | 5 | environment: 6 | sdk: '>=2.12.0 <3.0.0' 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | cupertino_icons: ^0.1.2 12 | flutter_animator: ^3.2.2 13 | # path: ../ 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | flutter: 20 | 21 | uses-material-design: true 22 | 23 | # To add assets to your application, add an assets section, like this: 24 | # assets: 25 | # - images/a_dot_burr.jpeg 26 | # - images/a_dot_ham.jpeg 27 | 28 | # An image asset can refer to one or more resolution-specific "variants", see 29 | # https://flutter.dev/assets-and-images/#resolution-aware. 30 | 31 | # For details regarding adding assets from package dependencies, see 32 | # https://flutter.dev/assets-and-images/#from-packages 33 | 34 | # To add custom fonts to your application, add a fonts section here, 35 | # in this "flutter" section. Each entry in this list should have a 36 | # "family" key with the font family name, and a "fonts" key with a 37 | # list giving the asset and other descriptors for the font. For 38 | # example: 39 | # fonts: 40 | # - family: Schyler 41 | # fonts: 42 | # - asset: fonts/Schyler-Regular.ttf 43 | # - asset: fonts/Schyler-Italic.ttf 44 | # style: italic 45 | # - family: Trajan Pro 46 | # fonts: 47 | # - asset: fonts/TrajanPro.ttf 48 | # - asset: fonts/TrajanPro_Bold.ttf 49 | # weight: 700 50 | # 51 | # For details regarding fonts from package dependencies, 52 | # see https://flutter.dev/custom-fonts/#from-packages 53 | -------------------------------------------------------------------------------- /demo_app/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 | -------------------------------------------------------------------------------- /demo_app/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 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 | -------------------------------------------------------------------------------- /demo_app/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: demo_app 2 | description: Provides examples using the Animated Widgets from the Animator package 3 | version: 1.0.0+1 4 | 5 | environment: 6 | sdk: '>=2.12.0 <3.0.0' 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | cupertino_icons: ^0.1.2 12 | flutter_animator: ^3.2.2 13 | # path: ../ 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | flutter: 20 | 21 | uses-material-design: true 22 | 23 | # To add assets to your application, add an assets section, like this: 24 | # assets: 25 | # - images/a_dot_burr.jpeg 26 | # - images/a_dot_ham.jpeg 27 | 28 | # An image asset can refer to one or more resolution-specific "variants", see 29 | # https://flutter.dev/assets-and-images/#resolution-aware. 30 | 31 | # For details regarding adding assets from package dependencies, see 32 | # https://flutter.dev/assets-and-images/#from-packages 33 | 34 | # To add custom fonts to your application, add a fonts section here, 35 | # in this "flutter" section. Each entry in this list should have a 36 | # "family" key with the font family name, and a "fonts" key with a 37 | # list giving the asset and other descriptors for the font. For 38 | # example: 39 | # fonts: 40 | # - family: Schyler 41 | # fonts: 42 | # - asset: fonts/Schyler-Regular.ttf 43 | # - asset: fonts/Schyler-Italic.ttf 44 | # style: italic 45 | # - family: Trajan Pro 46 | # fonts: 47 | # - asset: fonts/TrajanPro.ttf 48 | # - asset: fonts/TrajanPro_Bold.ttf 49 | # weight: 700 50 | # 51 | # For details regarding fonts from package dependencies, 52 | # see https://flutter.dev/custom-fonts/#from-packages 53 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 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 | -------------------------------------------------------------------------------- /.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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /lib/animation/animation_preferences.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | import 'package:flutter_animator/flutter_animator.dart'; 3 | 4 | ///Use this class to setup preferences inside your [AnimationDefinition]s 5 | ///[AnimatorWidget] uses preferences to automatically apply offset, duration, 6 | ///autoPlay and add an [AnimationStatusListener]. 7 | class AnimationPreferences { 8 | ///Defines the magnitude of the animation (1.0 = 100%, 0.5 = 50%, etc.) 9 | final double magnitude; 10 | 11 | ///Defines an offset for the [AnimationDefinition]. 12 | final Duration offset; 13 | 14 | ///Defines a duration for the [AnimationDefinition] 15 | final Duration duration; 16 | 17 | ///Defines autoPlay for the [AnimationDefinition], [AnimatorWidget] uses this 18 | ///to initially start an animation upon render. 19 | final AnimationPlayStates? autoPlay; 20 | 21 | ///Adds an [AnimationStatusListener] to the generated [AnimationController] 22 | ///inside an [AnimatorInstance] 23 | final AnimationStatusListener? animationStatusListener; 24 | 25 | ///Constructor with defaults. 26 | const AnimationPreferences({ 27 | this.magnitude = 1, 28 | this.offset = Duration.zero, 29 | this.duration = const Duration(seconds: 1), 30 | this.autoPlay = AnimationPlayStates.Forward, 31 | this.animationStatusListener, 32 | }); 33 | 34 | ///Shorthand to initialize a copy with one or more changed parameters. 35 | AnimationPreferences copyWith({ 36 | Duration? offset, 37 | Duration? duration, 38 | AnimationPlayStates? autoPlay, 39 | AnimationStatusListener? animationStatusListener, 40 | }) { 41 | return AnimationPreferences( 42 | offset: offset ?? this.offset, 43 | duration: duration ?? this.duration, 44 | autoPlay: autoPlay ?? this.autoPlay, 45 | animationStatusListener: 46 | animationStatusListener ?? this.animationStatusListener, 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /demo_app/lib/specials.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class Specials extends AnimatorGroup { 7 | Specials({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | SpecialsState createState() => SpecialsState(); 12 | } 13 | 14 | class SpecialsState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 4; 17 | 18 | List labels = [ 19 | "Hinge", 20 | "JackInTheBox", 21 | "RollIn", 22 | "RollOut", 23 | ]; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Column( 28 | mainAxisSize: MainAxisSize.max, 29 | children: List.generate(numKeys, (int index) { 30 | switch (index) { 31 | case 0: 32 | return Hinge( 33 | key: keys[index], 34 | child: AnimatorCard(labels[index], colors[index]), 35 | preferences: AnimationPreferences(autoPlay: playState), 36 | ); 37 | case 1: 38 | return JackInTheBox( 39 | key: keys[index], 40 | child: AnimatorCard(labels[index], colors[index]), 41 | preferences: AnimationPreferences(autoPlay: playState), 42 | ); 43 | case 2: 44 | return RollIn( 45 | key: keys[index], 46 | child: AnimatorCard(labels[index], colors[index]), 47 | preferences: AnimationPreferences(autoPlay: playState), 48 | ); 49 | case 3: 50 | return RollOut( 51 | key: keys[index], 52 | child: AnimatorCard(labels[index], colors[index]), 53 | preferences: AnimationPreferences(autoPlay: playState), 54 | ); 55 | } 56 | return SizedBox(); 57 | }), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/widgets/in_out_animation.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:flutter_animator/flutter_animator.dart'; 3 | 4 | enum InOutAnimationStatus { 5 | None, 6 | In, 7 | Out, 8 | } 9 | 10 | class InOutAnimation extends StatefulWidget { 11 | final Widget child; 12 | final AnimationDefinition inDefinition; 13 | final AnimationDefinition outDefinition; 14 | 15 | final InOutAnimationStatus autoPlay; 16 | 17 | InOutAnimation({ 18 | Key? key, 19 | required this.child, 20 | required this.inDefinition, 21 | required this.outDefinition, 22 | this.autoPlay = InOutAnimationStatus.In, 23 | }) : super(key: key); 24 | 25 | @override 26 | InOutAnimationState createState() => InOutAnimationState(); 27 | } 28 | 29 | class InOutAnimationState extends State { 30 | InOutAnimationStatus status = InOutAnimationStatus.None; 31 | 32 | GlobalKey inAnimation = GlobalKey(); 33 | GlobalKey outAnimation = 34 | GlobalKey(); 35 | 36 | @override 37 | void initState() { 38 | status = widget.autoPlay; 39 | super.initState(); 40 | } 41 | 42 | void animateIn() { 43 | setState(() { 44 | status = InOutAnimationStatus.In; 45 | }); 46 | } 47 | 48 | void animateOut() { 49 | setState(() { 50 | status = InOutAnimationStatus.Out; 51 | }); 52 | } 53 | 54 | @override 55 | Widget build(BuildContext context) { 56 | switch (status) { 57 | case InOutAnimationStatus.In: 58 | return AnimatorWidget( 59 | key: inAnimation, 60 | definition: widget.inDefinition, 61 | child: widget.child, 62 | ); 63 | case InOutAnimationStatus.Out: 64 | return AnimatorWidget( 65 | key: outAnimation, 66 | definition: widget.outDefinition, 67 | child: widget.child, 68 | ); 69 | default: 70 | return widget.child; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /demo_app/lib/sliding_exits.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class SlidingExits extends AnimatorGroup { 7 | SlidingExits({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | SlidingExitsState createState() => SlidingExitsState(); 12 | } 13 | 14 | class SlidingExitsState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 4; 17 | 18 | List labels = [ 19 | "SlideOutDown", 20 | "SlideOutLeft", 21 | "SlideOutRight", 22 | "SlideOutUp", 23 | ]; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Column( 28 | mainAxisSize: MainAxisSize.max, 29 | children: List.generate(numKeys, (int index) { 30 | switch (index) { 31 | case 0: 32 | return SlideOutDown( 33 | key: keys[index], 34 | child: AnimatorCard(labels[index], colors[index]), 35 | preferences: AnimationPreferences(autoPlay: playState), 36 | ); 37 | case 1: 38 | return SlideOutLeft( 39 | key: keys[index], 40 | child: AnimatorCard(labels[index], colors[index]), 41 | preferences: AnimationPreferences(autoPlay: playState), 42 | ); 43 | case 2: 44 | return SlideOutRight( 45 | key: keys[index], 46 | child: AnimatorCard(labels[index], colors[index]), 47 | preferences: AnimationPreferences(autoPlay: playState), 48 | ); 49 | case 3: 50 | return SlideOutUp( 51 | key: keys[index], 52 | child: AnimatorCard(labels[index], colors[index]), 53 | preferences: AnimationPreferences(autoPlay: playState), 54 | ); 55 | } 56 | return SizedBox(); 57 | }), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /demo_app/lib/sliding_entrances.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class SlidingEntrances extends AnimatorGroup { 7 | SlidingEntrances({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | SlidingEntrancesState createState() => SlidingEntrancesState(); 12 | } 13 | 14 | class SlidingEntrancesState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 4; 17 | 18 | List labels = [ 19 | "SlideInDown", 20 | "SlideInLeft", 21 | "SlideInRight", 22 | "SlideInUp", 23 | ]; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Column( 28 | mainAxisSize: MainAxisSize.max, 29 | children: List.generate(numKeys, (int index) { 30 | switch (index) { 31 | case 0: 32 | return SlideInDown( 33 | key: keys[index], 34 | child: AnimatorCard(labels[index], colors[index]), 35 | preferences: AnimationPreferences(autoPlay: playState), 36 | ); 37 | case 1: 38 | return SlideInLeft( 39 | key: keys[index], 40 | child: AnimatorCard(labels[index], colors[index]), 41 | preferences: AnimationPreferences(autoPlay: playState), 42 | ); 43 | case 2: 44 | return SlideInRight( 45 | key: keys[index], 46 | child: AnimatorCard(labels[index], colors[index]), 47 | preferences: AnimationPreferences(autoPlay: playState), 48 | ); 49 | case 3: 50 | return SlideInUp( 51 | key: keys[index], 52 | child: AnimatorCard(labels[index], colors[index]), 53 | preferences: AnimationPreferences(autoPlay: playState), 54 | ); 55 | } 56 | return SizedBox(); 57 | }), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /demo_app/lib/slit_exits.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class SlitExits extends AnimatorGroup { 7 | SlitExits({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | SlitExitsState createState() => SlitExitsState(); 12 | } 13 | 14 | class SlitExitsState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 3; 17 | 18 | List labels = [ 19 | "SlitOutDiagonal", 20 | "SlitOutVertical", 21 | "SlitOutHorizontal", 22 | ]; 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Column( 27 | mainAxisSize: MainAxisSize.max, 28 | children: List.generate(numKeys, (int index) { 29 | switch (index) { 30 | case 0: 31 | return SlitOutDiagonal( 32 | key: keys[index], 33 | child: AnimatorCard(labels[index], colors[index]), 34 | preferences: AnimationPreferences( 35 | autoPlay: playState, 36 | duration: Duration(milliseconds: 750), 37 | ), 38 | ); 39 | case 1: 40 | return SlitOutVertical( 41 | key: keys[index], 42 | child: AnimatorCard(labels[index], colors[index]), 43 | preferences: AnimationPreferences( 44 | autoPlay: playState, 45 | duration: Duration(milliseconds: 750), 46 | ), 47 | ); 48 | case 2: 49 | return SlitOutHorizontal( 50 | key: keys[index], 51 | child: AnimatorCard(labels[index], colors[index]), 52 | preferences: AnimationPreferences( 53 | autoPlay: playState, 54 | duration: Duration(milliseconds: 750), 55 | ), 56 | ); 57 | } 58 | return SizedBox(); 59 | }), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /demo_app/lib/slit_entrances.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class SlitEntrances extends AnimatorGroup { 7 | SlitEntrances({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | SlitEntrancesState createState() => SlitEntrancesState(); 12 | } 13 | 14 | class SlitEntrancesState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 3; 17 | 18 | List labels = [ 19 | "SlitInDiagonal", 20 | "SlitInVertical", 21 | "SlitInHorizontal", 22 | ]; 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Column( 27 | mainAxisSize: MainAxisSize.max, 28 | children: List.generate(numKeys, (int index) { 29 | switch (index) { 30 | case 0: 31 | return SlitInDiagonal( 32 | key: keys[index], 33 | child: AnimatorCard(labels[index], colors[index]), 34 | preferences: AnimationPreferences( 35 | autoPlay: playState, 36 | duration: Duration(milliseconds: 750), 37 | ), 38 | ); 39 | case 1: 40 | return SlitInVertical( 41 | key: keys[index], 42 | child: AnimatorCard(labels[index], colors[index]), 43 | preferences: AnimationPreferences( 44 | autoPlay: playState, 45 | duration: Duration(milliseconds: 750), 46 | ), 47 | ); 48 | case 2: 49 | return SlitInHorizontal( 50 | key: keys[index], 51 | child: AnimatorCard(labels[index], colors[index]), 52 | preferences: AnimationPreferences( 53 | autoPlay: playState, 54 | duration: Duration(milliseconds: 750), 55 | ), 56 | ); 57 | } 58 | return SizedBox(); 59 | }), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /demo_app/lib/flippers.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class Flippers extends AnimatorGroup { 7 | Flippers({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | FlippersState createState() => FlippersState(); 12 | } 13 | 14 | class FlippersState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "Flip", 20 | "FlipInX", 21 | "FlipInY", 22 | "FlipOutX", 23 | "FlipOutY", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return Flip( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return FlipInX( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return FlipInY( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return FlipOutX( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return FlipOutY( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 8 | const flutter::DartProject& project) 9 | : run_loop_(run_loop), project_(project) {} 10 | 11 | FlutterWindow::~FlutterWindow() {} 12 | 13 | bool FlutterWindow::OnCreate() { 14 | if (!Win32Window::OnCreate()) { 15 | return false; 16 | } 17 | 18 | RECT frame = GetClientArea(); 19 | 20 | // The size here must match the window dimensions to avoid unnecessary surface 21 | // creation / destruction in the startup path. 22 | flutter_controller_ = std::make_unique( 23 | frame.right - frame.left, frame.bottom - frame.top, project_); 24 | // Ensure that basic setup of the controller was successful. 25 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 26 | return false; 27 | } 28 | RegisterPlugins(flutter_controller_->engine()); 29 | run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); 30 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 31 | return true; 32 | } 33 | 34 | void FlutterWindow::OnDestroy() { 35 | if (flutter_controller_) { 36 | run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); 37 | flutter_controller_ = nullptr; 38 | } 39 | 40 | Win32Window::OnDestroy(); 41 | } 42 | 43 | LRESULT 44 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 45 | WPARAM const wparam, 46 | LPARAM const lparam) noexcept { 47 | // Give Flutter, including plugins, an opporutunity to handle window messages. 48 | if (flutter_controller_) { 49 | std::optional result = 50 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 51 | lparam); 52 | if (result) { 53 | return *result; 54 | } 55 | } 56 | 57 | switch (message) { 58 | case WM_FONTCHANGE: 59 | flutter_controller_->engine()->ReloadSystemFonts(); 60 | break; 61 | } 62 | 63 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 64 | } 65 | -------------------------------------------------------------------------------- /demo_app/lib/zooming_exits.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class ZoomingExits extends AnimatorGroup { 7 | ZoomingExits({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | ZoomingExitsState createState() => ZoomingExitsState(); 12 | } 13 | 14 | class ZoomingExitsState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "ZoomOut", 20 | "ZoomOutDown", 21 | "ZoomOutLeft", 22 | "ZoomOutRight", 23 | "ZoomOutUp", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return ZoomOut( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return ZoomOutDown( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return ZoomOutLeft( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return ZoomOutRight( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return ZoomOutUp( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /demo_app/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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.sharp3dges.example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /example/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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.sharp3dges.example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /demo_app/lib/zooming_entrances.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class ZoomingEntrances extends AnimatorGroup { 7 | ZoomingEntrances({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | ZoomingEntrancesState createState() => ZoomingEntrancesState(); 12 | } 13 | 14 | class ZoomingEntrancesState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "ZoomIn", 20 | "ZoomInDown", 21 | "ZoomInLeft", 22 | "ZoomInRight", 23 | "ZoomInUp", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return ZoomIn( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return ZoomInDown( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return ZoomInLeft( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return ZoomInRight( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return ZoomInUp( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /demo_app/lib/bouncing_exits.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class BouncingExits extends AnimatorGroup { 7 | BouncingExits({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | BouncingExitsState createState() => BouncingExitsState(); 12 | } 13 | 14 | class BouncingExitsState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "BounceOut", 20 | "BounceOutDown", 21 | "BounceOutLeft", 22 | "BounceOutRight", 23 | "BounceOutUp", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return BounceOut( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return BounceOutDown( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return BounceOutLeft( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return BounceOutRight( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return BounceOutUp( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /demo_app/lib/bouncing_entrances.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class BouncingEntrances extends AnimatorGroup { 7 | BouncingEntrances({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | BouncingEntrancesState createState() => BouncingEntrancesState(); 12 | } 13 | 14 | class BouncingEntrancesState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "BounceIn", 20 | "BounceInDown", 21 | "BounceInLeft", 22 | "BounceInRight", 23 | "BounceInUp", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return BounceIn( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return BounceInDown( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return BounceInLeft( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return BounceInRight( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return BounceInUp( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /demo_app/lib/rotating_exits.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class RotatingExits extends AnimatorGroup { 7 | RotatingExits({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | RotatingExitsState createState() => RotatingExitsState(); 12 | } 13 | 14 | class RotatingExitsState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "RotateOut", 20 | "RotateOutDownLeft", 21 | "RotateOutDownRight", 22 | "RotateOutUpLeft", 23 | "RotateOutUpRight", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return RotateOut( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return RotateOutDownLeft( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return RotateOutDownRight( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return RotateOutUpLeft( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return RotateOutUpRight( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /demo_app/lib/rotating_entrances.dart: -------------------------------------------------------------------------------- 1 | import './animator_group.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_animator/flutter_animator.dart'; 5 | 6 | class RotatingEntrances extends AnimatorGroup { 7 | RotatingEntrances({Key? key, AnimationPlayStates? playState}) 8 | : super(key: key, playState: playState); 9 | 10 | @override 11 | RotatingEntrancesState createState() => RotatingEntrancesState(); 12 | } 13 | 14 | class RotatingEntrancesState extends AnimatorGroupState { 15 | @override 16 | int get numKeys => 5; 17 | 18 | List labels = [ 19 | "RotateIn", 20 | "RotateInDownLeft", 21 | "RotateInDownRight", 22 | "RotateInUpLeft", 23 | "RotateInUpRight", 24 | ]; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Column( 29 | mainAxisSize: MainAxisSize.max, 30 | children: List.generate(numKeys, (int index) { 31 | switch (index) { 32 | case 0: 33 | return RotateIn( 34 | key: keys[index], 35 | child: AnimatorCard(labels[index], colors[index]), 36 | preferences: AnimationPreferences(autoPlay: playState), 37 | ); 38 | case 1: 39 | return RotateInDownLeft( 40 | key: keys[index], 41 | child: AnimatorCard(labels[index], colors[index]), 42 | preferences: AnimationPreferences(autoPlay: playState), 43 | ); 44 | case 2: 45 | return RotateInDownRight( 46 | key: keys[index], 47 | child: AnimatorCard(labels[index], colors[index]), 48 | preferences: AnimationPreferences(autoPlay: playState), 49 | ); 50 | case 3: 51 | return RotateInUpLeft( 52 | key: keys[index], 53 | child: AnimatorCard(labels[index], colors[index]), 54 | preferences: AnimationPreferences(autoPlay: playState), 55 | ); 56 | case 4: 57 | return RotateInUpRight( 58 | key: keys[index], 59 | child: AnimatorCard(labels[index], colors[index]), 60 | preferences: AnimationPreferences(autoPlay: playState), 61 | ); 62 | } 63 | return SizedBox(); 64 | }), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /example/windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | RunLoop::RunLoop() {} 8 | 9 | RunLoop::~RunLoop() {} 10 | 11 | void RunLoop::Run() { 12 | bool keep_running = true; 13 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 14 | while (keep_running) { 15 | std::chrono::nanoseconds wait_duration = 16 | std::max(std::chrono::nanoseconds(0), 17 | next_flutter_event_time - TimePoint::clock::now()); 18 | ::MsgWaitForMultipleObjects( 19 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 20 | QS_ALLINPUT); 21 | bool processed_events = false; 22 | MSG message; 23 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 24 | // won't return again for items left in the queue after PeekMessage. 25 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 26 | processed_events = true; 27 | if (message.message == WM_QUIT) { 28 | keep_running = false; 29 | break; 30 | } 31 | ::TranslateMessage(&message); 32 | ::DispatchMessage(&message); 33 | // Allow Flutter to process messages each time a Windows message is 34 | // processed, to prevent starvation. 35 | next_flutter_event_time = 36 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 37 | } 38 | // If the PeekMessage loop didn't run, process Flutter messages. 39 | if (!processed_events) { 40 | next_flutter_event_time = 41 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 42 | } 43 | } 44 | } 45 | 46 | void RunLoop::RegisterFlutterInstance( 47 | flutter::FlutterEngine* flutter_instance) { 48 | flutter_instances_.insert(flutter_instance); 49 | } 50 | 51 | void RunLoop::UnregisterFlutterInstance( 52 | flutter::FlutterEngine* flutter_instance) { 53 | flutter_instances_.erase(flutter_instance); 54 | } 55 | 56 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 57 | TimePoint next_event_time = TimePoint::max(); 58 | for (auto instance : flutter_instances_) { 59 | std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); 60 | if (wait_duration != std::chrono::nanoseconds::max()) { 61 | next_event_time = 62 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 63 | } 64 | } 65 | return next_event_time; 66 | } 67 | -------------------------------------------------------------------------------- /demo_app/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 | -------------------------------------------------------------------------------- /example/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/animation/animation_definition.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:flutter_animator/flutter_animator.dart'; 3 | 4 | ///[AnimationDefinition] allows you to define a CSS-like animation and apply 5 | ///it in a build phase. 6 | ///Override this class to define new animations. 7 | abstract class AnimationDefinition { 8 | ///Pass [AnimationPreferences] to setup offset, duration, autoPlay and 9 | ///add an [AnimationStatusListener] 10 | final AnimationPreferences preferences; 11 | 12 | ///When true, instructs [AnimatorWidget] to preRender the child without 13 | ///animation and extracts the child's size in order to supply it to 14 | ///[AnimationDefinition].build() in the next render. 15 | final bool needsWidgetSize; 16 | 17 | ///When true, instructs [AnimatorWidget] to preRender the child without 18 | ///animation and extracts the screen-size in order to supply it to 19 | ///[AnimationDefinition].build() in the next render. 20 | final bool needsScreenSize; 21 | 22 | ///Sets the visibility of the child during the preRender when 23 | ///[needsWidgetSize] or [needsScreenSize] is set to true. 24 | ///Use this property to prevent 'flickering' when rendering in-animations. 25 | final double preRenderOpacity; 26 | 27 | ///Constructor with all parameters' defaults. 28 | const AnimationDefinition({ 29 | this.preferences = const AnimationPreferences(), 30 | this.needsWidgetSize = false, 31 | this.needsScreenSize = false, 32 | this.preRenderOpacity = 1.0, 33 | }); 34 | 35 | ///[AnimatorWidget] calls getDefinition to gather the animation. Animations 36 | ///are defined using named [TweenList]s using a Map. 37 | ///Example: 38 | ///@override 39 | ///Map getDefinition({Size screenSize, Size widgetSize}) { 40 | /// return { 41 | /// "opacity": TweenList([ 42 | /// TweenPercentage(percent: 0, value: 0.0, curve: Curves.ease), 43 | /// TweenPercentage(percent: 100, value: 1.0, curve: Curves.ease), 44 | /// ]), 45 | /// }; 46 | ///} 47 | Map getDefinition({Size? screenSize, Size? widgetSize}); 48 | 49 | ///[AnimatorWidget] calls build to retrieve the animated Widget. 50 | ///The extracted [Animator] from the getDefinition phase is injected to 51 | ///supply a controller and the [Animation] objects. 52 | ///Example: 53 | ///@override 54 | ///Widget build(BuildContext context, Animator animator, Widget child) { 55 | /// return FadeTransition( 56 | /// opacity: animation.get('opacity'), 57 | /// child: child, 58 | /// ); 59 | ///} 60 | Widget build(BuildContext context, Animator animator, Widget child); 61 | } 62 | -------------------------------------------------------------------------------- /demo_app/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /lib/widgets/fading_entrances/fade_in.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [FadeIn] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class FadeInAnimation extends AnimationDefinition { 33 | FadeInAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return FadeTransition( 40 | opacity: animator.get("opacity") as Animation, 41 | child: child, 42 | ); 43 | } 44 | 45 | @override 46 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 47 | return { 48 | "opacity": TweenList( 49 | [ 50 | TweenPercentage(percent: 0, value: 0.0), 51 | TweenPercentage(percent: 100, value: 1.0), 52 | ], 53 | ), 54 | }; 55 | } 56 | } 57 | 58 | /// Example of using FadeIn: 59 | /// 60 | /// ```dart 61 | /// class ExampleWidget extends StatelessWidget { 62 | /// 63 | /// @override 64 | /// Widget build(BuildContext context) { 65 | /// return FadeIn(child: Text('Bounce')); 66 | /// } 67 | /// 68 | /// } 69 | /// ``` 70 | class FadeIn extends AnimatorWidget { 71 | FadeIn({ 72 | Key? key, 73 | required Widget child, 74 | AnimationPreferences preferences = const AnimationPreferences(), 75 | }) : super( 76 | key: key, 77 | child: child, 78 | definition: FadeInAnimation(preferences: preferences)); 79 | } 80 | -------------------------------------------------------------------------------- /lib/widgets/fading_exits/fade_out.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [FadeOut] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class FadeOutAnimation extends AnimationDefinition { 33 | FadeOutAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return FadeTransition( 40 | opacity: animator.get("opacity") as Animation, 41 | child: child, 42 | ); 43 | } 44 | 45 | @override 46 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 47 | return { 48 | "opacity": TweenList( 49 | [ 50 | TweenPercentage(percent: 0, value: 1.0), 51 | TweenPercentage(percent: 100, value: 0.0), 52 | ], 53 | ), 54 | }; 55 | } 56 | } 57 | 58 | /// Example of using FadeOut: 59 | /// 60 | /// ```dart 61 | /// class ExampleWidget extends StatelessWidget { 62 | /// 63 | /// @override 64 | /// Widget build(BuildContext context) { 65 | /// return FadeOut(child: Text('Bounce')); 66 | /// } 67 | /// 68 | /// } 69 | /// ``` 70 | class FadeOut extends AnimatorWidget { 71 | FadeOut({ 72 | Key? key, 73 | required Widget child, 74 | AnimationPreferences preferences = const AnimationPreferences(), 75 | }) : super( 76 | key: key, 77 | child: child, 78 | definition: FadeOutAnimation(preferences: preferences)); 79 | } 80 | -------------------------------------------------------------------------------- /lib/widgets/slit_entrances/slit_in_vertical.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | import '../../flutter_animator.dart'; 4 | 5 | ///Used by [SlitInVertical] widget. 6 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 7 | ///in/out animation. 8 | class SlitInVerticalAnimation extends AnimationDefinition { 9 | SlitInVerticalAnimation({ 10 | AnimationPreferences preferences = 11 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 12 | }) : super(preferences: preferences); 13 | 14 | @override 15 | Widget build(BuildContext context, Animator animator, Widget child) { 16 | return FadeTransition( 17 | opacity: animator.get('opacity') as Animation, 18 | child: AnimatedBuilder( 19 | animation: animator.controller!, 20 | child: child, 21 | builder: (BuildContext context, Widget? child) => Transform( 22 | child: child, 23 | transform: Perspective.matrix(1.5) * 24 | Matrix4.translationValues( 25 | 0.0, 0.0, animator.get("translateZ")!.value) * 26 | Matrix4.rotationY( 27 | animator.get('rotateY')!.value, 28 | ), 29 | alignment: Alignment.center, 30 | ), 31 | ), 32 | ); 33 | } 34 | 35 | @override 36 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 37 | return { 38 | 'opacity': TweenList( 39 | [ 40 | TweenPercentage(percent: 0, value: 0.0), 41 | TweenPercentage(percent: 54, value: 1.0), 42 | ], 43 | ), 44 | 'translateZ': TweenList( 45 | [ 46 | TweenPercentage(percent: 0, value: 800.0 * preferences.magnitude), 47 | TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude), 48 | TweenPercentage(percent: 100, value: 0.0), 49 | ], 50 | ), 51 | 'rotateY': TweenList( 52 | [ 53 | TweenPercentage( 54 | percent: 0, value: -90.0 * toRad * preferences.magnitude), 55 | TweenPercentage( 56 | percent: 54, value: -87.0 * toRad * preferences.magnitude), 57 | TweenPercentage(percent: 100, value: 0.0), 58 | ], 59 | ), 60 | }; 61 | } 62 | } 63 | 64 | /// Example of using SlitInVertical: 65 | /// 66 | /// ```dart 67 | /// class ExampleWidget extends StatelessWidget { 68 | /// 69 | /// @override 70 | /// Widget build(BuildContext context) { 71 | /// return SlitInVertical(child: Text('Bounce')); 72 | /// } 73 | /// 74 | /// } 75 | /// ``` 76 | class SlitInVertical extends AnimatorWidget { 77 | SlitInVertical({ 78 | Key? key, 79 | required Widget child, 80 | AnimationPreferences preferences = 81 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 82 | }) : super( 83 | key: key, 84 | child: child, 85 | definition: SlitInVerticalAnimation(preferences: preferences)); 86 | } 87 | -------------------------------------------------------------------------------- /lib/widgets/slit_exits/slit_out_vertical.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | import '../../flutter_animator.dart'; 4 | 5 | ///Used by [SlitOutVertical] widget. 6 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 7 | ///in/out animation. 8 | class SlitOutVerticalAnimation extends AnimationDefinition { 9 | SlitOutVerticalAnimation({ 10 | AnimationPreferences preferences = 11 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 12 | }) : super(preferences: preferences); 13 | 14 | @override 15 | Widget build(BuildContext context, Animator animator, Widget child) { 16 | return FadeTransition( 17 | opacity: animator.get('opacity') as Animation, 18 | child: AnimatedBuilder( 19 | animation: animator.controller!, 20 | child: child, 21 | builder: (BuildContext context, Widget? child) => Transform( 22 | child: child, 23 | transform: Perspective.matrix(1.5) * 24 | Matrix4.translationValues( 25 | 0.0, 0.0, animator.get("translateZ")!.value) * 26 | Matrix4.rotationY( 27 | animator.get('rotateY')!.value, 28 | ), 29 | alignment: Alignment.center, 30 | ), 31 | ), 32 | ); 33 | } 34 | 35 | @override 36 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 37 | return { 38 | 'opacity': TweenList( 39 | [ 40 | TweenPercentage(percent: 54, value: 1.0), 41 | TweenPercentage(percent: 100, value: 0.0), 42 | ], 43 | ), 44 | 'translateZ': TweenList( 45 | [ 46 | TweenPercentage(percent: 0, value: 0.0), 47 | TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude), 48 | TweenPercentage(percent: 100, value: 800.0 * preferences.magnitude), 49 | ], 50 | ), 51 | 'rotateY': TweenList( 52 | [ 53 | TweenPercentage(percent: 0, value: 0.0), 54 | TweenPercentage( 55 | percent: 54, value: -87.0 * toRad * preferences.magnitude), 56 | TweenPercentage( 57 | percent: 100, value: -90.0 * toRad * preferences.magnitude), 58 | ], 59 | ), 60 | }; 61 | } 62 | } 63 | 64 | /// Example of using SlitOutVertical: 65 | /// 66 | /// ```dart 67 | /// class ExampleWidget extends StatelessWidget { 68 | /// 69 | /// @override 70 | /// Widget build(BuildContext context) { 71 | /// return SlitOutVertical(child: Text('Bounce')); 72 | /// } 73 | /// 74 | /// } 75 | /// ``` 76 | class SlitOutVertical extends AnimatorWidget { 77 | SlitOutVertical({ 78 | Key? key, 79 | required Widget child, 80 | AnimationPreferences preferences = 81 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 82 | }) : super( 83 | key: key, 84 | child: child, 85 | definition: SlitOutVerticalAnimation(preferences: preferences)); 86 | } 87 | -------------------------------------------------------------------------------- /lib/widgets/slit_entrances/slit_in_horizontal.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | import '../../flutter_animator.dart'; 4 | 5 | ///Used by [SlitInHorizontal] widget. 6 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 7 | ///in/out animation. 8 | class SlitInHorizontalAnimation extends AnimationDefinition { 9 | SlitInHorizontalAnimation({ 10 | AnimationPreferences preferences = 11 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 12 | }) : super(preferences: preferences); 13 | 14 | @override 15 | Widget build(BuildContext context, Animator animator, Widget child) { 16 | return FadeTransition( 17 | opacity: animator.get('opacity') as Animation, 18 | child: AnimatedBuilder( 19 | animation: animator.controller!, 20 | child: child, 21 | builder: (BuildContext context, Widget? child) => Transform( 22 | child: child, 23 | transform: Perspective.matrix(1.5) * 24 | Matrix4.translationValues( 25 | 0.0, 0.0, animator.get("translateZ")!.value) * 26 | Matrix4.rotationX( 27 | animator.get('rotateX')!.value, 28 | ), 29 | alignment: Alignment.center, 30 | ), 31 | ), 32 | ); 33 | } 34 | 35 | @override 36 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 37 | return { 38 | 'opacity': TweenList( 39 | [ 40 | TweenPercentage(percent: 0, value: 0.0), 41 | TweenPercentage(percent: 54, value: 1.0), 42 | ], 43 | ), 44 | 'translateZ': TweenList( 45 | [ 46 | TweenPercentage(percent: 0, value: 800.0 * preferences.magnitude), 47 | TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude), 48 | TweenPercentage(percent: 100, value: 0.0), 49 | ], 50 | ), 51 | 'rotateX': TweenList( 52 | [ 53 | TweenPercentage( 54 | percent: 0, value: -90.0 * toRad * preferences.magnitude), 55 | TweenPercentage( 56 | percent: 54, value: -87.0 * toRad * preferences.magnitude), 57 | TweenPercentage(percent: 100, value: 0.0), 58 | ], 59 | ), 60 | }; 61 | } 62 | } 63 | 64 | /// Example of using SlitInHorizontal: 65 | /// 66 | /// ```dart 67 | /// class ExampleWidget extends StatelessWidget { 68 | /// 69 | /// @override 70 | /// Widget build(BuildContext context) { 71 | /// return SlitInHorizontal(child: Text('Bounce')); 72 | /// } 73 | /// 74 | /// } 75 | /// ``` 76 | class SlitInHorizontal extends AnimatorWidget { 77 | SlitInHorizontal({ 78 | Key? key, 79 | required Widget child, 80 | AnimationPreferences preferences = 81 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 82 | }) : super( 83 | key: key, 84 | child: child, 85 | definition: SlitInHorizontalAnimation(preferences: preferences)); 86 | } 87 | -------------------------------------------------------------------------------- /lib/widgets/slit_exits/slit_out_horizontal.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | import '../../flutter_animator.dart'; 4 | 5 | ///Used by [SlitOutHorizontal] widget. 6 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 7 | ///in/out animation. 8 | class SlitOutHorizontalAnimation extends AnimationDefinition { 9 | SlitOutHorizontalAnimation({ 10 | AnimationPreferences preferences = 11 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 12 | }) : super(preferences: preferences); 13 | 14 | @override 15 | Widget build(BuildContext context, Animator animator, Widget child) { 16 | return FadeTransition( 17 | opacity: animator.get('opacity') as Animation, 18 | child: AnimatedBuilder( 19 | animation: animator.controller!, 20 | child: child, 21 | builder: (BuildContext context, Widget? child) => Transform( 22 | child: child, 23 | transform: Perspective.matrix(1.5) * 24 | Matrix4.translationValues( 25 | 0.0, 0.0, animator.get("translateZ")!.value) * 26 | Matrix4.rotationX( 27 | animator.get('rotateX')!.value, 28 | ), 29 | alignment: Alignment.center, 30 | ), 31 | ), 32 | ); 33 | } 34 | 35 | @override 36 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 37 | return { 38 | 'opacity': TweenList( 39 | [ 40 | TweenPercentage(percent: 54, value: 1.0), 41 | TweenPercentage(percent: 100, value: 0.0), 42 | ], 43 | ), 44 | 'translateZ': TweenList( 45 | [ 46 | TweenPercentage(percent: 0, value: 0.0), 47 | TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude), 48 | TweenPercentage(percent: 100, value: 800.0 * preferences.magnitude), 49 | ], 50 | ), 51 | 'rotateX': TweenList( 52 | [ 53 | TweenPercentage(percent: 0, value: 0.0), 54 | TweenPercentage( 55 | percent: 54, value: -87.0 * toRad * preferences.magnitude), 56 | TweenPercentage( 57 | percent: 100, value: -90.0 * toRad * preferences.magnitude), 58 | ], 59 | ), 60 | }; 61 | } 62 | } 63 | 64 | /// Example of using SlitOutHorizontal: 65 | /// 66 | /// ```dart 67 | /// class ExampleWidget extends StatelessWidget { 68 | /// 69 | /// @override 70 | /// Widget build(BuildContext context) { 71 | /// return SlitOutHorizontal(child: Text('Bounce')); 72 | /// } 73 | /// 74 | /// } 75 | /// ``` 76 | class SlitOutHorizontal extends AnimatorWidget { 77 | SlitOutHorizontal({ 78 | Key? key, 79 | required Widget child, 80 | AnimationPreferences preferences = 81 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 82 | }) : super( 83 | key: key, 84 | child: child, 85 | definition: SlitOutHorizontalAnimation(preferences: preferences)); 86 | } 87 | -------------------------------------------------------------------------------- /lib/widgets/attention_seekers/flash.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [Flash] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class FlashAnimation extends AnimationDefinition { 33 | FlashAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return FadeTransition( 40 | opacity: animator.get("opacity") as Animation, 41 | child: child, 42 | ); 43 | } 44 | 45 | @override 46 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 47 | return { 48 | "opacity": TweenList( 49 | [ 50 | TweenPercentage(percent: 0, value: 1.0), 51 | TweenPercentage(percent: 25, value: 1.0 - preferences.magnitude), 52 | TweenPercentage(percent: 50, value: 1.0), 53 | TweenPercentage(percent: 75, value: 1.0 - preferences.magnitude), 54 | TweenPercentage(percent: 100, value: 1.0), 55 | ], 56 | ), 57 | }; 58 | } 59 | } 60 | 61 | /// Example of using Flash: 62 | /// 63 | /// ```dart 64 | /// class ExampleWidget extends StatelessWidget { 65 | ///Zo 66 | /// @override 67 | /// Widget build(BuildContext context) { 68 | /// return Flash(child: Text('Bounce')); 69 | /// } 70 | /// 71 | /// } 72 | /// ``` 73 | class Flash extends AnimatorWidget { 74 | Flash({ 75 | Key? key, 76 | required Widget child, 77 | AnimationPreferences preferences = const AnimationPreferences(), 78 | }) : super( 79 | key: key, 80 | child: child, 81 | definition: FlashAnimation(preferences: preferences)); 82 | } 83 | -------------------------------------------------------------------------------- /lib/widgets/slit_entrances/slit_in_diagonal.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:vector_math/vector_math_64.dart'; 3 | 4 | import '../../flutter_animator.dart'; 5 | 6 | ///Used by [SlitInDiagonal] widget. 7 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 8 | ///in/out animation. 9 | class SlitInDiagonalAnimation extends AnimationDefinition { 10 | SlitInDiagonalAnimation({ 11 | AnimationPreferences preferences = 12 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 13 | }) : super(preferences: preferences); 14 | 15 | @override 16 | Widget build(BuildContext context, Animator animator, Widget child) { 17 | return FadeTransition( 18 | opacity: animator.get('opacity') as Animation, 19 | child: AnimatedBuilder( 20 | animation: animator.controller!, 21 | child: child, 22 | builder: (BuildContext context, Widget? child) => Transform( 23 | child: child, 24 | transform: Perspective.matrix(1.5) * 25 | Matrix4.translationValues( 26 | 0.0, 0.0, animator.get("translateZ")!.value) * 27 | Matrix4.identity() 28 | ..rotate( 29 | Vector3(1.0, 1.0, 0.0), 30 | animator.get('rotation')!.value, 31 | ), 32 | alignment: Alignment.center, 33 | ), 34 | ), 35 | ); 36 | } 37 | 38 | @override 39 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 40 | return { 41 | 'opacity': TweenList( 42 | [ 43 | TweenPercentage(percent: 0, value: 0.0), 44 | TweenPercentage(percent: 54, value: 1.0), 45 | ], 46 | ), 47 | 'translateZ': TweenList( 48 | [ 49 | TweenPercentage(percent: 0, value: 800.0 * preferences.magnitude), 50 | TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude), 51 | TweenPercentage(percent: 100, value: 0.0), 52 | ], 53 | ), 54 | 'rotation': TweenList( 55 | [ 56 | TweenPercentage( 57 | percent: 0, value: 90.0 * toRad * preferences.magnitude), 58 | TweenPercentage( 59 | percent: 54, value: 87.0 * toRad * preferences.magnitude), 60 | TweenPercentage(percent: 100, value: 0.0), 61 | ], 62 | ), 63 | }; 64 | } 65 | } 66 | 67 | /// Example of using SlitInDiagonal: 68 | /// 69 | /// ```dart 70 | /// class ExampleWidget extends StatelessWidget { 71 | /// 72 | /// @override 73 | /// Widget build(BuildContext context) { 74 | /// return SlitInDiagonal(child: Text('Bounce')); 75 | /// } 76 | /// 77 | /// } 78 | /// ``` 79 | class SlitInDiagonal extends AnimatorWidget { 80 | SlitInDiagonal({ 81 | Key? key, 82 | required Widget child, 83 | AnimationPreferences preferences = 84 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 85 | }) : super( 86 | key: key, 87 | child: child, 88 | definition: SlitInDiagonalAnimation(preferences: preferences)); 89 | } 90 | -------------------------------------------------------------------------------- /lib/widgets/sliding_exits/slide_out_up.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideOutUp] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideOutUpAnimation extends AnimationDefinition { 33 | SlideOutUpAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences, needsScreenSize: true); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return AnimatedBuilder( 40 | animation: animator.controller!, 41 | child: child, 42 | builder: (BuildContext context, Widget? child) => Transform.translate( 43 | child: child, 44 | offset: Offset(0.0, animator.get("translateY")!.value), 45 | ), 46 | ); 47 | } 48 | 49 | @override 50 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 51 | return { 52 | "translateY": TweenList( 53 | [ 54 | TweenPercentage(percent: 0, value: 0.0), 55 | TweenPercentage(percent: 100, value: -screenSize!.height), 56 | ], 57 | ), 58 | }; 59 | } 60 | } 61 | 62 | /// Example of using SlideOutUp: 63 | /// 64 | /// ```dart 65 | /// class ExampleWidget extends StatelessWidget { 66 | /// 67 | /// @override 68 | /// Widget build(BuildContext context) { 69 | /// return SlideOutUp(child: Text('Bounce')); 70 | /// } 71 | /// 72 | /// } 73 | /// ``` 74 | class SlideOutUp extends AnimatorWidget { 75 | SlideOutUp({ 76 | Key? key, 77 | required Widget child, 78 | AnimationPreferences preferences = const AnimationPreferences(), 79 | }) : super( 80 | key: key, 81 | child: child, 82 | definition: SlideOutUpAnimation(preferences: preferences)); 83 | } 84 | -------------------------------------------------------------------------------- /lib/widgets/slit_exits/slit_out_diagonal.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:vector_math/vector_math_64.dart'; 3 | 4 | import '../../flutter_animator.dart'; 5 | 6 | ///Used by [SlitOutDiagonal] widget. 7 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 8 | ///in/out animation. 9 | class SlitOutDiagonalAnimation extends AnimationDefinition { 10 | SlitOutDiagonalAnimation({ 11 | AnimationPreferences preferences = 12 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 13 | }) : super(preferences: preferences); 14 | 15 | @override 16 | Widget build(BuildContext context, Animator animator, Widget child) { 17 | return FadeTransition( 18 | opacity: animator.get('opacity') as Animation, 19 | child: AnimatedBuilder( 20 | animation: animator.controller!, 21 | child: child, 22 | builder: (BuildContext context, Widget? child) => Transform( 23 | child: child, 24 | transform: Perspective.matrix(1.5) * 25 | Matrix4.translationValues( 26 | 0.0, 0.0, animator.get("translateZ")!.value) * 27 | Matrix4.identity() 28 | ..rotate( 29 | Vector3(1.0, 1.0, 0.0), 30 | animator.get('rotation')!.value, 31 | ), 32 | alignment: Alignment.center, 33 | ), 34 | ), 35 | ); 36 | } 37 | 38 | @override 39 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 40 | return { 41 | 'opacity': TweenList( 42 | [ 43 | TweenPercentage(percent: 54, value: 1.0), 44 | TweenPercentage(percent: 100, value: 0.0), 45 | ], 46 | ), 47 | 'translateZ': TweenList( 48 | [ 49 | TweenPercentage(percent: 0, value: 0.0), 50 | TweenPercentage(percent: 54, value: 160.0 * preferences.magnitude), 51 | TweenPercentage(percent: 100, value: 800.0 * preferences.magnitude), 52 | ], 53 | ), 54 | 'rotation': TweenList( 55 | [ 56 | TweenPercentage(percent: 0, value: 0.0), 57 | TweenPercentage( 58 | percent: 54, value: 87.0 * toRad * preferences.magnitude), 59 | TweenPercentage( 60 | percent: 100, value: 90.0 * toRad * preferences.magnitude), 61 | ], 62 | ), 63 | }; 64 | } 65 | } 66 | 67 | /// Example of using SlitOutDiagonal: 68 | /// 69 | /// ```dart 70 | /// class ExampleWidget extends StatelessWidget { 71 | /// 72 | /// @override 73 | /// Widget build(BuildContext context) { 74 | /// return SlitOutDiagonal(child: Text('Bounce')); 75 | /// } 76 | /// 77 | /// } 78 | /// ``` 79 | class SlitOutDiagonal extends AnimatorWidget { 80 | SlitOutDiagonal({ 81 | Key? key, 82 | required Widget child, 83 | AnimationPreferences preferences = 84 | const AnimationPreferences(duration: Duration(milliseconds: 750)), 85 | }) : super( 86 | key: key, 87 | child: child, 88 | definition: SlitOutDiagonalAnimation(preferences: preferences)); 89 | } 90 | -------------------------------------------------------------------------------- /lib/widgets/sliding_exits/slide_out_down.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideOutDown] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideOutDownAnimation extends AnimationDefinition { 33 | SlideOutDownAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences, needsScreenSize: true); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return AnimatedBuilder( 40 | animation: animator.controller!, 41 | child: child, 42 | builder: (BuildContext context, Widget? child) => Transform.translate( 43 | child: child, 44 | offset: Offset(0.0, animator.get("translateY")!.value), 45 | ), 46 | ); 47 | } 48 | 49 | @override 50 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 51 | return { 52 | "translateY": TweenList( 53 | [ 54 | TweenPercentage(percent: 0, value: 0.0), 55 | TweenPercentage(percent: 100, value: screenSize!.height), 56 | ], 57 | ), 58 | }; 59 | } 60 | } 61 | 62 | /// Example of using SlideOutDown: 63 | /// 64 | /// ```dart 65 | /// class ExampleWidget extends StatelessWidget { 66 | /// 67 | /// @override 68 | /// Widget build(BuildContext context) { 69 | /// return SlideOutDown(child: Text('Bounce')); 70 | /// } 71 | /// 72 | /// } 73 | /// ``` 74 | class SlideOutDown extends AnimatorWidget { 75 | SlideOutDown({ 76 | Key? key, 77 | required Widget child, 78 | AnimationPreferences preferences = const AnimationPreferences(), 79 | }) : super( 80 | key: key, 81 | child: child, 82 | definition: SlideOutDownAnimation(preferences: preferences)); 83 | } 84 | -------------------------------------------------------------------------------- /lib/widgets/sliding_exits/slide_out_left.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideOutLeft] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideOutLeftAnimation extends AnimationDefinition { 33 | SlideOutLeftAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences, needsScreenSize: true); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return AnimatedBuilder( 40 | animation: animator.controller!, 41 | child: child, 42 | builder: (BuildContext context, Widget? child) => Transform.translate( 43 | child: child, 44 | offset: Offset(animator.get("translateX")!.value, 0.0), 45 | ), 46 | ); 47 | } 48 | 49 | @override 50 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 51 | return { 52 | "translateX": TweenList( 53 | [ 54 | TweenPercentage(percent: 0, value: 0.0), 55 | TweenPercentage(percent: 100, value: -screenSize!.width), 56 | ], 57 | ), 58 | }; 59 | } 60 | } 61 | 62 | /// Example of using SlideOutLeft: 63 | /// 64 | /// ```dart 65 | /// class ExampleWidget extends StatelessWidget { 66 | /// 67 | /// @override 68 | /// Widget build(BuildContext context) { 69 | /// return SlideOutLeft(child: Text('Bounce')); 70 | /// } 71 | /// 72 | /// } 73 | /// ``` 74 | class SlideOutLeft extends AnimatorWidget { 75 | SlideOutLeft({ 76 | Key? key, 77 | required Widget child, 78 | AnimationPreferences preferences = const AnimationPreferences(), 79 | }) : super( 80 | key: key, 81 | child: child, 82 | definition: SlideOutLeftAnimation(preferences: preferences)); 83 | } 84 | -------------------------------------------------------------------------------- /lib/widgets/sliding_exits/slide_out_right.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideOutRight] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideOutRightAnimation extends AnimationDefinition { 33 | SlideOutRightAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences, needsScreenSize: true); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return AnimatedBuilder( 40 | animation: animator.controller!, 41 | child: child, 42 | builder: (BuildContext context, Widget? child) => Transform.translate( 43 | child: child, 44 | offset: Offset(animator.get("translateX")!.value, 0.0), 45 | ), 46 | ); 47 | } 48 | 49 | @override 50 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 51 | return { 52 | "translateX": TweenList( 53 | [ 54 | TweenPercentage(percent: 0, value: 0.0), 55 | TweenPercentage(percent: 100, value: screenSize!.width), 56 | ], 57 | ), 58 | }; 59 | } 60 | } 61 | 62 | /// Example of using SlideOutRight: 63 | /// 64 | /// ```dart 65 | /// class ExampleWidget extends StatelessWidget { 66 | /// 67 | /// @override 68 | /// Widget build(BuildContext context) { 69 | /// return SlideOutRight(child: Text('Bounce')); 70 | /// } 71 | /// 72 | /// } 73 | /// ``` 74 | class SlideOutRight extends AnimatorWidget { 75 | SlideOutRight({ 76 | Key? key, 77 | required Widget child, 78 | AnimationPreferences preferences = const AnimationPreferences(), 79 | }) : super( 80 | key: key, 81 | child: child, 82 | definition: SlideOutRightAnimation(preferences: preferences)); 83 | } 84 | -------------------------------------------------------------------------------- /demo_app/lib/animator_group.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_animator/flutter_animator.dart'; 3 | import 'package:flutter_animator/utils/force_unwrap.dart'; 4 | 5 | class AnimatorCard extends StatelessWidget { 6 | final String title; 7 | final Color? color; 8 | AnimatorCard(this.title, this.color); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | padding: EdgeInsets.all(12), 14 | margin: EdgeInsets.only(bottom: 5), 15 | width: 300, 16 | color: color, 17 | child: Center( 18 | child: Text( 19 | title, 20 | style: TextStyle(fontSize: 16), 21 | ), 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class AnimatorGroup extends StatefulWidget { 28 | final AnimationPlayStates? playState; 29 | AnimatorGroup({Key? key, required this.playState}) : super(key: key); 30 | 31 | @override 32 | AnimatorGroupState createState() => AnimatorGroupState(); 33 | } 34 | 35 | class AnimatorGroupState extends State { 36 | int get numKeys => 0; 37 | 38 | List> keys = []; 39 | List colors = [ 40 | Colors.blue[100], 41 | Colors.green[100], 42 | Colors.blue[200], 43 | Colors.green[200], 44 | Colors.blue[300], 45 | Colors.green[300], 46 | Colors.blue[400], 47 | Colors.green[400], 48 | Colors.blue[500], 49 | Colors.green[500], 50 | Colors.blue[600], 51 | Colors.green[600], 52 | Colors.blue[700], 53 | Colors.green[700], 54 | Colors.blue[800], 55 | Colors.green[800], 56 | Colors.blue[900], 57 | Colors.green[900], 58 | ]; 59 | AnimationPlayStates? playState; 60 | 61 | @override 62 | void initState() { 63 | keys = List.generate(numKeys, (_) => GlobalKey()); 64 | playState = widget.playState; 65 | forceUnwrap(WidgetsBinding.instance)!.addPostFrameCallback((_) { 66 | handlePlayState(); 67 | }); 68 | super.initState(); 69 | } 70 | 71 | @override 72 | void reassemble() { 73 | if (mounted) { 74 | handlePlayState(); 75 | } 76 | super.reassemble(); 77 | } 78 | 79 | void reverse() { 80 | setState(() { 81 | playState = AnimationPlayStates.Reverse; 82 | }); 83 | handlePlayState(); 84 | } 85 | 86 | void stop() { 87 | setState(() { 88 | playState = AnimationPlayStates.None; 89 | }); 90 | handlePlayState(); 91 | } 92 | 93 | void forward() { 94 | setState(() { 95 | playState = AnimationPlayStates.Forward; 96 | }); 97 | handlePlayState(); 98 | } 99 | 100 | void loop() { 101 | setState(() { 102 | playState = AnimationPlayStates.Loop; 103 | }); 104 | handlePlayState(); 105 | } 106 | 107 | handlePlayState() { 108 | keys.forEach((key) { 109 | if (key.currentState != null) { 110 | key.currentState!.handlePlayState(playState); 111 | } 112 | }); 113 | } 114 | 115 | @override 116 | Widget build(BuildContext context) { 117 | return Container(); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /lib/widgets/attention_seekers/pulse.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [Pulse] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class PulseAnimation extends AnimationDefinition { 33 | PulseAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super(preferences: preferences); 36 | 37 | @override 38 | Widget build(BuildContext context, Animator animator, Widget child) { 39 | return AnimatedBuilder( 40 | animation: animator.controller!, 41 | child: child, 42 | builder: (BuildContext context, Widget? child) => Transform( 43 | child: child, 44 | transform: Matrix4.identity().scaled(animator.get("scale")!.value), 45 | alignment: FractionalOffset(0.5, 0.5), 46 | ), 47 | ); 48 | } 49 | 50 | @override 51 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 52 | return { 53 | "scale": TweenList( 54 | [ 55 | TweenPercentage(percent: 0, value: 1.0), 56 | TweenPercentage( 57 | percent: 50, value: 1.0 + 0.05 * preferences.magnitude), 58 | TweenPercentage(percent: 100, value: 1.0), 59 | ], 60 | ), 61 | }; 62 | } 63 | } 64 | 65 | /// Example of using Pulse: 66 | /// 67 | /// ```dart 68 | /// class ExampleWidget extends StatelessWidget { 69 | /// 70 | /// @override 71 | /// Widget build(BuildContext context) { 72 | /// return Pulse(child: Text('Bounce')); 73 | /// } 74 | /// 75 | /// } 76 | /// ``` 77 | class Pulse extends AnimatorWidget { 78 | Pulse({ 79 | Key? key, 80 | required Widget child, 81 | AnimationPreferences preferences = const AnimationPreferences(), 82 | }) : super( 83 | key: key, 84 | child: child, 85 | definition: PulseAnimation(preferences: preferences)); 86 | } 87 | -------------------------------------------------------------------------------- /lib/widgets/sliding_entrances/slide_in_up.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideInUp] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideInUpAnimation extends AnimationDefinition { 33 | SlideInUpAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super( 36 | preferences: preferences, 37 | needsScreenSize: true, 38 | preRenderOpacity: 0.0, 39 | ); 40 | 41 | @override 42 | Widget build(BuildContext context, Animator animator, Widget child) { 43 | return AnimatedBuilder( 44 | animation: animator.controller!, 45 | child: child, 46 | builder: (BuildContext context, Widget? child) => Transform.translate( 47 | child: child, 48 | offset: Offset(0.0, animator.get("translateY")!.value), 49 | ), 50 | ); 51 | } 52 | 53 | @override 54 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 55 | return { 56 | "translateY": TweenList( 57 | [ 58 | TweenPercentage(percent: 0, value: screenSize!.height), 59 | TweenPercentage(percent: 100, value: 0.0), 60 | ], 61 | ), 62 | }; 63 | } 64 | } 65 | 66 | /// Example of using SlideInUp: 67 | /// 68 | /// ```dart 69 | /// class ExampleWidget extends StatelessWidget { 70 | /// 71 | /// @override 72 | /// Widget build(BuildContext context) { 73 | /// return SlideInUp(child: Text('Bounce')); 74 | /// } 75 | /// 76 | /// } 77 | /// ``` 78 | class SlideInUp extends AnimatorWidget { 79 | SlideInUp({ 80 | Key? key, 81 | required Widget child, 82 | AnimationPreferences preferences = const AnimationPreferences(), 83 | }) : super( 84 | key: key, 85 | child: child, 86 | definition: SlideInUpAnimation(preferences: preferences)); 87 | } 88 | -------------------------------------------------------------------------------- /demo_app/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /lib/widgets/sliding_entrances/slide_in_down.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideInDown] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideInDownAnimation extends AnimationDefinition { 33 | SlideInDownAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super( 36 | preferences: preferences, 37 | needsScreenSize: true, 38 | preRenderOpacity: 0.0, 39 | ); 40 | 41 | @override 42 | Widget build(BuildContext context, Animator animator, Widget child) { 43 | return AnimatedBuilder( 44 | animation: animator.controller!, 45 | child: child, 46 | builder: (BuildContext context, Widget? child) => Transform.translate( 47 | child: child, 48 | offset: Offset(0.0, animator.get("translateY")!.value), 49 | ), 50 | ); 51 | } 52 | 53 | @override 54 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 55 | return { 56 | "translateY": TweenList( 57 | [ 58 | TweenPercentage(percent: 0, value: -screenSize!.height), 59 | TweenPercentage(percent: 100, value: 0.0), 60 | ], 61 | ), 62 | }; 63 | } 64 | } 65 | 66 | /// Example of using SlideInDown: 67 | /// 68 | /// ```dart 69 | /// class ExampleWidget extends StatelessWidget { 70 | /// 71 | /// @override 72 | /// Widget build(BuildContext context) { 73 | /// return SlideInDown(child: Text('Bounce')); 74 | /// } 75 | /// 76 | /// } 77 | /// ``` 78 | class SlideInDown extends AnimatorWidget { 79 | SlideInDown({ 80 | Key? key, 81 | required Widget child, 82 | AnimationPreferences preferences = const AnimationPreferences(), 83 | }) : super( 84 | key: key, 85 | child: child, 86 | definition: SlideInDownAnimation(preferences: preferences)); 87 | } 88 | -------------------------------------------------------------------------------- /lib/widgets/sliding_entrances/slide_in_left.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideInLeft] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideInLeftAnimation extends AnimationDefinition { 33 | SlideInLeftAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super( 36 | preferences: preferences, 37 | needsScreenSize: true, 38 | preRenderOpacity: 0.0, 39 | ); 40 | 41 | @override 42 | Widget build(BuildContext context, Animator animator, Widget child) { 43 | return AnimatedBuilder( 44 | animation: animator.controller!, 45 | child: child, 46 | builder: (BuildContext context, Widget? child) => Transform.translate( 47 | child: child, 48 | offset: Offset(animator.get("translateX")!.value, 0.0), 49 | ), 50 | ); 51 | } 52 | 53 | @override 54 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 55 | return { 56 | "translateX": TweenList( 57 | [ 58 | TweenPercentage(percent: 0, value: -screenSize!.width), 59 | TweenPercentage(percent: 100, value: 0.0), 60 | ], 61 | ), 62 | }; 63 | } 64 | } 65 | 66 | /// Example of using SlideInLeft: 67 | /// 68 | /// ```dart 69 | /// class ExampleWidget extends StatelessWidget { 70 | /// 71 | /// @override 72 | /// Widget build(BuildContext context) { 73 | /// return SlideInLeft(child: Text('Bounce')); 74 | /// } 75 | /// 76 | /// } 77 | /// ``` 78 | class SlideInLeft extends AnimatorWidget { 79 | SlideInLeft({ 80 | Key? key, 81 | required Widget child, 82 | AnimationPreferences preferences = const AnimationPreferences(), 83 | }) : super( 84 | key: key, 85 | child: child, 86 | definition: SlideInLeftAnimation(preferences: preferences)); 87 | } 88 | -------------------------------------------------------------------------------- /lib/widgets/sliding_entrances/slide_in_right.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2020 Sjoerd van den Berg 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import 'package:flutter/widgets.dart'; 26 | 27 | import '../../flutter_animator.dart'; 28 | 29 | ///Used by [SlideInRight] widget. 30 | ///Note: You can also pass this into an [InOutAnimation] widget to define the 31 | ///in/out animation. 32 | class SlideInRightAnimation extends AnimationDefinition { 33 | SlideInRightAnimation({ 34 | AnimationPreferences preferences = const AnimationPreferences(), 35 | }) : super( 36 | preferences: preferences, 37 | needsScreenSize: true, 38 | preRenderOpacity: 0.0, 39 | ); 40 | 41 | @override 42 | Widget build(BuildContext context, Animator animator, Widget child) { 43 | return AnimatedBuilder( 44 | animation: animator.controller!, 45 | child: child, 46 | builder: (BuildContext context, Widget? child) => Transform.translate( 47 | child: child, 48 | offset: Offset(animator.get("translateX")!.value, 0.0), 49 | ), 50 | ); 51 | } 52 | 53 | @override 54 | Map getDefinition({Size? screenSize, Size? widgetSize}) { 55 | return { 56 | "translateX": TweenList( 57 | [ 58 | TweenPercentage(percent: 0, value: screenSize!.width), 59 | TweenPercentage(percent: 100, value: 0.0), 60 | ], 61 | ), 62 | }; 63 | } 64 | } 65 | 66 | /// Example of using SlideInRight: 67 | /// 68 | /// ```dart 69 | /// class ExampleWidget extends StatelessWidget { 70 | /// 71 | /// @override 72 | /// Widget build(BuildContext context) { 73 | /// return SlideInRight(child: Text('Bounce')); 74 | /// } 75 | /// 76 | /// } 77 | /// ``` 78 | class SlideInRight extends AnimatorWidget { 79 | SlideInRight({ 80 | Key? key, 81 | required Widget child, 82 | AnimationPreferences preferences = const AnimationPreferences(), 83 | }) : super( 84 | key: key, 85 | child: child, 86 | definition: SlideInRightAnimation(preferences: preferences)); 87 | } 88 | -------------------------------------------------------------------------------- /example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | pkg_check_modules(BLKID REQUIRED IMPORTED_TARGET blkid) 28 | pkg_check_modules(LZMA REQUIRED IMPORTED_TARGET liblzma) 29 | 30 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 31 | 32 | # Published to parent scope for install step. 33 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 34 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 35 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 36 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 37 | 38 | list(APPEND FLUTTER_LIBRARY_HEADERS 39 | "fl_basic_message_channel.h" 40 | "fl_binary_codec.h" 41 | "fl_binary_messenger.h" 42 | "fl_dart_project.h" 43 | "fl_engine.h" 44 | "fl_json_message_codec.h" 45 | "fl_json_method_codec.h" 46 | "fl_message_codec.h" 47 | "fl_method_call.h" 48 | "fl_method_channel.h" 49 | "fl_method_codec.h" 50 | "fl_method_response.h" 51 | "fl_plugin_registrar.h" 52 | "fl_plugin_registry.h" 53 | "fl_standard_message_codec.h" 54 | "fl_standard_method_codec.h" 55 | "fl_string_codec.h" 56 | "fl_value.h" 57 | "fl_view.h" 58 | "flutter_linux.h" 59 | ) 60 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 61 | add_library(flutter INTERFACE) 62 | target_include_directories(flutter INTERFACE 63 | "${EPHEMERAL_DIR}" 64 | ) 65 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 66 | target_link_libraries(flutter INTERFACE 67 | PkgConfig::GTK 68 | PkgConfig::GLIB 69 | PkgConfig::GIO 70 | PkgConfig::BLKID 71 | PkgConfig::LZMA 72 | ) 73 | add_dependencies(flutter flutter_assemble) 74 | 75 | # === Flutter tool backend === 76 | # _phony_ is a non-existent file to force this command to run every time, 77 | # since currently there's no way to get a full input/output list from the 78 | # flutter tool. 79 | add_custom_command( 80 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 81 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 82 | COMMAND ${CMAKE_COMMAND} -E env 83 | ${FLUTTER_TOOL_ENVIRONMENT} 84 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 85 | linux-x64 ${CMAKE_BUILD_TYPE} 86 | VERBATIM 87 | ) 88 | add_custom_target(flutter_assemble DEPENDS 89 | "${FLUTTER_LIBRARY}" 90 | ${FLUTTER_LIBRARY_HEADERS} 91 | ) 92 | --------------------------------------------------------------------------------