mirror of
https://github.com/flutter/samples.git
synced 2026-03-22 04:17:50 +00:00
touch ./animations (#148)
* Update project structure using flutter create and remove unused tests * Small updates to main.dart * Update maintenance.md * Add missing newline * Add rudimentary test * Apply formatting
This commit is contained in:
@@ -6,7 +6,7 @@ match any new language/SDK features, etc.).
|
|||||||
|
|
||||||
| Sample | GH username | Date Updated |
|
| Sample | GH username | Date Updated |
|
||||||
| :------------------------ | -----------------: | -------------: |
|
| :------------------------ | -----------------: | -------------: |
|
||||||
| animations | | |
|
| animations | theacodes | 10/7/19 |
|
||||||
| chrome-os-best-practices | | |
|
| chrome-os-best-practices | | |
|
||||||
| experimental | | |
|
| experimental | | |
|
||||||
| flutter_maps_firestore | | |
|
| flutter_maps_firestore | | |
|
||||||
|
|||||||
1
animations/.gitignore
vendored
1
animations/.gitignore
vendored
@@ -61,6 +61,7 @@
|
|||||||
**/ios/Flutter/app.flx
|
**/ios/Flutter/app.flx
|
||||||
**/ios/Flutter/app.zip
|
**/ios/Flutter/app.zip
|
||||||
**/ios/Flutter/flutter_assets/
|
**/ios/Flutter/flutter_assets/
|
||||||
|
**/ios/Flutter/flutter_export_environment.sh
|
||||||
**/ios/ServiceDefinitions.json
|
**/ios/ServiceDefinitions.json
|
||||||
**/ios/Runner/GeneratedPluginRegistrant.*
|
**/ios/Runner/GeneratedPluginRegistrant.*
|
||||||
|
|
||||||
|
|||||||
7
animations/android/.gitignore
vendored
Normal file
7
animations/android/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
gradle-wrapper.jar
|
||||||
|
/.gradle
|
||||||
|
/captures/
|
||||||
|
/gradlew
|
||||||
|
/gradlew.bat
|
||||||
|
/local.properties
|
||||||
|
GeneratedPluginRegistrant.java
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
31
animations/ios/.gitignore
vendored
Normal file
31
animations/ios/.gitignore
vendored
Normal file
@@ -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
|
||||||
13
animations/ios/Runner/AppDelegate.swift
Normal file
13
animations/ios/Runner/AppDelegate.swift
Normal file
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
1
animations/ios/Runner/Runner-Bridging-Header.h
Normal file
1
animations/ios/Runner/Runner-Bridging-Header.h
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#import "GeneratedPluginRegistrant.h"
|
||||||
@@ -25,35 +25,65 @@ class Demo {
|
|||||||
final String route;
|
final String route;
|
||||||
final WidgetBuilder builder;
|
final WidgetBuilder builder;
|
||||||
|
|
||||||
const Demo(this.name, this.route, this.builder);
|
const Demo({this.name, this.route, this.builder});
|
||||||
}
|
}
|
||||||
|
|
||||||
final basicDemos = [
|
final basicDemos = [
|
||||||
Demo('AnimatedContainer', AnimatedContainerDemo.routeName,
|
Demo(
|
||||||
(context) => AnimatedContainerDemo()),
|
name: 'AnimatedContainer',
|
||||||
Demo('PageRouteBuilder', PageRouteBuilderDemo.routeName,
|
route: AnimatedContainerDemo.routeName,
|
||||||
(context) => PageRouteBuilderDemo()),
|
builder: (context) => AnimatedContainerDemo()),
|
||||||
Demo('Animation Controller', AnimationControllerDemo.routeName,
|
Demo(
|
||||||
(context) => AnimationControllerDemo()),
|
name: 'PageRouteBuilder',
|
||||||
Demo('Tweens', TweenDemo.routeName, (context) => TweenDemo()),
|
route: PageRouteBuilderDemo.routeName,
|
||||||
Demo('AnimatedBuilder', AnimatedBuilderDemo.routeName,
|
builder: (context) => PageRouteBuilderDemo()),
|
||||||
(context) => AnimatedBuilderDemo()),
|
Demo(
|
||||||
Demo('Custom Tween', CustomTweenDemo.routeName,
|
name: 'Animation Controller',
|
||||||
(context) => CustomTweenDemo()),
|
route: AnimationControllerDemo.routeName,
|
||||||
Demo('Tween Sequences', TweenSequenceDemo.routeName,
|
builder: (context) => AnimationControllerDemo()),
|
||||||
(context) => TweenSequenceDemo()),
|
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 = [
|
final miscDemos = [
|
||||||
Demo('Expandable Card', ExpandCardDemo.routeName,
|
Demo(
|
||||||
(context) => ExpandCardDemo()),
|
name: 'Expandable Card',
|
||||||
Demo('Carousel', CarouselDemo.routeName, (context) => CarouselDemo()),
|
route: ExpandCardDemo.routeName,
|
||||||
Demo('Focus Image', FocusImageDemo.routeName, (context) => FocusImageDemo()),
|
builder: (context) => ExpandCardDemo()),
|
||||||
Demo('Card Swipe', CardSwipeDemo.routeName, (context) => CardSwipeDemo()),
|
Demo(
|
||||||
Demo('Repeating Animation', RepeatingAnimationDemo.routeName,
|
name: 'Carousel',
|
||||||
(context) => RepeatingAnimationDemo()),
|
route: CarouselDemo.routeName,
|
||||||
Demo('Spring Physics', PhysicsCardDragDemo.routeName,
|
builder: (context) => CarouselDemo()),
|
||||||
(context) => PhysicsCardDragDemo()),
|
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 =
|
final basicDemoRoutes =
|
||||||
|
|||||||
@@ -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 {});
|
|
||||||
}
|
|
||||||
20
animations/test/widget_test.dart
Normal file
20
animations/test/widget_test.dart
Normal file
@@ -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);
|
||||||
|
});
|
||||||
|
}
|
||||||
10
animations/web/index.html
Normal file
10
animations/web/index.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>animations</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="main.dart.js" type="application/javascript"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user