diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ac73c69..753ce0b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -61,9 +61,31 @@ jobs: - name: Run tests run: flutter test ./test/* + ios-build-spm: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + + - name: Install dependencies + run: | + flutter config --enable-swift-package-manager + flutter pub get + cd example + flutter build ios --config-only --no-codesign + + - name: Build iOS framework with SPM + run: | + cd example + flutter build ios --simulator + upload-coverage: runs-on: ubuntu-latest - needs: [flutter-tests] + needs: [flutter-tests, flutter-minimum-version-tests, ios-build-spm] if: always() && !cancelled() && needs.flutter-tests.result == 'success' steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 7d63d3f..02d03c0 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ build/ # FVM Version Cache .fvm/ +.fvmrc # Coverage -coverage/ \ No newline at end of file +coverage/ + +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 4e82a9f..3e11468 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ feel free to give the best user eco experience to your final users :) This feature combines different battery information to determine if the device is in **_eco-mode_** or not. It will return a boolean. -``` +```dart @override Stream get isBatteryEcoModeStream => CombineLatestStream.list([ _isNotEnoughBatteryStream(), @@ -94,7 +94,7 @@ We have created a class **_Connectivity_** which contains basic information abou And you can use directly the methode **_hasEnoughNetwork_** which follows these rules in the code -``` +```dart extension on Connectivity { bool? get isEnough => type == ConnectivityType.unknown ? null @@ -131,9 +131,5 @@ We are open to any contributions or suggestions. If you have any questions, plea ## License -Copyright © 2024 SNCF Connect & Tech. +Copyright © 2026 SNCF Connect & Tech. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. - -*** - -_This file has been written on February 22, 2024_. diff --git a/android/src/main/kotlin/sncf/connect/tech/flutter_eco_mode/Messages.g.kt b/android/src/main/kotlin/sncf/connect/tech/flutter_eco_mode/Messages.g.kt index 95d5b4d..0ca46dc 100644 --- a/android/src/main/kotlin/sncf/connect/tech/flutter_eco_mode/Messages.g.kt +++ b/android/src/main/kotlin/sncf/connect/tech/flutter_eco_mode/Messages.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.0), do not edit directly. +// Autogenerated from Pigeon (v26.1.7), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") diff --git a/example/.gitignore b/example/.gitignore index 29a3a50..79c113f 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 7c56964..1dc6cf7 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 13.0 diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index ec97fc6..592ceee 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index c4855bf..592ceee 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile deleted file mode 100644 index d97f17e..0000000 --- a/example/ios/Podfile +++ /dev/null @@ -1,44 +0,0 @@ -# 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/example/ios/Podfile.lock b/example/ios/Podfile.lock deleted file mode 100644 index ef24a3e..0000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,28 +0,0 @@ -PODS: - - Flutter (1.0.0) - - flutter_eco_mode (0.0.1): - - Flutter - - integration_test (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - flutter_eco_mode (from `.symlinks/plugins/flutter_eco_mode/ios`) - - integration_test (from `.symlinks/plugins/integration_test/ios`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - flutter_eco_mode: - :path: ".symlinks/plugins/flutter_eco_mode/ios" - integration_test: - :path: ".symlinks/plugins/integration_test/ios" - -SPEC CHECKSUMS: - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_eco_mode: d754157bc349ad8c9a03bc5f08020569fe5510c6 - integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 - -PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 - -COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 9d838f5..be0f0fd 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -8,13 +8,9 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 151056ABEC3D8EA7E82C42E6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB979A1B33A259D3D40F0090 /* Pods_Runner.framework */; }; - 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 */; }; - 7FC6EB4E86308E805AAAE8B6 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 099F8D5F4DC0A9906AA4E84B /* Pods_RunnerTests.framework */; }; - 803894812B84E30F00E37E13 /* FlutterEcoModePlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8038947F2B84E30F00E37E13 /* FlutterEcoModePlugin.swift */; }; - 803894822B84E30F00E37E13 /* Messages.g.swift in Sources */ = {isa = PBXBuildFile; fileRef = 803894802B84E30F00E37E13 /* Messages.g.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 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 */; }; @@ -44,21 +40,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 099F8D5F4DC0A9906AA4E84B /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0F1D8E799672FB7C7F457FAC /* 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 = ""; }; 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 = ""; }; - 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 = ""; }; - 4A4D412695D7F273407D0AC9 /* 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 = ""; }; 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 = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8038947F2B84E30F00E37E13 /* FlutterEcoModePlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FlutterEcoModePlugin.swift; path = ../../ios/Classes/FlutterEcoModePlugin.swift; sourceTree = ""; }; - 803894802B84E30F00E37E13 /* Messages.g.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Messages.g.swift; path = ../../ios/Classes/Messages.g.swift; sourceTree = ""; }; - 8E2F0F0976A70813CEE57341 /* 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 = ""; }; - 941689D272F0BD80B2805F81 /* 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 = ""; }; 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; }; @@ -66,9 +55,6 @@ 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 = ""; }; - AB979A1B33A259D3D40F0090 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B95C9FCE6EB1F82C01F18CAC /* 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 = ""; }; - E0F2FF4D1C027DC17EBD3ADA /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -76,7 +62,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7FC6EB4E86308E805AAAE8B6 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -84,7 +69,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 151056ABEC3D8EA7E82C42E6 /* Pods_Runner.framework in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -94,23 +79,14 @@ 0DFEC01FF141C865F014675A /* Frameworks */ = { isa = PBXGroup; children = ( - AB979A1B33A259D3D40F0090 /* Pods_Runner.framework */, - 099F8D5F4DC0A9906AA4E84B /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; }; - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -122,13 +98,9 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( - 8038947F2B84E30F00E37E13 /* FlutterEcoModePlugin.swift */, - 803894802B84E30F00E37E13 /* Messages.g.swift */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - 98425345AB2263E3A6E9B9BB /* Pods */, 0DFEC01FF141C865F014675A /* Frameworks */, ); sourceTree = ""; @@ -157,19 +129,6 @@ path = Runner; sourceTree = ""; }; - 98425345AB2263E3A6E9B9BB /* Pods */ = { - isa = PBXGroup; - children = ( - 941689D272F0BD80B2805F81 /* Pods-Runner.debug.xcconfig */, - 8E2F0F0976A70813CEE57341 /* Pods-Runner.release.xcconfig */, - B95C9FCE6EB1F82C01F18CAC /* Pods-Runner.profile.xcconfig */, - 0F1D8E799672FB7C7F457FAC /* Pods-RunnerTests.debug.xcconfig */, - 4A4D412695D7F273407D0AC9 /* Pods-RunnerTests.release.xcconfig */, - E0F2FF4D1C027DC17EBD3ADA /* Pods-RunnerTests.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -177,7 +136,6 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 06D606E8BAE04E15C3A937E2 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, 2DB8C4C605285620AB685C50 /* Frameworks */, @@ -196,20 +154,21 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 5DFC625B0022FBF144A487AD /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 8E7E274BB3BAF166679E968B /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -243,6 +202,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -275,28 +237,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 06D606E8BAE04E15C3A937E2 /* [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; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -313,45 +253,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 5DFC625B0022FBF144A487AD /* [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; - }; - 8E7E274BB3BAF166679E968B /* [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; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -374,7 +275,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -382,10 +282,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 803894822B84E30F00E37E13 /* Messages.g.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - 803894812B84E30F00E37E13 /* FlutterEcoModePlugin.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -460,7 +358,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -493,7 +391,6 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0F1D8E799672FB7C7F457FAC /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -511,7 +408,6 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4A4D412695D7F273407D0AC9 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -527,7 +423,6 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E0F2FF4D1C027DC17EBD3ADA /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -588,7 +483,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -637,7 +532,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -730,6 +625,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5d..95d6e55 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + version = "1.7"> + + + + + + + + + + diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc1..1d526a1 100644 --- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/example/ios/RunnerTests/RunnerTests.swift b/example/ios/RunnerTests/RunnerTests.swift deleted file mode 100644 index 1738560..0000000 --- a/example/ios/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,26 +0,0 @@ -import Flutter -import UIKit -import XCTest - -@testable import flutter_eco_mode - -// This demonstrates a simple unit test of the Swift portion of this plugin's implementation. -// -// See https://developer.apple.com/documentation/xctest for more information about using XCTest. - -class RunnerTests: XCTestCase { - - func testGetPlatformVersion() { - let plugin = FlutterEcoModePlugin() - - let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: []) - - let resultExpectation = expectation(description: "result block must be called.") - plugin.handle(call) { result in - XCTAssertEqual(result as! String, "iOS " + UIDevice.current.systemVersion) - resultExpectation.fulfill() - } - waitForExpectations(timeout: 1) - } - -} diff --git a/example/lib/connectivity_state/connectivity_state_page.dart b/example/lib/connectivity_state/connectivity_state_page.dart index 8a3fd2e..7ea7f0a 100644 --- a/example/lib/connectivity_state/connectivity_state_page.dart +++ b/example/lib/connectivity_state/connectivity_state_page.dart @@ -11,24 +11,22 @@ class ConnectivityStatePage extends StatelessWidget { @override Widget build(BuildContext context) { - return ResultsView( - [ - ResultLine( - label: 'Connectivity type', - future: ecoMode.getConnectivityTypeName, - stream: ecoMode.getConnectivityTypeStream, - ), - ResultLine( - label: 'Wifi signal strength', - future: ecoMode.getConnectivitySignalStrength, - stream: ecoMode.getConnectivitySignalStrengthStream, - ), - ResultLine( - label: 'Has enough Network', - future: ecoMode.hasEnoughNetwork, - stream: ecoMode.hasEnoughNetworkStream, - ), - ], - ); + return ResultsView([ + ResultLine( + label: 'Connectivity type', + future: ecoMode.getConnectivityTypeName, + stream: ecoMode.getConnectivityTypeStream, + ), + ResultLine( + label: 'Wifi signal strength', + future: ecoMode.getConnectivitySignalStrength, + stream: ecoMode.getConnectivitySignalStrengthStream, + ), + ResultLine( + label: 'Has enough Network', + future: ecoMode.hasEnoughNetwork, + stream: ecoMode.hasEnoughNetworkStream, + ), + ]); } } diff --git a/example/lib/eco_battery/eco_battery_page.dart b/example/lib/eco_battery/eco_battery_page.dart index 0ff6a5f..656def1 100644 --- a/example/lib/eco_battery/eco_battery_page.dart +++ b/example/lib/eco_battery/eco_battery_page.dart @@ -10,35 +10,30 @@ class EcoBatteryPage extends StatelessWidget { @override Widget build(BuildContext context) { - return ResultsView( - [ - ResultLine( - label: 'Thermal state', - future: ecoMode.getThermalStateName, - ), - ResultLine( - label: 'Battery level event stream', - future: ecoMode.getBatteryLevelPercent, - stream: ecoMode.getBatteryLevelPercentStream, - ), - ResultLine( - label: 'Battery state event stream', - future: ecoMode.getBatteryStateName, - stream: ecoMode.getBatteryStateStreamName, - ), - ResultLine( - label: 'Low power mode event stream', - future: ecoMode.isBatteryInLowPowerMode, - stream: () => ecoMode.lowPowerModeEventStream, - ), - ResultLine( - label: 'Is battery in eco mode event stream', - labelColor: Colors.purple, - valueColor: Colors.purple, - future: ecoMode.isBatteryEcoMode, - stream: () => ecoMode.isBatteryEcoModeStream, - ), - ], - ); + return ResultsView([ + ResultLine(label: 'Thermal state', future: ecoMode.getThermalStateName), + ResultLine( + label: 'Battery level event stream', + future: ecoMode.getBatteryLevelPercent, + stream: ecoMode.getBatteryLevelPercentStream, + ), + ResultLine( + label: 'Battery state event stream', + future: ecoMode.getBatteryStateName, + stream: ecoMode.getBatteryStateStreamName, + ), + ResultLine( + label: 'Low power mode event stream', + future: ecoMode.isBatteryInLowPowerMode, + stream: () => ecoMode.lowPowerModeEventStream, + ), + ResultLine( + label: 'Is battery in eco mode event stream', + labelColor: Colors.purple, + valueColor: Colors.purple, + future: ecoMode.isBatteryEcoMode, + stream: () => ecoMode.isBatteryEcoModeStream, + ), + ]); } } diff --git a/example/lib/extensions.dart b/example/lib/extensions.dart index a1f9bbd..3125e0d 100644 --- a/example/lib/extensions.dart +++ b/example/lib/extensions.dart @@ -10,20 +10,25 @@ extension FlutterEcoModeExtension on FlutterEcoMode { Future getThermalStateName() => getThermalState().then((value) => value.name); - Future getFreeMemoryReachable() => getFreeMemory() - .then((value) => value > 0 ? value.toString() : "not reachable"); + Future getFreeMemoryReachable() => getFreeMemory().then( + (value) => value > 0 ? value.toString() : "not reachable", + ); - Future getBatteryLevelPercent() => getBatteryLevel().then((value) => - value != null && value > 0 ? "${value.toInt()} %" : "not reachable"); + Future getBatteryLevelPercent() => getBatteryLevel().then( + (value) => + value != null && value > 0 ? "${value.toInt()} %" : "not reachable", + ); - Stream getBatteryLevelPercentStream() => batteryLevelEventStream - .map((value) => value > 0 ? "${value.toInt()} %" : "not reachable"); + Stream getBatteryLevelPercentStream() => batteryLevelEventStream.map( + (value) => value > 0 ? "${value.toInt()} %" : "not reachable", + ); Future getConnectivityTypeName() => getConnectivity().then((value) => value.type.name); - Future getConnectivitySignalStrength() => getConnectivity() - .then((value) => value.wifiSignalStrength?.toString() ?? "not reachable"); + Future getConnectivitySignalStrength() => getConnectivity().then( + (value) => value.wifiSignalStrength?.toString() ?? "not reachable", + ); Stream getConnectivityTypeStream() => connectivityStream.map((value) => value.type.name); @@ -33,8 +38,10 @@ extension FlutterEcoModeExtension on FlutterEcoMode { } extension FutureEcoRangeExtension on Future { - Future getScore() => then((value) => - value?.score != null ? "${(value!.score * 100).toInt()}/100" : null); + Future getScore() => then( + (value) => + value?.score != null ? "${(value!.score * 100).toInt()}/100" : null, + ); Future getRange() => then((value) => value?.range.name); diff --git a/example/lib/low_end_device/low_end_device_page.dart b/example/lib/low_end_device/low_end_device_page.dart index 0bf531c..99f329b 100644 --- a/example/lib/low_end_device/low_end_device_page.dart +++ b/example/lib/low_end_device/low_end_device_page.dart @@ -23,51 +23,43 @@ class _LowEndDevicePageState extends State { @override Widget build(BuildContext context) { - return ResultsView( - [ - ResultLine( - label: 'Platform info', - future: widget.ecoMode.getPlatformInfo, - ), - ResultLine( - label: 'Processor count', - future: widget.ecoMode.getProcessorCount, - ), - ResultLine( - label: 'Total memory', - future: widget.ecoMode.getTotalMemory, - ), - ResultLine( - label: 'Free memory', - future: widget.ecoMode.getFreeMemoryReachable, - ), - ResultLine( - label: 'Total storage', - future: widget.ecoMode.getTotalStorage, - ), - ResultLine( - label: 'Free storage', - future: widget.ecoMode.getFreeStorage, - ), - ResultLine( - label: 'Device range score', - labelColor: Colors.blue, - valueColor: Colors.blue, - future: deviceRange.getScore, - ), - ResultLine( - label: 'Device range', - labelColor: Colors.blue, - valueColor: Colors.blue, - future: deviceRange.getRange, - ), - ResultLine( - label: 'Is low end device', - labelColor: Colors.purple, - valueColor: Colors.purple, - future: deviceRange.isLowEndDevice, - ), - ], - ); + return ResultsView([ + ResultLine( + label: 'Platform info', + future: widget.ecoMode.getPlatformInfo, + ), + ResultLine( + label: 'Processor count', + future: widget.ecoMode.getProcessorCount, + ), + ResultLine(label: 'Total memory', future: widget.ecoMode.getTotalMemory), + ResultLine( + label: 'Free memory', + future: widget.ecoMode.getFreeMemoryReachable, + ), + ResultLine( + label: 'Total storage', + future: widget.ecoMode.getTotalStorage, + ), + ResultLine(label: 'Free storage', future: widget.ecoMode.getFreeStorage), + ResultLine( + label: 'Device range score', + labelColor: Colors.blue, + valueColor: Colors.blue, + future: deviceRange.getScore, + ), + ResultLine( + label: 'Device range', + labelColor: Colors.blue, + valueColor: Colors.blue, + future: deviceRange.getRange, + ), + ResultLine( + label: 'Is low end device', + labelColor: Colors.purple, + valueColor: Colors.purple, + future: deviceRange.isLowEndDevice, + ), + ]); } } diff --git a/example/lib/main.dart b/example/lib/main.dart index 6e8840b..87adbb5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -14,33 +14,31 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) => MaterialApp( - theme: ThemeData( - appBarTheme: const AppBarTheme( - elevation: 5, - shadowColor: Colors.grey, - backgroundColor: Colors.blueAccent, - foregroundColor: Colors.white, - titleTextStyle: TextStyle(fontSize: 25), - ), - textButtonTheme: TextButtonThemeData( - style: TextButton.styleFrom( - backgroundColor: Colors.blueAccent, - foregroundColor: Colors.white, - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), - elevation: 5, - shadowColor: Colors.grey, - minimumSize: const Size(250, 50), - textStyle: const TextStyle(fontSize: 25), - ), - ), - ), - home: Scaffold( - appBar: AppBar( - title: const Text('Example'), - ), - body: const _MyApp(), + theme: ThemeData( + appBarTheme: const AppBarTheme( + elevation: 5, + shadowColor: Colors.grey, + backgroundColor: Colors.blueAccent, + foregroundColor: Colors.white, + titleTextStyle: TextStyle(fontSize: 25), + ), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom( + backgroundColor: Colors.blueAccent, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + elevation: 5, + shadowColor: Colors.grey, + minimumSize: const Size(250, 50), + textStyle: const TextStyle(fontSize: 25), ), - ); + ), + ), + home: Scaffold( + appBar: AppBar(title: const Text('Example')), + body: const _MyApp(), + ), + ); } class _MyApp extends StatefulWidget { @@ -72,37 +70,44 @@ class _MyAppState extends State<_MyApp> { mainAxisAlignment: MainAxisAlignment.center, children: [ TextButton( - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => WrapperPage( - LowEndDevicePage(plugin), - title: "Low End Device"), - ), - ), + onPressed: + () => Navigator.of(context).push( + MaterialPageRoute( + builder: + (BuildContext context) => WrapperPage( + LowEndDevicePage(plugin), + title: "Low End Device", + ), + ), + ), child: const Text("Low End Device"), ), const SizedBox(height: 32), TextButton( - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => WrapperPage( - EcoBatteryPage(plugin), - title: "Eco Battery", + onPressed: + () => Navigator.of(context).push( + MaterialPageRoute( + builder: + (BuildContext context) => WrapperPage( + EcoBatteryPage(plugin), + title: "Eco Battery", + ), + ), ), - ), - ), child: const Text("Eco Battery"), ), const SizedBox(height: 32), TextButton( - onPressed: () => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => WrapperPage( - ConnectivityStatePage(plugin), - title: "Connectivity State", + onPressed: + () => Navigator.of(context).push( + MaterialPageRoute( + builder: + (BuildContext context) => WrapperPage( + ConnectivityStatePage(plugin), + title: "Connectivity State", + ), + ), ), - ), - ), child: const Text("Connectivity State"), ), ], diff --git a/example/lib/results.dart b/example/lib/results.dart index 2130a9c..2ca59e7 100644 --- a/example/lib/results.dart +++ b/example/lib/results.dart @@ -27,22 +27,20 @@ class ResultsView extends StatelessWidget { return GridView.count( crossAxisCount: 2, childAspectRatio: 5 / 2, - children: resultLines - .map( - (line) => [ - _ResultTitle( - line.label, - labelColor: line.labelColor, - ), - _Result( - future: line.future, - stream: line.stream, - valueColor: line.valueColor, - ), - ], - ) - .expand((e) => e) - .toList(), + children: + resultLines + .map( + (line) => [ + _ResultTitle(line.label, labelColor: line.labelColor), + _Result( + future: line.future, + stream: line.stream, + valueColor: line.valueColor, + ), + ], + ) + .expand((e) => e) + .toList(), ); } } @@ -51,20 +49,14 @@ class _ResultTitle extends StatelessWidget { final String label; final Color? labelColor; - const _ResultTitle( - this.label, { - this.labelColor = Colors.transparent, - }); + const _ResultTitle(this.label, {this.labelColor = Colors.transparent}); @override Widget build(BuildContext context) { return _ResultDecoration( Text( label, - style: TextStyle( - fontWeight: FontWeight.bold, - color: labelColor, - ), + style: TextStyle(fontWeight: FontWeight.bold, color: labelColor), ), ); } @@ -103,19 +95,17 @@ class _ResultState extends State<_Result> { return _ResultDecoration( widget.stream != null ? StreamBuilder( - stream: _stream, - builder: (_, snapshot) => _ResultAsync( - snapshot, - color: widget.valueColor, - ), - ) + stream: _stream, + builder: + (_, snapshot) => + _ResultAsync(snapshot, color: widget.valueColor), + ) : FutureBuilder( - future: _future, - builder: (_, snapshot) => _ResultAsync( - snapshot, - color: widget.valueColor, - ), - ), + future: _future, + builder: + (_, snapshot) => + _ResultAsync(snapshot, color: widget.valueColor), + ), alignment: Alignment.center, ); } @@ -125,24 +115,14 @@ class _ResultAsync extends StatelessWidget { final AsyncSnapshot snapshot; final Color? color; - const _ResultAsync( - this.snapshot, { - super.key, - this.color, - }); + const _ResultAsync(this.snapshot, {super.key, this.color}); @override Widget build(BuildContext context) { if (snapshot.hasData && snapshot.data != null) { - return Text( - '${snapshot.data}', - style: TextStyle(color: color), - ); + return Text('${snapshot.data}', style: TextStyle(color: color)); } else if (snapshot.hasError) { - return Text( - 'not reachable', - style: TextStyle(color: color), - ); + return Text('not reachable', style: TextStyle(color: color)); } else { return const CircularProgressIndicator(); } @@ -160,15 +140,9 @@ class _ResultDecoration extends StatelessWidget { return Container( alignment: alignment ?? Alignment.centerLeft, decoration: BoxDecoration( - border: Border.all( - color: Colors.black, - width: 1, - ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: widget, + border: Border.all(color: Colors.black, width: 1), ), + child: Padding(padding: const EdgeInsets.all(8.0), child: widget), ); } } diff --git a/example/lib/wrapper_page.dart b/example/lib/wrapper_page.dart index 11ffa65..1f83e2c 100644 --- a/example/lib/wrapper_page.dart +++ b/example/lib/wrapper_page.dart @@ -11,17 +11,15 @@ class WrapperPage extends StatelessWidget { return SafeArea( child: Scaffold( appBar: AppBar( - title: Text(title), - leading: IconButton( - icon: const Icon(Icons.arrow_back), - onPressed: () { - Navigator.of(context).pop(); - }, - )), - body: Padding( - padding: const EdgeInsets.all(8.0), - child: child, + title: Text(title), + leading: IconButton( + icon: const Icon(Icons.arrow_back), + onPressed: () { + Navigator.of(context).pop(); + }, + ), ), + body: Padding(padding: const EdgeInsets.all(8.0), child: child), ), ); } diff --git a/example/pubspec.lock b/example/pubspec.lock index be6e6cb..57f3da6 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,16 +5,16 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "2.1.2" characters: @@ -22,7 +22,7 @@ packages: description: name: characters sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.4.0" clock: @@ -30,7 +30,7 @@ packages: description: name: clock sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.1.2" collection: @@ -38,7 +38,7 @@ packages: description: name: collection sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.19.1" cupertino_icons: @@ -46,35 +46,22 @@ packages: description: name: cupertino_icons sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.0.8" fake_async: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" source: hosted - version: "1.3.2" - file: - dependency: transitive - description: - name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" - source: hosted - version: "7.0.1" + version: "1.3.3" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_driver: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" flutter_eco_mode: dependency: "direct main" description: @@ -87,7 +74,7 @@ packages: description: name: flutter_lints sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "2.0.3" flutter_test: @@ -95,46 +82,36 @@ packages: description: flutter source: sdk version: "0.0.0" - fuchsia_remote_debug_protocol: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - integration_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "2.1.1" matcher: @@ -142,7 +119,7 @@ packages: description: name: matcher sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "0.12.17" material_color_utilities: @@ -150,49 +127,33 @@ packages: description: name: material_color_utilities sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" path: dependency: transitive description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.9.1" - platform: - dependency: transitive - description: - name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" - source: hosted - version: "3.1.6" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "2.1.8" - process: - dependency: transitive - description: - name: process - sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" - source: hosted - version: "5.0.3" sky_engine: dependency: transitive description: flutter @@ -202,16 +163,16 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" stack_trace: dependency: transitive description: name: stack_trace sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.12.1" stream_channel: @@ -219,7 +180,7 @@ packages: description: name: stream_channel sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "2.1.4" string_scanner: @@ -227,57 +188,41 @@ packages: description: name: string_scanner sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.4.1" - sync_http: - dependency: transitive - description: - name: sync_http - sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" - source: hosted - version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + url: "https://pub.dev" source: hosted version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" - source: hosted - version: "14.3.1" - webdriver: - dependency: transitive - description: - name: webdriver - sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" - url: "https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub/" + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "15.0.2" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" flutter: ">=3.29.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 6f90663..d0cf4d4 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,87 +1,23 @@ name: flutter_eco_mode_example description: "Demonstrates how to use the flutter_eco_mode plugin." -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: 'none' version: 0.0.3 environment: - sdk: '>=3.2.3 <4.0.0' + sdk: '^3.7.0' -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - flutter_eco_mode: - # When depending on this package from a real application you should use: - # flutter_eco_mode: ^x.y.z - # See https://dart.dev/tools/pub/dependencies#version-constraints - # The example app is bundled with the plugin so we use a path dependency on - # the parent directory to use the current plugin's version. path: ../ - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 dev_dependencies: - integration_test: - sdk: flutter flutter_test: sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.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 packages. 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/ios/.gitignore b/ios/.gitignore index 0c88507..2808447 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -35,4 +35,7 @@ Icon? /Flutter/Generated.xcconfig /Flutter/ephemeral/ -/Flutter/flutter_export_environment.sh \ No newline at end of file +/Flutter/flutter_export_environment.sh + +.build +.spm \ No newline at end of file diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ios/flutter_eco_mode.podspec b/ios/flutter_eco_mode.podspec index d5c8b29..c96c425 100644 --- a/ios/flutter_eco_mode.podspec +++ b/ios/flutter_eco_mode.podspec @@ -13,9 +13,9 @@ A new Flutter project. s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'flutter_eco_mode/Sources/flutter_eco_mode/**/*.swift' s.dependency 'Flutter' - s.platform = :ios, '11.0' + s.platform = :ios, '13.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/ios/flutter_eco_mode/Package.swift b/ios/flutter_eco_mode/Package.swift new file mode 100644 index 0000000..7b0b906 --- /dev/null +++ b/ios/flutter_eco_mode/Package.swift @@ -0,0 +1,22 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "flutter_eco_mode", + platforms: [ + .iOS("13.0") + ], + products: [ + .library( + name: "flutter-eco-mode", + targets: ["flutter_eco_mode"] + ) + ], + targets: [ + .target( + name: "flutter_eco_mode" + ), + ] +) \ No newline at end of file diff --git a/ios/Classes/FlutterEcoModePlugin.swift b/ios/flutter_eco_mode/Sources/flutter-eco-mode/FlutterEcoModePlugin.swift similarity index 100% rename from ios/Classes/FlutterEcoModePlugin.swift rename to ios/flutter_eco_mode/Sources/flutter-eco-mode/FlutterEcoModePlugin.swift diff --git a/ios/Classes/Messages.g.swift b/ios/flutter_eco_mode/Sources/flutter-eco-mode/Messages.g.swift similarity index 99% rename from ios/Classes/Messages.g.swift rename to ios/flutter_eco_mode/Sources/flutter-eco-mode/Messages.g.swift index c5b7cdc..2037a32 100644 --- a/ios/Classes/Messages.g.swift +++ b/ios/flutter_eco_mode/Sources/flutter-eco-mode/Messages.g.swift @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.0), do not edit directly. +// Autogenerated from Pigeon (v26.1.7), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation diff --git a/lib/src/messages.g.dart b/lib/src/messages.g.dart index 8b960b9..d06ce2d 100644 --- a/lib/src/messages.g.dart +++ b/lib/src/messages.g.dart @@ -1,6 +1,6 @@ -// Autogenerated from Pigeon (v26.1.0), do not edit directly. +// Autogenerated from Pigeon (v26.1.7), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -131,13 +131,13 @@ class _PigeonCodec extends StandardMessageCodec { Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 129: - final int? value = readValue(buffer) as int?; + final value = readValue(buffer) as int?; return value == null ? null : BatteryState.values[value]; case 130: - final int? value = readValue(buffer) as int?; + final value = readValue(buffer) as int?; return value == null ? null : ThermalState.values[value]; case 131: - final int? value = readValue(buffer) as int?; + final value = readValue(buffer) as int?; return value == null ? null : ConnectivityType.values[value]; case 132: return Connectivity.decode(readValue(buffer)!); @@ -164,17 +164,15 @@ class EcoModeApi { final String pigeonVar_messageChannelSuffix; Future getPlatformInfo() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getPlatformInfo$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -194,17 +192,15 @@ class EcoModeApi { } Future getBatteryLevel() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getBatteryLevel$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -224,17 +220,15 @@ class EcoModeApi { } Future getBatteryState() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getBatteryState$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -254,17 +248,15 @@ class EcoModeApi { } Future isBatteryInLowPowerMode() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.isBatteryInLowPowerMode$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -284,17 +276,15 @@ class EcoModeApi { } Future getThermalState() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getThermalState$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -314,17 +304,15 @@ class EcoModeApi { } Future getProcessorCount() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getProcessorCount$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -344,17 +332,15 @@ class EcoModeApi { } Future getTotalMemory() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getTotalMemory$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -374,17 +360,15 @@ class EcoModeApi { } Future getFreeMemory() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getFreeMemory$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -404,17 +388,15 @@ class EcoModeApi { } Future getTotalStorage() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getTotalStorage$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -434,17 +416,15 @@ class EcoModeApi { } Future getFreeStorage() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getFreeStorage$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -464,17 +444,15 @@ class EcoModeApi { } Future getEcoScore() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getEcoScore$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -489,17 +467,15 @@ class EcoModeApi { } Future getConnectivity() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_eco_mode.EcoModeApi.getConnectivity$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = - await pigeonVar_sendFuture as List?; + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { diff --git a/pigeons/messages.dart b/pigeons/messages.dart index 9e968df..66d80dd 100644 --- a/pigeons/messages.dart +++ b/pigeons/messages.dart @@ -7,7 +7,7 @@ import 'package:pigeon/pigeon.dart'; kotlinOut: 'android/src/main/kotlin/sncf/connect/tech/flutter_eco_mode/Messages.g.kt', kotlinOptions: KotlinOptions(package: 'sncf.connect.tech.flutter_eco_mode'), - swiftOut: 'ios/Classes/Messages.g.swift', + swiftOut: 'ios/flutter_eco_mode/Sources/flutter-eco-mode/Messages.g.swift', swiftOptions: SwiftOptions(), dartPackageName: 'flutter_eco_mode', ),