diff --git a/.github/workflows/unit_test_and_coverage.yml b/.github/workflows/unit_test_and_coverage.yml index 9ca65d0..2d655f1 100644 --- a/.github/workflows/unit_test_and_coverage.yml +++ b/.github/workflows/unit_test_and_coverage.yml @@ -19,6 +19,12 @@ jobs: run: | flutter pub get sudo apt-get install -y lcov + - name: Running analyzer + run: flutter analyze + - name: Running formatter + run: dart format --set-exit-if-changed . + - name: Pre-testing + run: mkdir temporaryPath/ - name: Running mobile tests run: flutter test --coverage - name: Running web tests diff --git a/.gitignore b/.gitignore index ff9da5d..000521c 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,6 @@ build/ !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 + +# Files generated by testing +temporaryPath/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8afd198..f8ae9d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.1.0] + +- Dependencies updated to run with Flutter 3.13. + ## [1.0.0] - Test & coverage added diff --git a/README.md b/README.md index f80d964..49d7970 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -# Paulonia Cache Image (with null safety) +# Paulonia Cache Image [![codecov](https://codecov.io/gh/PauloniaAQP/paulonia_cache_image/branch/master/graph/badge.svg?token=UIMGQXYSFU)](https://codecov.io/gh/PauloniaAQP/paulonia_cache_image) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) -**Null safety:** This package supports [Null safety](https://pub.dev/packages/paulonia_cache_image/versions) but due to an error the null-safety badge is not placed ([Explanation](https://github.com/PauloniaAQP/paulonia_cache_image/issues/14#issuecomment-939391483)). - Flutter package for download and store images in cache. It supports in-memory and storage cache in Android, iOS and Web for network and Google Cloud Storage images. ![Gif](https://i.imgur.com/AsqxrUz.gif) diff --git a/example/.gitignore b/example/.gitignore index 7017a00..81ceefa 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -40,3 +40,9 @@ app.*.symbols # Obfuscation related app.*.map.json + +# Firebase configuration +android/app/google-services.json +ios/Runner/GoogleService-Info.plist +ios/firebase_app_id_file.json +lib/firebase_options.dart diff --git a/example/.metadata b/example/.metadata index 911b6b7..de745e4 100644 --- a/example/.metadata +++ b/example/.metadata @@ -1,10 +1,45 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: 81a45ec2e5f80fa71d5135f1702ce540558b416d - channel: beta + revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: android + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: ios + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: linux + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: macos + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: web + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: windows + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index 61b6c4d..670d939 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1,29 +1 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: package:very_good_analysis/analysis_options.yaml \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 79953b1..4d2ca15 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 80152c3..fd4e073 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher"> CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) + en CFBundleExecutable App CFBundleIdentifier @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/example/ios/Podfile b/example/ios/Podfile new file mode 100644 index 0000000..fdcc671 --- /dev/null +++ b/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.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/example/ios/Podfile.lock b/example/ios/Podfile.lock new file mode 100644 index 0000000..3ec7853 --- /dev/null +++ b/example/ios/Podfile.lock @@ -0,0 +1,89 @@ +PODS: + - Firebase/CoreOnly (10.12.0): + - FirebaseCore (= 10.12.0) + - Firebase/Storage (10.12.0): + - Firebase/CoreOnly + - FirebaseStorage (~> 10.12.0) + - firebase_core (2.15.1): + - Firebase/CoreOnly (= 10.12.0) + - Flutter + - firebase_storage (11.2.6): + - Firebase/Storage (= 10.12.0) + - firebase_core + - Flutter + - FirebaseAppCheckInterop (10.14.0) + - FirebaseAuthInterop (10.14.0) + - FirebaseCore (10.12.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/Logger (~> 7.8) + - FirebaseCoreExtension (10.14.0): + - FirebaseCore (~> 10.0) + - FirebaseCoreInternal (10.14.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseStorage (10.12.0): + - FirebaseAppCheckInterop (~> 10.0) + - FirebaseAuthInterop (~> 10.0) + - FirebaseCore (~> 10.0) + - FirebaseCoreExtension (~> 10.0) + - GTMSessionFetcher/Core (< 4.0, >= 2.1) + - Flutter (1.0.0) + - GoogleUtilities/Environment (7.11.5): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.11.5): + - GoogleUtilities/Environment + - "GoogleUtilities/NSData+zlib (7.11.5)" + - GTMSessionFetcher/Core (3.1.1) + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - PromisesObjC (2.3.1) + +DEPENDENCIES: + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) + - Flutter (from `Flutter`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + +SPEC REPOS: + trunk: + - Firebase + - FirebaseAppCheckInterop + - FirebaseAuthInterop + - FirebaseCore + - FirebaseCoreExtension + - FirebaseCoreInternal + - FirebaseStorage + - GoogleUtilities + - GTMSessionFetcher + - PromisesObjC + +EXTERNAL SOURCES: + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_storage: + :path: ".symlinks/plugins/firebase_storage/ios" + Flutter: + :path: Flutter + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + +SPEC CHECKSUMS: + Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0 + firebase_core: 4a3246a02f828a01c74a2c26427037786d90f17f + firebase_storage: 90a6038e00d3903c7f665dcfc57a9a98c7c8366b + FirebaseAppCheckInterop: c87f1d5421c852413dd936b2b2340b21e62501a0 + FirebaseAuthInterop: 23be77be1ca68e4bd15214f403f807a6ca70d7e0 + FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed + FirebaseCoreExtension: 976638051b1a46b503afce7ec80277f9161f2040 + FirebaseCoreInternal: d558159ee6cc4b823c2296ecc193de9f6d9a5bb3 + FirebaseStorage: 1d7ca8c8953fc61ccacaa7c612696b5402968a0d + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084 + GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72 + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 + +PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 + +COCOAPODS: 1.12.1 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 00d5780..544fcde 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,18 +3,31 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 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 */; }; + 84B49EED4E6FDF0C5F9658D8 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5CAD96384B4B9DF6E7DCE52 /* Pods_RunnerTests.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 */; }; + DAA6E07DEF947AC0C46D6297 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1D0AFCDF5DCA891B3C535 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -29,12 +42,19 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0AA1D0AFCDF5DCA891B3C535 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; + 15C62142D63BAD5C836553A0 /* 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 = ""; }; + 166FC8D2CDFEDD0E56AB9F2A /* 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 = ""; }; + 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; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4B0439BE2C3D205DBA62800F /* 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 = ""; }; 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 = ""; }; + 7B1E6E58CA517FA5AE267BD4 /* 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 = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -42,6 +62,9 @@ 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 = ""; }; + A5CAD96384B4B9DF6E7DCE52 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B4CEE7876C451E43B430615E /* 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 = ""; }; + E8F246480E545C60BDFA67F8 /* 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 */ @@ -49,12 +72,52 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DAA6E07DEF947AC0C46D6297 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E1288C55846077155224F97C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 84B49EED4E6FDF0C5F9658D8 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 57EAF3DC9AB9065BC5D3C010 /* Pods */ = { + isa = PBXGroup; + children = ( + 166FC8D2CDFEDD0E56AB9F2A /* Pods-Runner.debug.xcconfig */, + 4B0439BE2C3D205DBA62800F /* Pods-Runner.release.xcconfig */, + 7B1E6E58CA517FA5AE267BD4 /* Pods-Runner.profile.xcconfig */, + B4CEE7876C451E43B430615E /* Pods-RunnerTests.debug.xcconfig */, + E8F246480E545C60BDFA67F8 /* Pods-RunnerTests.release.xcconfig */, + 15C62142D63BAD5C836553A0 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 5FFAE8A00FABBDAFEA418E07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0AA1D0AFCDF5DCA891B3C535 /* Pods_Runner.framework */, + A5CAD96384B4B9DF6E7DCE52 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +135,9 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 57EAF3DC9AB9065BC5D3C010 /* Pods */, + 5FFAE8A00FABBDAFEA418E07 /* Frameworks */, ); sourceTree = ""; }; @@ -79,6 +145,7 @@ isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, ); name = Products; sourceTree = ""; @@ -101,16 +168,37 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 641CA6E6D5A2F3F02C69938E /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + E1288C55846077155224F97C /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + DED41BF4FC4FCC3C80501D35 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + DB1E8B33681E353F4F3565DF /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -127,9 +215,13 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; @@ -150,11 +242,19 @@ projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -171,10 +271,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -183,8 +285,31 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 641CA6E6D5A2F3F02C69938E /* [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; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -197,9 +322,56 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + DB1E8B33681E353F4F3565DF /* [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; + }; + DED41BF4FC4FCC3C80501D35 /* [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 */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -211,6 +383,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -272,7 +452,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -288,16 +468,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = JF3GRXDX4V; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Flutter", + "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = dev.paulonia.pauloniacacheimage.example; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -307,6 +483,56 @@ }; name = Profile; }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4CEE7876C451E43B430615E /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.paulonia.pauloniacacheimage.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E8F246480E545C60BDFA67F8 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.paulonia.pauloniacacheimage.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 15C62142D63BAD5C836553A0 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.paulonia.pauloniacacheimage.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -354,7 +580,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -403,11 +629,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -420,16 +647,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = JF3GRXDX4V; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Flutter", + "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = dev.paulonia.pauloniacacheimage.example; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -447,16 +670,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = JF3GRXDX4V; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Flutter", + "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = dev.paulonia.pauloniacacheimage.example; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -469,6 +688,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a1..919434a 100644 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140c..e42adcb 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - - - + + + + + + - - + + diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf0..7353c41 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd9..797d452 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b..6ed2d93 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde121..4cd7b00 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e..fe73094 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc230..321773c 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd9..797d452 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8..502f463 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b86..0ec3034 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b86..0ec3034 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d16..e9f5fea 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d..84ac32a 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41..8953cba 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f58..0467bf1 100644 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index a060db6..7f55346 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -41,5 +43,9 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/example/ios/RunnerTests/RunnerTests.swift b/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/example/lib/main.dart b/example/lib/main.dart index 07c19ac..1d5ae7a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,61 +1,49 @@ import 'package:flutter/material.dart'; import 'package:paulonia_cache_image/paulonia_cache_image.dart'; -void main() async{ +void main() async { WidgetsFlutterBinding.ensureInitialized(); await PCacheImage.init(); - runApp(MyApp()); + runApp(const MyApp()); } +/// {@template my_app} +/// My app +/// {@endtemplate} class MyApp extends StatelessWidget { - // This widget is the root of your application. + /// {@macro my_app} + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( title: 'Paulonia Cache Image', theme: ThemeData( - // This is the theme of your application. - // - // Try running your application with "flutter run". You'll see the - // application has a blue toolbar. Then, without quitting the app, try - // changing the primarySwatch below to Colors.green and then invoke - // "hot reload" (press "r" in the console where you ran "flutter run", - // or simply save your changes to "hot reload" in a Flutter IDE). - // Notice that the counter didn't reset back to zero; the application - // is not restarted. primarySwatch: Colors.blue, - // This makes the visual density adapt to the platform that you run - // the app on. For desktop platforms, the controls will be smaller and - // closer together (more dense) than on mobile platforms. visualDensity: VisualDensity.adaptivePlatformDensity, ), - home: MyHomePage(title: 'Paulonia Cache Image'), + home: const MyHomePage(title: 'Paulonia Cache Image'), ); } } +/// {@template my_home_page} +/// My home page +/// {@endtemplate} class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". + /// {@macro my_home_page} + const MyHomePage({required this.title, super.key}); + /// The title of the page final String title; @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } -class _MyHomePageState extends State{ - - - void initState(){ +class _MyHomePageState extends State { + @override + void initState() { super.initState(); } @@ -64,59 +52,69 @@ class _MyHomePageState extends State{ return Scaffold( appBar: AppBar( backgroundColor: Colors.white, - title: Text(widget.title, style: TextStyle(color: Colors.black),), + title: Text( + widget.title, + style: const TextStyle(color: Colors.black), + ), ), floatingActionButton: FloatingActionButton( - child: Icon(Icons.refresh, color: Colors.black,), backgroundColor: Colors.white, - onPressed: (){ - setState(() { - - }); - } + onPressed: () { + setState(() {}); + }, + child: const Icon( + Icons.refresh, + color: Colors.black, + ), ), body: ListView( children: [ - ListTile( - title: Text("In memory cached network image"), + const ListTile( + title: Text('In memory cached network image'), ), - Container( + SizedBox( height: 250, child: Card( elevation: 10, child: Image( - image: PCacheImage('https://i.imgur.com/jhRBVEp.jpg', enableInMemory: true), + image: PCacheImage( + 'https://i.imgur.com/jhRBVEp.jpg', + enableInMemory: true, + ), ), ), ), - ListTile( - title: Text("Storage cached network image"), + const ListTile( + title: Text('Storage cached network image'), ), - Container( + SizedBox( height: 250, child: Card( elevation: 10, child: Image( - image: PCacheImage('https://i.imgur.com/5RhnXjE.jpg',), + image: PCacheImage( + 'https://i.imgur.com/5RhnXjE.jpg', + ), ), ), ), - ListTile( - title: Text("Not cached image"), + const ListTile( + title: Text('Not cached image'), ), - Container( + SizedBox( height: 250, child: Card( elevation: 10, child: Image( - image: PCacheImage('https://i.imgur.com/inAkwKw.jpg', enableCache: false), + image: PCacheImage( + 'https://i.imgur.com/inAkwKw.jpg', + enableCache: false, + ), ), ), ), ], ), ); - } - } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 2a7688d..fa2397d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -5,74 +5,23 @@ description: A new Flutter project. # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=3.0.6 <4.0.0" dependencies: + cupertino_icons: ^1.0.4 + firebase_core: ^2.15.1 flutter: sdk: flutter - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.4 - firebase_core: ^1.12.0 paulonia_cache_image: path: ../ dev_dependencies: flutter_test: sdk: flutter + very_good_analysis: ^5.1.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + uses-material-design: true \ No newline at end of file diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index 747db1d..f3c1285 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -5,15 +5,14 @@ // 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:example/main.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:example/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); + await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 8b6d468..7bfdda0 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,12 @@ #include "generated_plugin_registrant.h" +#include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 4d10c25..0e68a11 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -3,6 +3,11 @@ # list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus + firebase_core +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST ) set(PLUGIN_BUNDLED_LIBRARIES) @@ -13,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/lib/paulonia_cache_image.dart b/lib/paulonia_cache_image.dart index 5b7b872..065f616 100644 --- a/lib/paulonia_cache_image.dart +++ b/lib/paulonia_cache_image.dart @@ -10,8 +10,6 @@ import 'package:paulonia_cache_image/hive_cache_image.dart'; import 'package:paulonia_cache_image/paulonia_cache_image_mobile.dart' if (dart.library.html) 'package:paulonia_cache_image/paulonia_cache_image_web.dart'; -import 'InMemoryManager.dart'; - class PCacheImage extends ImageProvider { PCacheImage( this.url, { @@ -85,7 +83,9 @@ class PCacheImage extends ImageProvider { return SynchronousFuture(this); } + // TODO(chrischv): Replace [DecoderCallback] with [ImageDecoderCallback] @override + // ignore: deprecated_member_use ImageStreamCompleter load(PCacheImage key, DecoderCallback decode) { _initializeValues(); if (enableCache! && enableInMemory!) diff --git a/lib/paulonia_cache_image_mobile.dart b/lib/paulonia_cache_image_mobile.dart index bbdcd95..0a3241b 100644 --- a/lib/paulonia_cache_image_mobile.dart +++ b/lib/paulonia_cache_image_mobile.dart @@ -9,6 +9,7 @@ import 'package:flutter/cupertino.dart'; import 'package:path_provider/path_provider.dart'; import 'package:paulonia_cache_image/utils.dart'; import 'package:http/http.dart' as http; +import 'package:paulonia_utils/paulonia_utils.dart'; /// TODO change cachedPaths to a Hive box (persistence) @@ -141,8 +142,17 @@ class PCacheImageService { /// Get the network from a [gsUrl] /// /// This function get the download url from a Google Cloud Storage url - static Future _getStandardUrlFromGsUrl(String gsUrl) async { - Uri uri = Uri.parse(gsUrl); - return FirebaseStorage.instance.ref().child(uri.path).getDownloadURL(); + static Future _getStandardUrlFromGsUrl(String gsUrl) async { + if (PUtils.isOnTest()) { + // Url returned for testing + return 'https://firebasestorage.googleapis.com/v0/b/test-project-a99d6' + '.appspot.com/o/images%2FgitPaulonai2.png?alt=media&token=1b1b5c15' + '-c52d-4f02-947e-5b82e82b8316&_gl=1*t6xx90*_ga*MTY4MDMyNTk1OC4xNjM' + '1NzMxNDI2*_ga_CW55HF8NVT*MTY5NzMwMzY3My4zMTYuMS4xNjk3MzA2MzYzLjUy' + 'LjAuMA..'; + } + // coverage:ignore-start + return FirebaseStorage.instance.refFromURL(gsUrl).getDownloadURL(); + // coverage:ignore-end } } diff --git a/lib/paulonia_cache_image_web.dart b/lib/paulonia_cache_image_web.dart index cce30c7..7ec0417 100644 --- a/lib/paulonia_cache_image_web.dart +++ b/lib/paulonia_cache_image_web.dart @@ -1,7 +1,6 @@ import 'dart:convert'; -import 'dart:typed_data'; import 'dart:ui' as ui; -import 'package:firebase/firebase.dart' as fb; +import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/foundation.dart'; import 'package:hive/hive.dart'; import 'package:paulonia_cache_image/constants.dart'; @@ -148,6 +147,7 @@ class PCacheImageService { /// /// This function get the download url from a Google Cloud Storage url static Future _getStandardUrlFromGsUrl(String gsUrl) async { - return (await fb.storage().refFromURL(gsUrl).getDownloadURL()).toString(); + return (await FirebaseStorage.instance.refFromURL(gsUrl).getDownloadURL()) + .toString(); } } diff --git a/pubspec.lock b/pubspec.lock index 4370026..bde1084 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,125 +1,182 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" + url: "https://pub.dev" + source: hosted + version: "1.3.5" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.2" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: "77a180d6938f78ca7d2382d2240eb626c0f6a735d0bfdce227d8ffb80f95c48b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + url: "https://pub.dev" + source: hosted + version: "1.2.4" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" + dbus: + dependency: transitive + description: + name: dbus + sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + url: "https://pub.dev" + source: hosted + version: "0.7.8" + device_info_plus: + dependency: transitive + description: + name: device_info_plus + sha256: "86add5ef97215562d2e090535b0a16f197902b10c369c558a100e74ea06e8659" + url: "https://pub.dev" + source: hosted + version: "9.0.3" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 + url: "https://pub.dev" + source: hosted + version: "7.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.1.0" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.2" - firebase: - dependency: "direct main" - description: - name: firebase - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.2" + version: "7.0.0" firebase_core: - dependency: transitive + dependency: "direct main" description: name: firebase_core - url: "https://pub.dartlang.org" + sha256: c78132175edda4bc532a71e01a32964e4b4fcf53de7853a422d96dac3725f389 + url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "2.15.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - url: "https://pub.dartlang.org" + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "4.8.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - url: "https://pub.dartlang.org" + sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973" + url: "https://pub.dev" source: hosted - version: "1.5.4" + version: "2.7.0" firebase_storage: dependency: "direct main" description: name: firebase_storage - url: "https://pub.dartlang.org" + sha256: "11423ac63c1ec566069c80b1d01bc3c9e12a8f106bbc4ba77fa150afb88488a3" + url: "https://pub.dev" source: hosted - version: "10.2.7" + version: "11.2.6" firebase_storage_platform_interface: dependency: transitive description: name: firebase_storage_platform_interface - url: "https://pub.dartlang.org" + sha256: "2a8ee7b8a06ee5201f9a116db6972ba0020e3a314a5065acdcb616f4d6c99771" + url: "https://pub.dev" source: hosted - version: "4.0.14" + version: "4.4.5" firebase_storage_web: dependency: transitive description: name: firebase_storage_web - url: "https://pub.dartlang.org" + sha256: bd110daa180dc9c89abb490c8a330571e103291b348358d320f5b20a61cd46fc + url: "https://pub.dev" source: hosted - version: "3.2.8" + version: "3.6.6" flutter: dependency: "direct main" description: flutter @@ -139,128 +196,162 @@ packages: dependency: "direct main" description: name: hive - url: "https://pub.dartlang.org" + sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" + url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.2.3" http: - dependency: transitive + dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" source: hosted - version: "0.13.4" + version: "1.1.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.7" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + ntp: + dependency: transitive + description: + name: ntp + sha256: "198db73e5059b334b50dbe8c626011c26576778ee9fc53f4c55c1d89d08ed2d2" + url: "https://pub.dev" + source: hosted + version: "2.0.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.1.1" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1" + url: "https://pub.dev" source: hosted - version: "2.0.11" - path_provider_ios: + version: "2.2.0" + path_provider_foundation: dependency: transitive description: - name: path_provider_ios - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.3.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" source: hosted - version: "2.1.5" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" + version: "2.2.1" path_provider_platform_interface: - dependency: transitive + dependency: "direct dev" description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.1.1" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + paulonia_utils: + dependency: "direct main" + description: + name: paulonia_utils + sha256: fe3bbaa1c6af0a34489ae73091c644453efeebf90783078b1ac593f21e43b213 + url: "https://pub.dev" + source: hosted + version: "0.5.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "5.4.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: - dependency: transitive + dependency: "direct dev" description: name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" + sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "2.1.6" sky_engine: dependency: transitive description: flutter @@ -270,72 +361,106 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.8" + version: "0.6.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "9e82a402b7f3d518fb9c02d0e9ae45952df31b9bf34d77baf19da2de03fc2aaa" + url: "https://pub.dev" + source: hosted + version: "5.0.7" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" + url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "1.1.2" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" source: hosted - version: "0.2.0+1" + version: "6.3.0" sdks: - dart: ">=2.15.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index d3cd9f5..66e6979 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,59 +1,26 @@ name: paulonia_cache_image description: Flutter package for cache images in storage or memory from the network or Google Cloud Storage. It supports Android, iOS and Web. -version: 1.0.0 +version: 1.1.0 homepage: https://paulonia.dev repository: https://github.com/PauloniaAQP/paulonia_cache_image environment: - sdk: '>=2.12.0 <3.0.0' - flutter: ">=1.17.0" + sdk: ">=3.0.6 <4.0.0" dependencies: flutter: sdk: flutter - firebase_storage: ^10.2.7 - firebase: ^9.0.2 - path_provider: ^2.0.9 - hive: ^2.0.5 - http: ^0.13.4 + firebase_storage: ^11.2.6 + firebase_core: ^2.15.1 + path_provider: ^2.1.1 + hive: ^2.2.3 + http: ^1.1.0 + paulonia_utils: ^0.5.0 dev_dependencies: flutter_test: sdk: flutter + path_provider_platform_interface: ^2.1.1 + plugin_platform_interface: ^2.1.6 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages diff --git a/test/in_memory_manager_test.dart b/test/in_memory_manager_test.dart index e37617b..8c24b42 100644 --- a/test/in_memory_manager_test.dart +++ b/test/in_memory_manager_test.dart @@ -1,10 +1,16 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:paulonia_cache_image/InMemoryManager.dart'; import 'package:paulonia_cache_image/paulonia_cache_image.dart'; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; -void main() { +import 'utils.dart'; +void main() { group('In memory manager functions:', () { + setUp(() async { + PathProviderPlatform.instance = FakePathProviderPlatform(); + }); + List validUrls = [ 'https://i.imgur.com/jhRBVEp.jpg', 'https://i.imgur.com/5RhnXjE.jpg', @@ -67,5 +73,4 @@ void main() { expect(InMemoryManager.savedImages.last, equals(validUrls.last)); }); }); - -} \ No newline at end of file +} diff --git a/test/paulonia_cache_image_service_common_test.dart b/test/paulonia_cache_image_service_common_test.dart index 260e609..f335d97 100644 --- a/test/paulonia_cache_image_service_common_test.dart +++ b/test/paulonia_cache_image_service_common_test.dart @@ -1,18 +1,24 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:paulonia_cache_image/paulonia_cache_image.dart'; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import 'package:paulonia_cache_image/paulonia_cache_image_mobile.dart' -if (dart.library.html) 'package:paulonia_cache_image/paulonia_cache_image_web.dart'; + if (dart.library.html) 'package:paulonia_cache_image/paulonia_cache_image_web.dart'; -void main() { +import 'utils.dart'; +void main() { group('Service functions:', () { + setUp(() async { + PathProviderPlatform.instance = FakePathProviderPlatform(); + }); + List validUrls = [ 'https://i.imgur.com/aWLjDHS.jpg', 'https://i.imgur.com/5laDaRD.jpg', 'https://i.imgur.com/IWA7U8X.jpg', ]; - test('downloadImage()', () async{ + test('downloadImage() with network url', () async { String invalidUrl = 'https://i.imgur.com/in.jpg'; for (String testUrl in validUrls) { @@ -36,6 +42,7 @@ void main() { await PCacheImage.init(); expect(PCacheImageService.length, equals(0)); + /// Without cache await PCacheImageService.getImage( validUrls.first, @@ -47,14 +54,14 @@ void main() { /// Normal behaviour for (int i = 0; i < validUrls.length; i++) { - var codec = await PCacheImageService.getImage( - validUrls[i], - Duration(seconds: 1), - Duration(seconds: 5), - true, - ); - expect(codec.frameCount, equals(1)); - expect(PCacheImageService.length, equals(i + 1)); + var codec = await PCacheImageService.getImage( + validUrls[i], + Duration(seconds: 1), + Duration(seconds: 5), + true, + ); + expect(codec.frameCount, equals(1)); + expect(PCacheImageService.length, equals(i + 1)); } /// Cached image @@ -89,7 +96,5 @@ void main() { /// To clear the cache for other tests await PCacheImageService.clearAllImages(); }); - }); - -} \ No newline at end of file +} diff --git a/test/paulonia_cache_image_service_mobile_test.dart b/test/paulonia_cache_image_service_mobile_test.dart index 3de96d4..2b0ebef 100644 --- a/test/paulonia_cache_image_service_mobile_test.dart +++ b/test/paulonia_cache_image_service_mobile_test.dart @@ -3,12 +3,18 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:paulonia_cache_image/paulonia_cache_image_mobile.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; -void main() { +import 'utils.dart'; +void main() { group('Mobile service functions:', () { + setUp(() async { + PathProviderPlatform.instance = FakePathProviderPlatform(); + }); + File validFile = File('./test/data/testText.txt'); test('fileIsCached()', () { @@ -17,6 +23,16 @@ void main() { expect(PCacheImageService.fileIsCached(invalidFile), isFalse); }); + test('downloadImage() with gs url', () async { + final String gsUrl = "gs://test-project-a9ddddd6.appspot.com/images/test"; + var bytes = await PCacheImageService.downloadImage( + gsUrl, + Duration(seconds: 1), + Duration(seconds: 3), + ); + expect(bytes.lengthInBytes != 0, isTrue); + }); + test('saveFile() & clearAllImages()', () async { expect(PCacheImageService.cachedPaths, isEmpty); @@ -24,7 +40,9 @@ void main() { String path = tempPath + '/pcacheImageTestFile'; File file = File(path); PCacheImageService.saveFile(file, validFile.readAsBytesSync()); - await file.length(); /// To re sync with the file + await file.length(); + + /// To re sync with the file expect(file.existsSync(), isTrue); expect(file.lengthSync(), validFile.lengthSync()); expect(PCacheImageService.cachedPaths.length, 1); @@ -34,7 +52,5 @@ void main() { expect(file.existsSync(), isFalse); expect(PCacheImageService.cachedPaths, isEmpty); }); - }); - -} \ No newline at end of file +} diff --git a/test/paulonia_cache_image_service_web_test.dart b/test/paulonia_cache_image_service_web_test.dart index c34a3c9..31d3430 100644 --- a/test/paulonia_cache_image_service_web_test.dart +++ b/test/paulonia_cache_image_service_web_test.dart @@ -8,10 +8,11 @@ import 'package:paulonia_cache_image/paulonia_cache_image.dart'; import 'package:paulonia_cache_image/paulonia_cache_image_web.dart'; void main() { - group('Web service functions:', () { - test('Hive CRUD: saveHiveImage(), getHiveImage(), deleteHiveImage(), clearAllImages()', () async{ - Uint8List randomBytes = Uint8List.fromList([0,0,1,0,1]); + test( + 'Hive CRUD: saveHiveImage(), getHiveImage(), deleteHiveImage(), clearAllImages()', + () async { + Uint8List randomBytes = Uint8List.fromList([0, 0, 1, 0, 1]); await PCacheImage.init(); expect(PCacheImageService.cacheBox.isEmpty, isTrue); @@ -34,5 +35,4 @@ void main() { expect(PCacheImageService.cacheBox.isEmpty, isTrue); }); }); - -} \ No newline at end of file +} diff --git a/test/paulonia_cache_image_test.dart b/test/paulonia_cache_image_test.dart index 04cf5ce..b813e36 100644 --- a/test/paulonia_cache_image_test.dart +++ b/test/paulonia_cache_image_test.dart @@ -1,4 +1,3 @@ -import 'dart:typed_data'; import 'dart:ui' as ui; import 'package:flutter/foundation.dart'; @@ -9,8 +8,11 @@ import 'package:paulonia_cache_image/InMemoryManager.dart'; import 'package:paulonia_cache_image/constants.dart'; import 'package:paulonia_cache_image/global_values.dart'; import 'package:paulonia_cache_image/paulonia_cache_image.dart'; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import 'package:paulonia_cache_image/paulonia_cache_image_mobile.dart' -if (dart.library.html) 'package:paulonia_cache_image/paulonia_cache_image_web.dart'; + if (dart.library.html) 'package:paulonia_cache_image/paulonia_cache_image_web.dart'; + +import 'utils.dart'; class TestCanvas implements Canvas { final List invocations = []; @@ -22,20 +24,30 @@ class TestCanvas implements Canvas { } void main() { + setUp(() async { + PathProviderPlatform.instance = FakePathProviderPlatform(); + }); - Future _basicDecoder(Uint8List bytes, {int? cacheWidth, int? cacheHeight, bool? allowUpscaling}) { - return ui.instantiateImageCodec(bytes, allowUpscaling: allowUpscaling ?? false); + Future _basicDecoder(Uint8List bytes, + {int? cacheWidth, int? cacheHeight, bool? allowUpscaling}) { + return ui.instantiateImageCodec(bytes, + allowUpscaling: allowUpscaling ?? false); } group('Initialize package', () { test('with default values', () async { await PCacheImage.init(); expect(GlobalValues.globalImageScale, Constants.DEFAULT_IMAGE_SCALE); - expect(GlobalValues.globalEnableCacheValue, Constants.DEFAULT_ENABLE_CACHE_VALUE); - expect(GlobalValues.globalRetryDuration, Constants.DEFAULT_RETRY_DURATION); - expect(GlobalValues.globalMaxRetryDuration, Constants.DEFAULT_MAX_RETRY_DURATION); - expect(GlobalValues.globalInMemoryValue, Constants.DEFAULT_IN_MEMORY_VALUE); - expect(InMemoryManager.maxInMemoryImages, Constants.DEFAULT_IN_MEMORY_IMAGES); + expect(GlobalValues.globalEnableCacheValue, + Constants.DEFAULT_ENABLE_CACHE_VALUE); + expect( + GlobalValues.globalRetryDuration, Constants.DEFAULT_RETRY_DURATION); + expect(GlobalValues.globalMaxRetryDuration, + Constants.DEFAULT_MAX_RETRY_DURATION); + expect( + GlobalValues.globalInMemoryValue, Constants.DEFAULT_IN_MEMORY_VALUE); + expect(InMemoryManager.maxInMemoryImages, + Constants.DEFAULT_IN_MEMORY_IMAGES); if (kIsWeb) { expect(Hive.isBoxOpen(Constants.HIVE_CACHE_IMAGE_BOX), isTrue); expect(Hive.isAdapterRegistered(17), isTrue); @@ -85,11 +97,13 @@ void main() { expect(PCacheImageService.length, equals(0)); expect(InMemoryManager.length, equals(0)); - void loadImage(String url, {bool enableCache = true, bool enableInMemory = false}) { - PCacheImage image = PCacheImage(url, enableCache: enableCache, enableInMemory: enableInMemory); + void loadImage(String url, + {bool enableCache = true, bool enableInMemory = false}) { + PCacheImage image = PCacheImage(url, + enableCache: enableCache, enableInMemory: enableInMemory); var completer = image.load(image, _basicDecoder); completer.addListener(ImageStreamListener( - (ImageInfo image, bool synchronousCall) { }, + (ImageInfo image, bool synchronousCall) {}, onError: (dynamic error, StackTrace? stackTrace) { capturedErrors.add(error); }, diff --git a/test/utils.dart b/test/utils.dart new file mode 100644 index 0000000..2255a37 --- /dev/null +++ b/test/utils.dart @@ -0,0 +1,104 @@ +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +import 'package:flutter_test/flutter_test.dart'; + +const String kTemporaryPath = 'temporaryPath'; +const String kApplicationSupportPath = 'applicationSupportPath'; +const String kDownloadsPath = 'downloadsPath'; +const String kLibraryPath = 'libraryPath'; +const String kApplicationDocumentsPath = 'applicationDocumentsPath'; +const String kExternalCachePath = 'externalCachePath'; +const String kExternalStoragePath = 'externalStoragePath'; + +class FakePathProviderPlatform extends Fake + with MockPlatformInterfaceMixin + implements PathProviderPlatform { + @override + Future getTemporaryPath() async { + return kTemporaryPath; + } + + @override + Future getApplicationSupportPath() async { + return kApplicationSupportPath; + } + + @override + Future getLibraryPath() async { + return kLibraryPath; + } + + @override + Future getApplicationDocumentsPath() async { + return kApplicationDocumentsPath; + } + + @override + Future getExternalStoragePath() async { + return kExternalStoragePath; + } + + @override + Future?> getExternalCachePaths() async { + return [kExternalCachePath]; + } + + @override + Future?> getExternalStoragePaths({ + StorageDirectory? type, + }) async { + return [kExternalStoragePath]; + } + + @override + Future getDownloadsPath() async { + return kDownloadsPath; + } +} + +class AllNullFakePathProviderPlatform extends Fake + with MockPlatformInterfaceMixin + implements PathProviderPlatform { + @override + Future getTemporaryPath() async { + return null; + } + + @override + Future getApplicationSupportPath() async { + return null; + } + + @override + Future getLibraryPath() async { + return null; + } + + @override + Future getApplicationDocumentsPath() async { + return null; + } + + @override + Future getExternalStoragePath() async { + return null; + } + + @override + Future?> getExternalCachePaths() async { + return null; + } + + @override + Future?> getExternalStoragePaths({ + StorageDirectory? type, + }) async { + return null; + } + + @override + Future getDownloadsPath() async { + return null; + } +} diff --git a/test/utils_test.dart b/test/utils_test.dart index 8527e6a..75daeb6 100644 --- a/test/utils_test.dart +++ b/test/utils_test.dart @@ -2,15 +2,14 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:paulonia_cache_image/utils.dart'; void main() { - group('Utils functions:', () { test('isGsUrl()', () { - String gsUrl = 'gs://test.appspot.com/images/answers/jIAaGJrUR23t2XRBvOcN.png'; + String gsUrl = + 'gs://test.appspot.com/images/answers/jIAaGJrUR23t2XRBvOcN.png'; String networkUrl = 'https://i.imgur.com/jhRBVEp.jpg'; expect(Utils.isGsUrl(gsUrl), isTrue); expect(Utils.isGsUrl(networkUrl), isFalse); }); }); - -} \ No newline at end of file +}