Tidyup `animations` sample (#1672)

* Tidyup

* Drop `flutterAnimateDemos`
pull/1683/head
Brett Morgan 2 years ago committed by GitHub
parent 1a8c9a45b1
commit b52d7f7744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1 @@
include: package:analysis_defaults/flutter.yaml
linter:
rules:
# Required because of the numbered sources in lib/src/basics
file_names: false

@ -7,29 +7,10 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
// ignore: depend_on_referenced_packages
import 'package:window_size/window_size.dart';
import 'src/basics/01_animated_container.dart';
import 'src/basics/02_page_route_builder.dart';
import 'src/basics/03_animation_controller.dart';
import 'src/basics/04_tweens.dart';
import 'src/basics/05_animated_builder.dart';
import 'src/basics/06_custom_tween.dart';
import 'src/basics/07_tween_sequence.dart';
import 'src/basics/08_fade_transition.dart';
import 'src/misc/animated_list.dart';
import 'src/misc/animated_positioned.dart';
import 'src/misc/animated_switcher.dart';
import 'src/misc/card_swipe.dart';
import 'src/misc/carousel.dart';
import 'src/misc/curved_animation.dart';
import 'src/misc/expand_card.dart';
import 'src/misc/focus_image.dart';
import 'src/misc/hero_animation.dart';
import 'src/misc/physics_card_drag.dart';
import 'src/misc/repeating_animation.dart';
import 'src/basics/basics.dart';
import 'src/misc/misc.dart';
void main() {
setupWindow();
@ -69,84 +50,103 @@ class Demo {
final basicDemos = [
Demo(
name: 'AnimatedContainer',
route: AnimatedContainerDemo.routeName,
builder: (context) => const AnimatedContainerDemo()),
Demo(
name: 'PageRouteBuilder',
route: PageRouteBuilderDemo.routeName,
builder: (context) => const PageRouteBuilderDemo()),
Demo(
name: 'Animation Controller',
route: AnimationControllerDemo.routeName,
builder: (context) => const AnimationControllerDemo()),
Demo(
name: 'Tweens',
route: TweenDemo.routeName,
builder: (context) => const TweenDemo()),
Demo(
name: 'AnimatedBuilder',
route: AnimatedBuilderDemo.routeName,
builder: (context) => const AnimatedBuilderDemo()),
Demo(
name: 'Custom Tween',
route: CustomTweenDemo.routeName,
builder: (context) => const CustomTweenDemo()),
Demo(
name: 'Tween Sequences',
route: TweenSequenceDemo.routeName,
builder: (context) => const TweenSequenceDemo()),
Demo(
name: 'Fade Transition',
route: FadeTransitionDemo.routeName,
builder: (context) => const FadeTransitionDemo()),
name: 'AnimatedContainer',
route: AnimatedContainerDemo.routeName,
builder: (context) => const AnimatedContainerDemo(),
),
Demo(
name: 'PageRouteBuilder',
route: PageRouteBuilderDemo.routeName,
builder: (context) => const PageRouteBuilderDemo(),
),
Demo(
name: 'Animation Controller',
route: AnimationControllerDemo.routeName,
builder: (context) => const AnimationControllerDemo(),
),
Demo(
name: 'Tweens',
route: TweenDemo.routeName,
builder: (context) => const TweenDemo(),
),
Demo(
name: 'AnimatedBuilder',
route: AnimatedBuilderDemo.routeName,
builder: (context) => const AnimatedBuilderDemo(),
),
Demo(
name: 'Custom Tween',
route: CustomTweenDemo.routeName,
builder: (context) => const CustomTweenDemo(),
),
Demo(
name: 'Tween Sequences',
route: TweenSequenceDemo.routeName,
builder: (context) => const TweenSequenceDemo(),
),
Demo(
name: 'Fade Transition',
route: FadeTransitionDemo.routeName,
builder: (context) => const FadeTransitionDemo(),
),
];
final miscDemos = [
Demo(
name: 'Expandable Card',
route: ExpandCardDemo.routeName,
builder: (context) => const ExpandCardDemo()),
Demo(
name: 'Carousel',
route: CarouselDemo.routeName,
builder: (context) => CarouselDemo()),
Demo(
name: 'Focus Image',
route: FocusImageDemo.routeName,
builder: (context) => const FocusImageDemo()),
Demo(
name: 'Card Swipe',
route: CardSwipeDemo.routeName,
builder: (context) => const CardSwipeDemo()),
Demo(
name: 'Repeating Animation',
route: RepeatingAnimationDemo.routeName,
builder: (context) => const RepeatingAnimationDemo()),
Demo(
name: 'Spring Physics',
route: PhysicsCardDragDemo.routeName,
builder: (context) => const PhysicsCardDragDemo()),
Demo(
name: 'AnimatedList',
route: AnimatedListDemo.routeName,
builder: (context) => const AnimatedListDemo()),
Demo(
name: 'AnimatedPositioned',
route: AnimatedPositionedDemo.routeName,
builder: (context) => const AnimatedPositionedDemo()),
Demo(
name: 'AnimatedSwitcher',
route: AnimatedSwitcherDemo.routeName,
builder: (context) => const AnimatedSwitcherDemo()),
Demo(
name: 'Hero Animation',
route: HeroAnimationDemo.routeName,
builder: (context) => const HeroAnimationDemo()),
Demo(
name: 'Curved Animation',
route: CurvedAnimationDemo.routeName,
builder: (context) => const CurvedAnimationDemo()),
name: 'Expandable Card',
route: ExpandCardDemo.routeName,
builder: (context) => const ExpandCardDemo(),
),
Demo(
name: 'Carousel',
route: CarouselDemo.routeName,
builder: (context) => CarouselDemo(),
),
Demo(
name: 'Focus Image',
route: FocusImageDemo.routeName,
builder: (context) => const FocusImageDemo(),
),
Demo(
name: 'Card Swipe',
route: CardSwipeDemo.routeName,
builder: (context) => const CardSwipeDemo(),
),
Demo(
name: 'Repeating Animation',
route: RepeatingAnimationDemo.routeName,
builder: (context) => const RepeatingAnimationDemo(),
),
Demo(
name: 'Spring Physics',
route: PhysicsCardDragDemo.routeName,
builder: (context) => const PhysicsCardDragDemo(),
),
Demo(
name: 'AnimatedList',
route: AnimatedListDemo.routeName,
builder: (context) => const AnimatedListDemo(),
),
Demo(
name: 'AnimatedPositioned',
route: AnimatedPositionedDemo.routeName,
builder: (context) => const AnimatedPositionedDemo(),
),
Demo(
name: 'AnimatedSwitcher',
route: AnimatedSwitcherDemo.routeName,
builder: (context) => const AnimatedSwitcherDemo(),
),
Demo(
name: 'Hero Animation',
route: HeroAnimationDemo.routeName,
builder: (context) => const HeroAnimationDemo(),
),
Demo(
name: 'Curved Animation',
route: CurvedAnimationDemo.routeName,
builder: (context) => const CurvedAnimationDemo(),
),
];
final router = GoRouter(

@ -12,7 +12,7 @@ Color generateColor() => Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
class AnimatedContainerDemo extends StatefulWidget {
const AnimatedContainerDemo({super.key});
static String routeName = 'basics/01_animated_container';
static String routeName = 'basics/animated_container';
@override
State<AnimatedContainerDemo> createState() => _AnimatedContainerDemoState();

@ -0,0 +1,8 @@
export 'animated_builder.dart';
export 'animated_container.dart';
export 'animation_controller.dart';
export 'custom_tween.dart';
export 'fade_transition.dart';
export 'page_route_builder.dart';
export 'tween_sequence.dart';
export 'tweens.dart';

@ -0,0 +1,11 @@
export 'animated_list.dart';
export 'animated_positioned.dart';
export 'animated_switcher.dart';
export 'card_swipe.dart';
export 'carousel.dart';
export 'curved_animation.dart';
export 'expand_card.dart';
export 'focus_image.dart';
export 'hero_animation.dart';
export 'physics_card_drag.dart';
export 'repeating_animation.dart';

@ -26,6 +26,7 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
46BDFA35DB031F3E68654AA8 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACF9E1ABA1C3C8D0140F55BF /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -54,7 +55,7 @@
/* Begin PBXFileReference section */
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* animations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "animations.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* animations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = animations.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@ -66,8 +67,12 @@
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
6263FDA45278D1E1A1C44CCB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
A10FEB2D480427F5DD7D87B8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
AAA0A655223EA6C9592E80E9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
ACF9E1ABA1C3C8D0140F55BF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -75,6 +80,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
46BDFA35DB031F3E68654AA8 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -99,6 +105,7 @@
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
92A4A71A06107640619AFC63 /* Pods */,
);
sourceTree = "<group>";
};
@ -145,9 +152,21 @@
path = Runner;
sourceTree = "<group>";
};
92A4A71A06107640619AFC63 /* Pods */ = {
isa = PBXGroup;
children = (
A10FEB2D480427F5DD7D87B8 /* Pods-Runner.debug.xcconfig */,
6263FDA45278D1E1A1C44CCB /* Pods-Runner.release.xcconfig */,
AAA0A655223EA6C9592E80E9 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
ACF9E1ABA1C3C8D0140F55BF /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -159,11 +178,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
68A342AE164D57E216F39779 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
4E0995C019E07EDB956A00F7 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -271,6 +292,45 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
4E0995C019E07EDB956A00F7 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
68A342AE164D57E216F39779 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */

@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

@ -9,8 +9,11 @@ environment:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
go_router: ^6.0.0
window_size: # plugin is not yet part of the flutter framework
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
dev_dependencies:
analysis_defaults:
@ -18,11 +21,6 @@ dev_dependencies:
flutter_test:
sdk: flutter
# plugin is not yet part of the flutter framework
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
flutter:
uses-material-design: true

Loading…
Cancel
Save