From 814a28f13d2c628092e145132970f4d0085d8643 Mon Sep 17 00:00:00 2001 From: akups Date: Mon, 16 Dec 2024 10:36:51 +0100 Subject: [PATCH 1/2] added go router and set up --- ecommerce_app/ios/.gitignore | 157 ++++++++++++++---- ecommerce_app/ios/Flutter/Debug.xcconfig | 1 + ecommerce_app/ios/Flutter/Flutter.podspec | 18 ++ ecommerce_app/ios/Flutter/Release.xcconfig | 1 + ecommerce_app/ios/Podfile | 44 +++++ ecommerce_app/ios/Podfile.lock | 23 +++ .../ios/Runner.xcodeproj/project.pbxproj | 112 +++++++++++++ .../contents.xcworkspacedata | 3 + ecommerce_app/lib/main.dart | 1 + ecommerce_app/lib/src/app.dart | 13 +- .../macos/Flutter/Flutter-Debug.xcconfig | 1 + .../macos/Flutter/Flutter-Release.xcconfig | 1 + .../Flutter/GeneratedPluginRegistrant.swift | 2 + ecommerce_app/macos/Podfile | 43 +++++ ecommerce_app/pubspec.lock | 63 ++++++- ecommerce_app/pubspec.yaml | 4 +- 16 files changed, 450 insertions(+), 37 deletions(-) create mode 100644 ecommerce_app/ios/Flutter/Flutter.podspec create mode 100644 ecommerce_app/ios/Podfile create mode 100644 ecommerce_app/ios/Podfile.lock create mode 100644 ecommerce_app/macos/Podfile diff --git a/ecommerce_app/ios/.gitignore b/ecommerce_app/ios/.gitignore index 7a7f9873..4f2b38b1 100644 --- a/ecommerce_app/ios/.gitignore +++ b/ecommerce_app/ios/.gitignore @@ -1,34 +1,127 @@ -**/dgph -*.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/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ +.vscode/settings.json + +# Flutter repo-specific +/bin/cache/ +/bin/mingit/ +/dev/benchmarks/mega_gallery/ +/dev/bots/.recipe_deps +/dev/bots/android_tools/ +/dev/docs/doc/ +/dev/docs/flutter.docs.zip +/dev/docs/lib/ +/dev/docs/pubspec.yaml +/packages/flutter/coverage/ +version + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ +flutter_*.png +linked_*.ds +unlinked.ds +unlinked_spec.ds +.flutter-plugins-dependencies + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java +**/android/key.properties +*.jks + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* +**/ios/Flutter/flutter_export_environment.sh +**/ios/Flutter/.last_build_id + +#macos related +**/macos/Flutter/GeneratedPluginRegistrant.* + + +# Web related +lib/generated_plugin_registrant.dart +.firebase/hosting* # Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# Firebase local emulator exports +firebase-exports + +# Environment variables +.env.dev +.env.stg +.env.prod + +# Ignore test coverage data +coverage/lcov.info diff --git a/ecommerce_app/ios/Flutter/Debug.xcconfig b/ecommerce_app/ios/Flutter/Debug.xcconfig index 592ceee8..ec97fc6f 100644 --- a/ecommerce_app/ios/Flutter/Debug.xcconfig +++ b/ecommerce_app/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ecommerce_app/ios/Flutter/Flutter.podspec b/ecommerce_app/ios/Flutter/Flutter.podspec new file mode 100644 index 00000000..98e16339 --- /dev/null +++ b/ecommerce_app/ios/Flutter/Flutter.podspec @@ -0,0 +1,18 @@ +# +# This podspec is NOT to be published. It is only used as a local source! +# This is a generated file; do not edit or check into version control. +# + +Pod::Spec.new do |s| + s.name = 'Flutter' + s.version = '1.0.0' + s.summary = 'A UI toolkit for beautiful and fast apps.' + s.homepage = 'https://flutter.dev' + s.license = { :type => 'BSD' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } + s.ios.deployment_target = '12.0' + # Framework linking is handled by Flutter tooling, not CocoaPods. + # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. + s.vendored_frameworks = 'path/to/nothing' +end diff --git a/ecommerce_app/ios/Flutter/Release.xcconfig b/ecommerce_app/ios/Flutter/Release.xcconfig index 592ceee8..c4855bfe 100644 --- a/ecommerce_app/ios/Flutter/Release.xcconfig +++ b/ecommerce_app/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ecommerce_app/ios/Podfile b/ecommerce_app/ios/Podfile new file mode 100644 index 00000000..d97f17e2 --- /dev/null +++ b/ecommerce_app/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ecommerce_app/ios/Podfile.lock b/ecommerce_app/ios/Podfile.lock new file mode 100644 index 00000000..3a368667 --- /dev/null +++ b/ecommerce_app/ios/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - Flutter (1.0.0) + - webview_flutter_wkwebview (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - Flutter (from `Flutter`) + - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + webview_flutter_wkwebview: + :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin" + +SPEC CHECKSUMS: + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4 + +PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 + +COCOAPODS: 1.16.2 diff --git a/ecommerce_app/ios/Runner.xcodeproj/project.pbxproj b/ecommerce_app/ios/Runner.xcodeproj/project.pbxproj index c9f10772..d18e78ab 100644 --- a/ecommerce_app/ios/Runner.xcodeproj/project.pbxproj +++ b/ecommerce_app/ios/Runner.xcodeproj/project.pbxproj @@ -11,9 +11,11 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 91D9D6EBDC999676148E8EC9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0433ED5C63D4DD2A000EFA20 /* Pods_Runner.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + B8ED2B00D7E93F09A37F0C2C /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 574F26006328965D54F5FBF2 /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -40,11 +42,18 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0433ED5C63D4DD2A000EFA20 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 13A97FB7ABD26A7967ECB143 /* 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 = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 193F331732028FA44B35253D /* 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 = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 37E613879CE075691EFF9009 /* 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 = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4F24F62A757259E2E4A5470C /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 572DB1E15E4EAA542CEA58E3 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 574F26006328965D54F5FBF2 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -55,6 +64,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AECEE1CA72F54E97CBB3F3B4 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,6 +72,15 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 91D9D6EBDC999676148E8EC9 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FE039B1BA8AD0BBCC5292161 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B8ED2B00D7E93F09A37F0C2C /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -76,6 +95,20 @@ path = RunnerTests; sourceTree = ""; }; + 4BC1587200B7E23E88F93A5F /* Pods */ = { + isa = PBXGroup; + children = ( + 37E613879CE075691EFF9009 /* Pods-Runner.debug.xcconfig */, + 13A97FB7ABD26A7967ECB143 /* Pods-Runner.release.xcconfig */, + 193F331732028FA44B35253D /* Pods-Runner.profile.xcconfig */, + 4F24F62A757259E2E4A5470C /* Pods-RunnerTests.debug.xcconfig */, + AECEE1CA72F54E97CBB3F3B4 /* Pods-RunnerTests.release.xcconfig */, + 572DB1E15E4EAA542CEA58E3 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -94,6 +127,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + 4BC1587200B7E23E88F93A5F /* Pods */, + C4F5BA75FBFF81F534865D8F /* Frameworks */, ); sourceTree = ""; }; @@ -121,6 +156,15 @@ path = Runner; sourceTree = ""; }; + C4F5BA75FBFF81F534865D8F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0433ED5C63D4DD2A000EFA20 /* Pods_Runner.framework */, + 574F26006328965D54F5FBF2 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -128,8 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + A9C14C5D87B5196AB9449BF2 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, + FE039B1BA8AD0BBCC5292161 /* Frameworks */, ); buildRules = ( ); @@ -145,12 +191,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + A07F862A94AB6C8130544FF3 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 343D9F0C208BA9D92F2B4712 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -222,6 +270,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 343D9F0C208BA9D92F2B4712 /* [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; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +318,50 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + A07F862A94AB6C8130544FF3 /* [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; + }; + A9C14C5D87B5196AB9449BF2 /* [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-RunnerTests-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 */ @@ -379,6 +488,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 4F24F62A757259E2E4A5470C /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -396,6 +506,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AECEE1CA72F54E97CBB3F3B4 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -411,6 +522,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 572DB1E15E4EAA542CEA58E3 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; diff --git a/ecommerce_app/ios/Runner.xcworkspace/contents.xcworkspacedata b/ecommerce_app/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16..21a3cc14 100644 --- a/ecommerce_app/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ecommerce_app/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/ecommerce_app/lib/main.dart b/ecommerce_app/lib/main.dart index 9f07d7fd..205d5ba4 100644 --- a/ecommerce_app/lib/main.dart +++ b/ecommerce_app/lib/main.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); + // * Register error handlers. For more info, see: // * https://docs.flutter.dev/testing/errors registerErrorHandlers(); diff --git a/ecommerce_app/lib/src/app.dart b/ecommerce_app/lib/src/app.dart index d280f694..97020f6f 100644 --- a/ecommerce_app/lib/src/app.dart +++ b/ecommerce_app/lib/src/app.dart @@ -1,17 +1,24 @@ import 'package:ecommerce_app/src/features/products_list/products_list_screen.dart'; import 'package:ecommerce_app/src/localization/string_hardcoded.dart'; import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { - return MaterialApp( + final goRouter = + GoRouter(initialLocation: '/', debugLogDiagnostics: true, routes: [ + GoRoute( + path: '/', + pageBuilder: (context, state) => + MaterialPage(child: const ProductsListScreen())), + ]); + return MaterialApp.router( debugShowCheckedModeBanner: false, restorationScopeId: 'app', - // * The home page of the app - home: const ProductsListScreen(), + routerConfig: goRouter, onGenerateTitle: (BuildContext context) => 'My Shop'.hardcoded, theme: ThemeData( // * Use this to toggle Material 3 (defaults to true since Flutter 3.16) diff --git a/ecommerce_app/macos/Flutter/Flutter-Debug.xcconfig b/ecommerce_app/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b6..4b81f9b2 100644 --- a/ecommerce_app/macos/Flutter/Flutter-Debug.xcconfig +++ b/ecommerce_app/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/ecommerce_app/macos/Flutter/Flutter-Release.xcconfig b/ecommerce_app/macos/Flutter/Flutter-Release.xcconfig index c2efd0b6..5caa9d15 100644 --- a/ecommerce_app/macos/Flutter/Flutter-Release.xcconfig +++ b/ecommerce_app/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/ecommerce_app/macos/Flutter/GeneratedPluginRegistrant.swift b/ecommerce_app/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817a..2a2bd5d8 100644 --- a/ecommerce_app/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/ecommerce_app/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import webview_flutter_wkwebview func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin")) } diff --git a/ecommerce_app/macos/Podfile b/ecommerce_app/macos/Podfile new file mode 100644 index 00000000..c795730d --- /dev/null +++ b/ecommerce_app/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/ecommerce_app/pubspec.lock b/ecommerce_app/pubspec.lock index e37e5de4..ba5f936e 100644 --- a/ecommerce_app/pubspec.lock +++ b/ecommerce_app/pubspec.lock @@ -131,6 +131,19 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: "73a50070c125c90f9960aad4da9e4a95d94558230727f145ac634528da1e75e3" + url: "https://pub.dev" + source: hosted + version: "7.0.0" image: dependency: transitive description: @@ -187,6 +200,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" matcher: dependency: transitive description: @@ -227,6 +248,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.2" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" quiver: dependency: transitive description: @@ -312,6 +341,38 @@ packages: url: "https://pub.dev" source: hosted version: "14.3.0" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + sha256: "889a0a678e7c793c308c68739996227c9661590605e70b1f6cf6b9a6634f7aec" + url: "https://pub.dev" + source: hosted + version: "4.10.0" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + sha256: "285cedfd9441267f6cca8843458620b5fda1af75b04f5818d0441acda5d7df19" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + sha256: d937581d6e558908d7ae3dc1989c4f87b786891ab47bb9df7de548a151779d8d + url: "https://pub.dev" + source: hosted + version: "2.10.0" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + sha256: b7e92f129482460951d96ef9a46b49db34bd2e1621685de26e9eaafd9674e7eb + url: "https://pub.dev" + source: hosted + version: "3.16.3" xml: dependency: transitive description: @@ -330,4 +391,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.5.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.24.0" diff --git a/ecommerce_app/pubspec.yaml b/ecommerce_app/pubspec.yaml index 902485e2..8efb7290 100644 --- a/ecommerce_app/pubspec.yaml +++ b/ecommerce_app/pubspec.yaml @@ -2,7 +2,7 @@ name: ecommerce_app description: Flutter eCommerce app (part of the Complete Flutter Course Bundle) # Prevent accidental publishing to pub.dev. -publish_to: 'none' +publish_to: "none" version: 1.0.0+1 @@ -16,6 +16,8 @@ dependencies: intl: 0.19.0 flutter_layout_grid: 2.0.7 flutter_rating_bar: 4.0.1 + go_router: 7.0.0 + webview_flutter: 4.10.0 dev_dependencies: flutter_test: From 63e6f0517fae17f2a06dbe2688b8504ad1350cf1 Mon Sep 17 00:00:00 2001 From: akups Date: Mon, 16 Dec 2024 13:19:59 +0100 Subject: [PATCH 2/2] added subroutes --- ecommerce_app/lib/main.dart | 4 +++- ecommerce_app/lib/src/app.dart | 10 +--------- .../home_app_bar/shopping_cart_icon.dart | 8 ++------ ecommerce_app/lib/src/routing/app_router.dart | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 ecommerce_app/lib/src/routing/app_router.dart diff --git a/ecommerce_app/lib/main.dart b/ecommerce_app/lib/main.dart index 205d5ba4..68bce0de 100644 --- a/ecommerce_app/lib/main.dart +++ b/ecommerce_app/lib/main.dart @@ -1,11 +1,13 @@ import 'package:ecommerce_app/src/app.dart'; import 'package:ecommerce_app/src/localization/string_hardcoded.dart'; +// ignore: depend_on_referenced_packages +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - + usePathUrlStrategy(); // * Register error handlers. For more info, see: // * https://docs.flutter.dev/testing/errors registerErrorHandlers(); diff --git a/ecommerce_app/lib/src/app.dart b/ecommerce_app/lib/src/app.dart index 97020f6f..cc5e82d2 100644 --- a/ecommerce_app/lib/src/app.dart +++ b/ecommerce_app/lib/src/app.dart @@ -1,20 +1,12 @@ -import 'package:ecommerce_app/src/features/products_list/products_list_screen.dart'; import 'package:ecommerce_app/src/localization/string_hardcoded.dart'; +import 'package:ecommerce_app/src/routing/app_router.dart'; import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { - final goRouter = - GoRouter(initialLocation: '/', debugLogDiagnostics: true, routes: [ - GoRoute( - path: '/', - pageBuilder: (context, state) => - MaterialPage(child: const ProductsListScreen())), - ]); return MaterialApp.router( debugShowCheckedModeBanner: false, restorationScopeId: 'app', diff --git a/ecommerce_app/lib/src/features/home_app_bar/shopping_cart_icon.dart b/ecommerce_app/lib/src/features/home_app_bar/shopping_cart_icon.dart index 42f5fef8..445defe6 100644 --- a/ecommerce_app/lib/src/features/home_app_bar/shopping_cart_icon.dart +++ b/ecommerce_app/lib/src/features/home_app_bar/shopping_cart_icon.dart @@ -1,6 +1,7 @@ import 'package:ecommerce_app/src/features/shopping_cart/shopping_cart_screen.dart'; import 'package:flutter/material.dart'; import 'package:ecommerce_app/src/constants/app_sizes.dart'; +import 'package:go_router/go_router.dart'; /// Shopping cart icon with items count badge class ShoppingCartIcon extends StatelessWidget { @@ -19,12 +20,7 @@ class ShoppingCartIcon extends StatelessWidget { child: IconButton( key: shoppingCartIconKey, icon: const Icon(Icons.shopping_cart), - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - fullscreenDialog: true, - builder: (_) => const ShoppingCartScreen(), - ), - ), + onPressed: () => GoRouter.of(context).go('/cart'), ), ), if (cartItemsCount > 0) diff --git a/ecommerce_app/lib/src/routing/app_router.dart b/ecommerce_app/lib/src/routing/app_router.dart new file mode 100644 index 00000000..59b59801 --- /dev/null +++ b/ecommerce_app/lib/src/routing/app_router.dart @@ -0,0 +1,18 @@ +import 'package:ecommerce_app/src/features/products_list/products_list_screen.dart'; +import 'package:ecommerce_app/src/features/shopping_cart/shopping_cart_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +final goRouter = + GoRouter(initialLocation: '/', debugLogDiagnostics: true, routes: [ + GoRoute( + path: '/', + pageBuilder: (context, state) => + MaterialPage(child: const ProductsListScreen()), + routes: [ + GoRoute( + path: 'cart', + pageBuilder: (context, state) => + MaterialPage(child: const ShoppingCartScreen())) + ]), +]);