diff --git a/animations/analysis_options.yaml b/animations/analysis_options.yaml index 3128ba1ec..13d6fe105 100644 --- a/animations/analysis_options.yaml +++ b/animations/analysis_options.yaml @@ -1,6 +1 @@ include: package:analysis_defaults/flutter.yaml - -linter: - rules: - # Required because of the numbered sources in lib/src/basics - file_names: false diff --git a/animations/lib/main.dart b/animations/lib/main.dart index 1bcbff2ea..e249abc77 100644 --- a/animations/lib/main.dart +++ b/animations/lib/main.dart @@ -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()), + name: 'AnimatedContainer', + route: AnimatedContainerDemo.routeName, + builder: (context) => const AnimatedContainerDemo(), + ), Demo( - name: 'PageRouteBuilder', - route: PageRouteBuilderDemo.routeName, - builder: (context) => const PageRouteBuilderDemo()), + name: 'PageRouteBuilder', + route: PageRouteBuilderDemo.routeName, + builder: (context) => const PageRouteBuilderDemo(), + ), Demo( - name: 'Animation Controller', - route: AnimationControllerDemo.routeName, - builder: (context) => const AnimationControllerDemo()), + name: 'Animation Controller', + route: AnimationControllerDemo.routeName, + builder: (context) => const AnimationControllerDemo(), + ), Demo( - name: 'Tweens', - route: TweenDemo.routeName, - builder: (context) => const TweenDemo()), + name: 'Tweens', + route: TweenDemo.routeName, + builder: (context) => const TweenDemo(), + ), Demo( - name: 'AnimatedBuilder', - route: AnimatedBuilderDemo.routeName, - builder: (context) => const AnimatedBuilderDemo()), + name: 'AnimatedBuilder', + route: AnimatedBuilderDemo.routeName, + builder: (context) => const AnimatedBuilderDemo(), + ), Demo( - name: 'Custom Tween', - route: CustomTweenDemo.routeName, - builder: (context) => const CustomTweenDemo()), + name: 'Custom Tween', + route: CustomTweenDemo.routeName, + builder: (context) => const CustomTweenDemo(), + ), Demo( - name: 'Tween Sequences', - route: TweenSequenceDemo.routeName, - builder: (context) => const TweenSequenceDemo()), + name: 'Tween Sequences', + route: TweenSequenceDemo.routeName, + builder: (context) => const TweenSequenceDemo(), + ), Demo( - name: 'Fade Transition', - route: FadeTransitionDemo.routeName, - builder: (context) => const FadeTransitionDemo()), + name: 'Fade Transition', + route: FadeTransitionDemo.routeName, + builder: (context) => const FadeTransitionDemo(), + ), ]; final miscDemos = [ Demo( - name: 'Expandable Card', - route: ExpandCardDemo.routeName, - builder: (context) => const ExpandCardDemo()), + name: 'Expandable Card', + route: ExpandCardDemo.routeName, + builder: (context) => const ExpandCardDemo(), + ), Demo( - name: 'Carousel', - route: CarouselDemo.routeName, - builder: (context) => CarouselDemo()), + name: 'Carousel', + route: CarouselDemo.routeName, + builder: (context) => CarouselDemo(), + ), Demo( - name: 'Focus Image', - route: FocusImageDemo.routeName, - builder: (context) => const FocusImageDemo()), + name: 'Focus Image', + route: FocusImageDemo.routeName, + builder: (context) => const FocusImageDemo(), + ), Demo( - name: 'Card Swipe', - route: CardSwipeDemo.routeName, - builder: (context) => const CardSwipeDemo()), + name: 'Card Swipe', + route: CardSwipeDemo.routeName, + builder: (context) => const CardSwipeDemo(), + ), Demo( - name: 'Repeating Animation', - route: RepeatingAnimationDemo.routeName, - builder: (context) => const RepeatingAnimationDemo()), + name: 'Repeating Animation', + route: RepeatingAnimationDemo.routeName, + builder: (context) => const RepeatingAnimationDemo(), + ), Demo( - name: 'Spring Physics', - route: PhysicsCardDragDemo.routeName, - builder: (context) => const PhysicsCardDragDemo()), + name: 'Spring Physics', + route: PhysicsCardDragDemo.routeName, + builder: (context) => const PhysicsCardDragDemo(), + ), Demo( - name: 'AnimatedList', - route: AnimatedListDemo.routeName, - builder: (context) => const AnimatedListDemo()), + name: 'AnimatedList', + route: AnimatedListDemo.routeName, + builder: (context) => const AnimatedListDemo(), + ), Demo( - name: 'AnimatedPositioned', - route: AnimatedPositionedDemo.routeName, - builder: (context) => const AnimatedPositionedDemo()), + name: 'AnimatedPositioned', + route: AnimatedPositionedDemo.routeName, + builder: (context) => const AnimatedPositionedDemo(), + ), Demo( - name: 'AnimatedSwitcher', - route: AnimatedSwitcherDemo.routeName, - builder: (context) => const AnimatedSwitcherDemo()), + name: 'AnimatedSwitcher', + route: AnimatedSwitcherDemo.routeName, + builder: (context) => const AnimatedSwitcherDemo(), + ), Demo( - name: 'Hero Animation', - route: HeroAnimationDemo.routeName, - builder: (context) => const HeroAnimationDemo()), + name: 'Hero Animation', + route: HeroAnimationDemo.routeName, + builder: (context) => const HeroAnimationDemo(), + ), Demo( - name: 'Curved Animation', - route: CurvedAnimationDemo.routeName, - builder: (context) => const CurvedAnimationDemo()), + name: 'Curved Animation', + route: CurvedAnimationDemo.routeName, + builder: (context) => const CurvedAnimationDemo(), + ), ]; final router = GoRouter( diff --git a/animations/lib/src/basics/05_animated_builder.dart b/animations/lib/src/basics/animated_builder.dart similarity index 100% rename from animations/lib/src/basics/05_animated_builder.dart rename to animations/lib/src/basics/animated_builder.dart diff --git a/animations/lib/src/basics/01_animated_container.dart b/animations/lib/src/basics/animated_container.dart similarity index 97% rename from animations/lib/src/basics/01_animated_container.dart rename to animations/lib/src/basics/animated_container.dart index ff226f2de..2e3e39d9b 100644 --- a/animations/lib/src/basics/01_animated_container.dart +++ b/animations/lib/src/basics/animated_container.dart @@ -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 createState() => _AnimatedContainerDemoState(); diff --git a/animations/lib/src/basics/03_animation_controller.dart b/animations/lib/src/basics/animation_controller.dart similarity index 100% rename from animations/lib/src/basics/03_animation_controller.dart rename to animations/lib/src/basics/animation_controller.dart diff --git a/animations/lib/src/basics/basics.dart b/animations/lib/src/basics/basics.dart new file mode 100644 index 000000000..7ac4e4a7c --- /dev/null +++ b/animations/lib/src/basics/basics.dart @@ -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'; diff --git a/animations/lib/src/basics/06_custom_tween.dart b/animations/lib/src/basics/custom_tween.dart similarity index 100% rename from animations/lib/src/basics/06_custom_tween.dart rename to animations/lib/src/basics/custom_tween.dart diff --git a/animations/lib/src/basics/08_fade_transition.dart b/animations/lib/src/basics/fade_transition.dart similarity index 100% rename from animations/lib/src/basics/08_fade_transition.dart rename to animations/lib/src/basics/fade_transition.dart diff --git a/animations/lib/src/basics/02_page_route_builder.dart b/animations/lib/src/basics/page_route_builder.dart similarity index 100% rename from animations/lib/src/basics/02_page_route_builder.dart rename to animations/lib/src/basics/page_route_builder.dart diff --git a/animations/lib/src/basics/07_tween_sequence.dart b/animations/lib/src/basics/tween_sequence.dart similarity index 100% rename from animations/lib/src/basics/07_tween_sequence.dart rename to animations/lib/src/basics/tween_sequence.dart diff --git a/animations/lib/src/basics/04_tweens.dart b/animations/lib/src/basics/tweens.dart similarity index 100% rename from animations/lib/src/basics/04_tweens.dart rename to animations/lib/src/basics/tweens.dart diff --git a/animations/lib/src/misc/misc.dart b/animations/lib/src/misc/misc.dart new file mode 100644 index 000000000..9da9d533d --- /dev/null +++ b/animations/lib/src/misc/misc.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'; diff --git a/animations/macos/Runner.xcodeproj/project.pbxproj b/animations/macos/Runner.xcodeproj/project.pbxproj index 5b2ad2ae6..7d00eb52d 100644 --- a/animations/macos/Runner.xcodeproj/project.pbxproj +++ b/animations/macos/Runner.xcodeproj/project.pbxproj @@ -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 = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 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 = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -66,8 +67,12 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; @@ -145,9 +152,21 @@ path = Runner; sourceTree = ""; }; + 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 = ""; + }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( + ACF9E1ABA1C3C8D0140F55BF /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -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 */ diff --git a/animations/macos/Runner.xcworkspace/contents.xcworkspacedata b/animations/macos/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16e..21a3cc14c 100644 --- a/animations/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/animations/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/animations/pubspec.yaml b/animations/pubspec.yaml index 2e3678601..3aba201f3 100644 --- a/animations/pubspec.yaml +++ b/animations/pubspec.yaml @@ -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