diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 117be4515..c4ec801af 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -6,7 +6,7 @@ match any new language/SDK features, etc.). | Sample | GH username | Date Updated | | :------------------------ | -----------------: | -------------: | -| animations | | | +| animations | theacodes | 10/7/19 | | chrome-os-best-practices | | | | experimental | | | | flutter_maps_firestore | | | diff --git a/animations/.gitignore b/animations/.gitignore index ac4a90645..2ddde2a5e 100644 --- a/animations/.gitignore +++ b/animations/.gitignore @@ -61,6 +61,7 @@ **/ios/Flutter/app.flx **/ios/Flutter/app.zip **/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh **/ios/ServiceDefinitions.json **/ios/Runner/GeneratedPluginRegistrant.* diff --git a/animations/android/.gitignore b/animations/android/.gitignore new file mode 100644 index 000000000..bc2100d8f --- /dev/null +++ b/animations/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/animations/android/app/src/main/kotlin/com/example/animations/MainActivity.kt b/animations/android/app/src/main/kotlin/com/example/animations/MainActivity.kt new file mode 100644 index 000000000..e9b2a5442 --- /dev/null +++ b/animations/android/app/src/main/kotlin/com/example/animations/MainActivity.kt @@ -0,0 +1,13 @@ +package com.example.animations + +import android.os.Bundle + +import io.flutter.app.FlutterActivity +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity: FlutterActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + GeneratedPluginRegistrant.registerWith(this) + } +} diff --git a/animations/ios/.gitignore b/animations/ios/.gitignore new file mode 100644 index 000000000..f78c1480b --- /dev/null +++ b/animations/ios/.gitignore @@ -0,0 +1,31 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/animations/ios/Runner/AppDelegate.swift b/animations/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/animations/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/animations/ios/Runner/Runner-Bridging-Header.h b/animations/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..7335fdf90 --- /dev/null +++ b/animations/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/animations/lib/main.dart b/animations/lib/main.dart index d57e5e6e7..188c1b1ff 100644 --- a/animations/lib/main.dart +++ b/animations/lib/main.dart @@ -25,35 +25,65 @@ class Demo { final String route; final WidgetBuilder builder; - const Demo(this.name, this.route, this.builder); + const Demo({this.name, this.route, this.builder}); } final basicDemos = [ - Demo('AnimatedContainer', AnimatedContainerDemo.routeName, - (context) => AnimatedContainerDemo()), - Demo('PageRouteBuilder', PageRouteBuilderDemo.routeName, - (context) => PageRouteBuilderDemo()), - Demo('Animation Controller', AnimationControllerDemo.routeName, - (context) => AnimationControllerDemo()), - Demo('Tweens', TweenDemo.routeName, (context) => TweenDemo()), - Demo('AnimatedBuilder', AnimatedBuilderDemo.routeName, - (context) => AnimatedBuilderDemo()), - Demo('Custom Tween', CustomTweenDemo.routeName, - (context) => CustomTweenDemo()), - Demo('Tween Sequences', TweenSequenceDemo.routeName, - (context) => TweenSequenceDemo()), + Demo( + name: 'AnimatedContainer', + route: AnimatedContainerDemo.routeName, + builder: (context) => AnimatedContainerDemo()), + Demo( + name: 'PageRouteBuilder', + route: PageRouteBuilderDemo.routeName, + builder: (context) => PageRouteBuilderDemo()), + Demo( + name: 'Animation Controller', + route: AnimationControllerDemo.routeName, + builder: (context) => AnimationControllerDemo()), + Demo( + name: 'Tweens', + route: TweenDemo.routeName, + builder: (context) => TweenDemo()), + Demo( + name: 'AnimatedBuilder', + route: AnimatedBuilderDemo.routeName, + builder: (context) => AnimatedBuilderDemo()), + Demo( + name: 'Custom Tween', + route: CustomTweenDemo.routeName, + builder: (context) => CustomTweenDemo()), + Demo( + name: 'Tween Sequences', + route: TweenSequenceDemo.routeName, + builder: (context) => TweenSequenceDemo()), ]; final miscDemos = [ - Demo('Expandable Card', ExpandCardDemo.routeName, - (context) => ExpandCardDemo()), - Demo('Carousel', CarouselDemo.routeName, (context) => CarouselDemo()), - Demo('Focus Image', FocusImageDemo.routeName, (context) => FocusImageDemo()), - Demo('Card Swipe', CardSwipeDemo.routeName, (context) => CardSwipeDemo()), - Demo('Repeating Animation', RepeatingAnimationDemo.routeName, - (context) => RepeatingAnimationDemo()), - Demo('Spring Physics', PhysicsCardDragDemo.routeName, - (context) => PhysicsCardDragDemo()), + Demo( + name: 'Expandable Card', + route: ExpandCardDemo.routeName, + builder: (context) => ExpandCardDemo()), + Demo( + name: 'Carousel', + route: CarouselDemo.routeName, + builder: (context) => CarouselDemo()), + Demo( + name: 'Focus Image', + route: FocusImageDemo.routeName, + builder: (context) => FocusImageDemo()), + Demo( + name: 'Card Swipe', + route: CardSwipeDemo.routeName, + builder: (context) => CardSwipeDemo()), + Demo( + name: 'Repeating Animation', + route: RepeatingAnimationDemo.routeName, + builder: (context) => RepeatingAnimationDemo()), + Demo( + name: 'Spring Physics', + route: PhysicsCardDragDemo.routeName, + builder: (context) => PhysicsCardDragDemo()), ]; final basicDemoRoutes = diff --git a/animations/test/empty_test.dart b/animations/test/empty_test.dart deleted file mode 100644 index 899d7439e..000000000 --- a/animations/test/empty_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2019 The Flutter team. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; - -void main() { - testWidgets('This test always passes', (tester) async {}); -} diff --git a/animations/test/widget_test.dart b/animations/test/widget_test.dart new file mode 100644 index 000000000..d43850b03 --- /dev/null +++ b/animations/test/widget_test.dart @@ -0,0 +1,20 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter_test/flutter_test.dart'; + +import 'package:animations/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(AnimationSamples()); + + // Verify that a least one of our demos is showing up in the list + expect(find.text('AnimatedContainer'), findsOneWidget); + }); +} diff --git a/animations/web/index.html b/animations/web/index.html new file mode 100644 index 000000000..e2530c5aa --- /dev/null +++ b/animations/web/index.html @@ -0,0 +1,10 @@ + + + + + animations + + + + +