diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index 80572617fd64..9409a2e80e03 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,6 +1,7 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. +* Adds shared_preferences_tool devtools extension ## 2.2.3 diff --git a/packages/shared_preferences/shared_preferences/example/.metadata b/packages/shared_preferences/shared_preferences/example/.metadata deleted file mode 100644 index e0e9530fccc9..000000000000 --- a/packages/shared_preferences/shared_preferences/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# 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. - -version: - revision: 79b49b9e1057f90ebf797725233c6b311722de69 - channel: dev - -project_type: app diff --git a/packages/shared_preferences/shared_preferences/extension/devtools/.pubignore b/packages/shared_preferences/shared_preferences/extension/devtools/.pubignore new file mode 100644 index 000000000000..71860a75dbf2 --- /dev/null +++ b/packages/shared_preferences/shared_preferences/extension/devtools/.pubignore @@ -0,0 +1 @@ +!build diff --git a/packages/shared_preferences/shared_preferences/extension/devtools/config.yaml b/packages/shared_preferences/shared_preferences/extension/devtools/config.yaml new file mode 100644 index 000000000000..f9ac5f1f4615 --- /dev/null +++ b/packages/shared_preferences/shared_preferences/extension/devtools/config.yaml @@ -0,0 +1,4 @@ +name: shared_preferences_tools +issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 +version: 1.0.0 +materialIconCodePoint: '0xe683' diff --git a/packages/shared_preferences/shared_preferences_tools/LICENSE b/packages/shared_preferences/shared_preferences_tools/LICENSE new file mode 100644 index 000000000000..c6823b81eb84 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/LICENSE @@ -0,0 +1,25 @@ +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_tools/README.md b/packages/shared_preferences/shared_preferences_tools/README.md new file mode 100644 index 000000000000..6409456341ef --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/README.md @@ -0,0 +1,28 @@ +A [DevTools extension](https://pub.dev/packages/devtools_extensions) for Flutter's [shared_preferences](https://pub.dev/packages/shared_preferences) package. + +## Features + +This package adds a new tool to Flutter's DevTools, utilizing the new `devtools_extensions` framework. With this tool, you can: + +- List all keys stored in your app's SharedPreferences. +- Search for specific keys. +- Edit or remove values directly, with changes reflected in your app instantly. + +It supports all data types available in SharedPreferences: + +- String +- int +- double +- bool +- List + +## Running this project locally + +1. Run the example project in the `shared_preferences_tools` package and copy its debug service URL. +2. Run the `shared_preferences_tools` project by running the following command: + +```shell +flutter run -d chrome --dart-define=use_simulated_environment=true +``` + +For more information, see the [devtools_extensions](https://pub.dev/packages/devtools_extensions) package documentation. diff --git a/packages/shared_preferences/shared_preferences/example/.gitignore b/packages/shared_preferences/shared_preferences_tools/example/.gitignore similarity index 91% rename from packages/shared_preferences/shared_preferences/example/.gitignore rename to packages/shared_preferences/shared_preferences_tools/example/.gitignore index 0fa6b675c0a5..29a3a5017f04 100644 --- a/packages/shared_preferences/shared_preferences/example/.gitignore +++ b/packages/shared_preferences/shared_preferences_tools/example/.gitignore @@ -8,6 +8,7 @@ .buildlog/ .history .svn/ +migrate_working_dir/ # IntelliJ related *.iml @@ -26,14 +27,10 @@ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ -# Web related -lib/generated_plugin_registrant.dart - # Symbolication related app.*.symbols diff --git a/packages/shared_preferences/shared_preferences_tools/example/.metadata b/packages/shared_preferences/shared_preferences_tools/example/.metadata new file mode 100644 index 000000000000..2180886754c6 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/.metadata @@ -0,0 +1,39 @@ +# 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. + +version: + revision: "b7e7d46a046ba8a22897a514bf2311a0f81ab198" + channel: "beta" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + base_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + - platform: android + create_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + base_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + - platform: ios + create_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + base_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + - platform: macos + create_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + base_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + - platform: web + create_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + base_revision: b7e7d46a046ba8a22897a514bf2311a0f81ab198 + + # 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/packages/shared_preferences/shared_preferences_tools/example/android/.gitignore b/packages/shared_preferences/shared_preferences_tools/example/android/.gitignore new file mode 100644 index 000000000000..6f568019d3c6 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/build.gradle b/packages/shared_preferences/shared_preferences_tools/example/android/app/build.gradle new file mode 100644 index 000000000000..e28b4e76ef7f --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/build.gradle @@ -0,0 +1,67 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "com.example.example" + compileSdk flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies {} diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/debug/AndroidManifest.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000000..399f6981d5d3 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/AndroidManifest.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..aff7dec7b850 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 000000000000..70f8f08f2479 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000000..f74085f3f6a2 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/drawable/launch_background.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000000..304732f88420 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000000..db77bb4b7b09 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000000..17987b79bb8a Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000000..09d4391482be Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000000..d5f1c8d34e7a Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000000..4d6372eebdb2 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/values-night/styles.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000000..06952be745f9 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/values/styles.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000000..cb1ef88056ed --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/app/src/profile/AndroidManifest.xml b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000000..399f6981d5d3 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/build.gradle b/packages/shared_preferences/shared_preferences_tools/example/android/build.gradle new file mode 100644 index 000000000000..bc157bd1a12b --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/gradle.properties b/packages/shared_preferences/shared_preferences_tools/example/android/gradle.properties new file mode 100644 index 000000000000..598d13fee446 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/shared_preferences/shared_preferences_tools/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..e1ca574ef017 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/packages/shared_preferences/shared_preferences_tools/example/android/settings.gradle b/packages/shared_preferences/shared_preferences_tools/example/android/settings.gradle new file mode 100644 index 000000000000..1d6d19b7f8ec --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/android/settings.gradle @@ -0,0 +1,26 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/.gitignore b/packages/shared_preferences/shared_preferences_tools/example/ios/.gitignore new file mode 100644 index 000000000000..7a7f9873ad7d --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/AppFrameworkInfo.plist b/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000000..7c5696400627 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/Debug.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000000..ec97fc6f3021 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/Release.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000000..c4855bfe2000 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Podfile b/packages/shared_preferences/shared_preferences_tools/example/ios/Podfile new file mode 100644 index 000000000000..d97f17e223fb --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.pbxproj b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..2636c25afe22 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,619 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + 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 */; }; + 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 */; }; +/* 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; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 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 = ""; }; + 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 = ""; }; + 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; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + 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 = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + 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; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* 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; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* 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; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = DFV49R7KAM; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.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; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.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; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.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 = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = DFV49R7KAM; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = DFV49R7KAM; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* 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 = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..919434a6254f --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..8e3ca5dfe193 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..1d526a16ed0f --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/AppDelegate.swift b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000000..70693e4a8c12 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..d36b1fab2d9d --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000000..dc9ada4725e9 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000000..7353c41ecf9c Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000000..797d452e4589 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000000..6ed2d933e112 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000000..4cd7b0099ca8 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000000..fe730945a01f Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000000..321773cd857a Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000000..797d452e4589 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000000..502f463a9bc8 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000000..0ec303439225 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000000..0ec303439225 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000000..e9f5fea27c70 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000000..84ac32ae7d98 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000000..8953cba09064 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000000..0467bf12aa4d Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000000..0bedcf2fd467 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000000..89c2725b70f1 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..f2e259c7c939 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Base.lproj/Main.storyboard b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..f3c28516fb38 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Info.plist b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Info.plist new file mode 100644 index 000000000000..5458fc4188bf --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Runner-Bridging-Header.h b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000000..308a2a560b42 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/shared_preferences/shared_preferences_tools/example/ios/RunnerTests/RunnerTests.swift b/packages/shared_preferences/shared_preferences_tools/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000000..86a7c3b1b611 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/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/packages/shared_preferences/shared_preferences_tools/example/lib/main.dart b/packages/shared_preferences/shared_preferences_tools/example/lib/main.dart new file mode 100644 index 000000000000..e9c94919d682 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/lib/main.dart @@ -0,0 +1,105 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +Future _setInitialValues() async { + final SharedPreferences prefs = await SharedPreferences.getInstance(); + + if (prefs.getKeys().isNotEmpty) { + return; + } + + await Future.wait(>[ + prefs.setString('someStringKey', 'Hello, world!'), + prefs.setInt('someIntKey', 42), + prefs.setDouble('someDoubleKey', 3.14), + prefs.setBool('someBoolKey', true), + prefs.setStringList( + 'someStringListKey', + ['Hello World 1', 'Hello World 2'], + ), + ]); +} + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + await _setInitialValues(); + + runApp(const _SharedPreferencesToolsExample()); +} + +class _SharedPreferencesToolsExample extends StatelessWidget { + const _SharedPreferencesToolsExample(); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Shared Preferences Tools Example', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: const Scaffold( + body: _Content(), + ), + ); + } +} + +class _Content extends StatefulWidget { + const _Content(); + + @override + State<_Content> createState() => _ContentState(); +} + +class _ContentState extends State<_Content> { + bool loading = false; + late Future prefsFuture; + + @override + void initState() { + prefsFuture = SharedPreferences.getInstance(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: prefsFuture, + builder: (BuildContext context, AsyncSnapshot state) { + final SharedPreferences? prefs = state.data; + + if (prefs == null || loading) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + return Center( + child: ListView( + shrinkWrap: true, + padding: const EdgeInsets.all(16), + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('someStringKey: ${prefs.getString('someStringKey')}'), + const SizedBox(height: 8), + Text('someIntKey: ${prefs.getInt('someIntKey')}'), + const SizedBox(height: 8), + Text('someDoubleKey: ${prefs.getDouble('someDoubleKey')}'), + const SizedBox(height: 8), + Text('someBoolKey: ${prefs.getBool('someBoolKey')}'), + const SizedBox(height: 8), + Text( + 'someStringListKey: ${prefs.getStringList('someStringListKey')}', + ), + ], + ), + ], + ), + ); + }, + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/.gitignore b/packages/shared_preferences/shared_preferences_tools/example/macos/.gitignore new file mode 100644 index 000000000000..746adbb6b9e1 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 000000000000..4b81f9b2d200 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Flutter/Flutter-Release.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 000000000000..5caa9d1579e4 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Podfile b/packages/shared_preferences/shared_preferences_tools/example/macos/Podfile new file mode 100644 index 000000000000..c795730db8ed --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/project.pbxproj b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..f502ad331d66 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,801 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 5CDA47D2858396E4199189FA /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88A967864EF0D74721257833 /* Pods_Runner.framework */; }; + 88251299A1A067F64015279A /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B031CEEC57E7199189D90C33 /* Pods_RunnerTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1532F8AC2B5E9F0313C0514B /* 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 = ""; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 64806683598CF27092B8E48A /* 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 = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 88A967864EF0D74721257833 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D9C07B63A2D4753586D5F4E /* 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; path = Debug.xcconfig; sourceTree = ""; }; + AFF44400B6A6F0E3CE8C9D03 /* 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 = ""; }; + B031CEEC57E7199189D90C33 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E2D416FC6DC655B138EFFD4B /* 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 = ""; }; + F078E83702FA86FB184ACD65 /* 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 88251299A1A067F64015279A /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5CDA47D2858396E4199189FA /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 02538682692E326D3965DC03 /* Pods */ = { + isa = PBXGroup; + children = ( + 8D9C07B63A2D4753586D5F4E /* Pods-Runner.debug.xcconfig */, + F078E83702FA86FB184ACD65 /* Pods-Runner.release.xcconfig */, + E2D416FC6DC655B138EFFD4B /* Pods-Runner.profile.xcconfig */, + AFF44400B6A6F0E3CE8C9D03 /* Pods-RunnerTests.debug.xcconfig */, + 1532F8AC2B5E9F0313C0514B /* Pods-RunnerTests.release.xcconfig */, + 64806683598CF27092B8E48A /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 02538682692E326D3965DC03 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* example.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 88A967864EF0D74721257833 /* Pods_Runner.framework */, + B031CEEC57E7199189D90C33 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + C584690F260679E55240A459 /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 553D63E6337938CC072F4954 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 0BF58EA8AB9F684C4CF058D9 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 0BF58EA8AB9F684C4CF058D9 /* [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; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 553D63E6337938CC072F4954 /* [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; + }; + C584690F260679E55240A459 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AFF44400B6A6F0E3CE8C9D03 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1532F8AC2B5E9F0313C0514B /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 64806683598CF27092B8E48A /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..15368eccb25a --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/AppDelegate.swift b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/AppDelegate.swift new file mode 100644 index 000000000000..d53ef6437726 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..a2ec33f19f11 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 000000000000..82b6f9d9a33e Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 000000000000..13b35eba55c6 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 000000000000..0a3f5fa40fb3 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 000000000000..bdb57226d5f2 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 000000000000..f083318e09ca Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 000000000000..326c0e72c9d8 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 000000000000..2f1632cfddf3 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 000000000000..80e867a4e06b --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 000000000000..92fb3cd54e84 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.example + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Debug.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 000000000000..36b0fd9464f4 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Release.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 000000000000..dff4f49561c8 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Warnings.xcconfig b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 000000000000..42bcbf4780b1 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/DebugProfile.entitlements b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 000000000000..dddb8a30c851 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Info.plist b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Info.plist new file mode 100644 index 000000000000..4789daa6a443 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/MainFlutterWindow.swift b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 000000000000..3cc05eb23491 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Release.entitlements b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Release.entitlements new file mode 100644 index 000000000000..852fa1a4728a --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/macos/RunnerTests/RunnerTests.swift b/packages/shared_preferences/shared_preferences_tools/example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000000..5418c9f53955 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import FlutterMacOS +import Cocoa +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/packages/shared_preferences/shared_preferences_tools/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_tools/example/pubspec.yaml new file mode 100644 index 000000000000..33d0ac994801 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/pubspec.yaml @@ -0,0 +1,21 @@ +name: example +description: "Shared preferences tools example" + +publish_to: 'none' + +version: 1.0.0+1 + +environment: + sdk: '>=3.2.3 <4.0.0' + +dependencies: + flutter: + sdk: flutter + shared_preferences: ^2.2.3 + +dev_dependencies: + flutter_test: + sdk: flutter + +flutter: + uses-material-design: true diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/favicon.png b/packages/shared_preferences/shared_preferences_tools/example/web/favicon.png new file mode 100644 index 000000000000..8aaa46ac1ae2 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/web/favicon.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-192.png b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-192.png new file mode 100644 index 000000000000..b749bfef0747 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-192.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-512.png b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-512.png new file mode 100644 index 000000000000..88cfd48dff11 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-512.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-maskable-192.png b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-maskable-192.png new file mode 100644 index 000000000000..eb9b4d76e525 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-maskable-192.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-maskable-512.png b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-maskable-512.png new file mode 100644 index 000000000000..d69c56691fbd Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/example/web/icons/Icon-maskable-512.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/index.html b/packages/shared_preferences/shared_preferences_tools/example/web/index.html new file mode 100644 index 000000000000..45cf2ca304e4 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/web/index.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/example/web/manifest.json b/packages/shared_preferences/shared_preferences_tools/example/web/manifest.json new file mode 100644 index 000000000000..096edf8fe4cd --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/main.dart b/packages/shared_preferences/shared_preferences_tools/lib/main.dart new file mode 100644 index 000000000000..04b075d3e2aa --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/main.dart @@ -0,0 +1,22 @@ +import 'package:devtools_extensions/devtools_extensions.dart'; +import 'package:flutter/material.dart'; + +import 'src/shared_preferences_state_notifier_provider.dart'; +import 'src/ui/shared_preferences_body.dart'; + +void main() { + runApp(const _SharedPreferencesTools()); +} + +class _SharedPreferencesTools extends StatelessWidget { + const _SharedPreferencesTools(); + + @override + Widget build(BuildContext context) { + return const DevToolsExtension( + child: SharedPreferencesStateNotifierProvider( + child: SharedPreferencesBody(), + ), + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/async_state.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/async_state.dart new file mode 100644 index 000000000000..681ab64c2bbb --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/async_state.dart @@ -0,0 +1,91 @@ +import 'package:meta/meta.dart'; + +@internal +@immutable +sealed class AsyncState { + const AsyncState(); + + const factory AsyncState.loading() = AsyncStateLoading; + + const factory AsyncState.data(T data) = AsyncStateData; + + const factory AsyncState.error(Object error, StackTrace? stackTrace) = + AsyncStateError; + + AsyncState whenData( + T Function(T data) onData, + ) { + return switch (this) { + AsyncStateData(data: final T data) => AsyncState.data(onData(data)), + _ => this, + }; + } + + T? get dataOrNull { + return switch (this) { + AsyncStateData(data: final T data) => data, + _ => null, + }; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + switch (this) { + AsyncStateLoading() => other is AsyncStateLoading, + AsyncStateData(data: final T data) => + other is AsyncStateData && other.data == data, + AsyncStateError( + error: final Object error, + stackTrace: final StackTrace? stackTrace + ) => + other is AsyncStateError && + other.error == error && + other.stackTrace == stackTrace, + }; + } + + @override + int get hashCode => switch (this) { + AsyncStateLoading() => 0, + AsyncStateData(data: final T data) => data.hashCode, + AsyncStateError( + error: final Object error, + stackTrace: final StackTrace? stackTrace + ) => + error.hashCode ^ stackTrace.hashCode, + }; + + @override + String toString() { + return switch (this) { + AsyncStateLoading() => 'AsyncState.loading()', + AsyncStateData(data: final T data) => 'AsyncState.data($data)', + AsyncStateError( + error: final Object error, + stackTrace: final StackTrace? stackTrace + ) => + 'AsyncState.error($error, $stackTrace)', + }; + } +} + +@internal +class AsyncStateLoading extends AsyncState { + const AsyncStateLoading(); +} + +@internal +class AsyncStateData extends AsyncState { + const AsyncStateData(this.data); + + final T data; +} + +@internal +class AsyncStateError extends AsyncState { + const AsyncStateError(this.error, this.stackTrace); + + final Object error; + final StackTrace? stackTrace; +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state.dart new file mode 100644 index 000000000000..5101c6d9294e --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state.dart @@ -0,0 +1,219 @@ +import 'dart:convert'; + +import 'package:flutter/foundation.dart'; +import 'package:meta/meta.dart'; + +import 'async_state.dart'; + +@internal +@immutable +class SharedPreferencesState { + const SharedPreferencesState({ + required this.allKeys, + required this.selectedKey, + this.editing = false, + }); + + final List allKeys; + final SelectedSharedPreferencesKey? selectedKey; + final bool editing; + + SharedPreferencesState copyWith({ + List? allKeys, + SelectedSharedPreferencesKey? selectedKey, + bool? editing, + }) { + return SharedPreferencesState( + allKeys: allKeys ?? this.allKeys, + selectedKey: selectedKey ?? this.selectedKey, + editing: editing ?? this.editing, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other is SharedPreferencesState && + listEquals(other.allKeys, allKeys) && + other.selectedKey == selectedKey && + other.editing == editing); + } + + @override + int get hashCode => + allKeys.hashCode ^ selectedKey.hashCode ^ editing.hashCode; + + @override + String toString() { + return 'SharedPreferencesState(allKeys: $allKeys, selectedKey: $selectedKey, editing: $editing)'; + } +} + +@internal +@immutable +class SelectedSharedPreferencesKey { + const SelectedSharedPreferencesKey({ + required this.key, + required this.value, + }); + + final String key; + + final AsyncState value; + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other is SelectedSharedPreferencesKey && + other.key == key && + other.value == value); + } + + @override + int get hashCode => key.hashCode ^ value.hashCode; + + @override + String toString() { + return 'SelectedSharedPreferencesKey(key: $key, value: $value)'; + } +} + +@internal +@immutable +sealed class SharedPreferencesData { + const SharedPreferencesData(); + + const factory SharedPreferencesData.string({ + required String value, + }) = SharedPreferencesDataString; + + const factory SharedPreferencesData.int({ + required int value, + }) = SharedPreferencesDataInt; + + const factory SharedPreferencesData.double({ + required double value, + }) = SharedPreferencesDataDouble; + + const factory SharedPreferencesData.bool({ + required bool value, + }) = SharedPreferencesDataBool; + + const factory SharedPreferencesData.stringList({ + required List value, + }) = SharedPreferencesDataStringList; + + String get valueAsString { + return switch (this) { + final SharedPreferencesDataString data => data.value, + final SharedPreferencesDataInt data => data.value.toString(), + final SharedPreferencesDataDouble data => data.value.toString(), + final SharedPreferencesDataBool data => data.value.toString(), + final SharedPreferencesDataStringList data => '\n${[ + for (final (int index, String str) in data.value.indexed) + '$index -> $str', + ].join('\n')}' + }; + } + + String get prettyType { + return switch (this) { + SharedPreferencesDataString() => 'String', + SharedPreferencesDataInt() => 'int', + SharedPreferencesDataDouble() => 'double', + SharedPreferencesDataBool() => 'bool', + SharedPreferencesDataStringList() => 'List', + }; + } + + SharedPreferencesData changeValue(String newValue) { + return switch (this) { + SharedPreferencesDataString() => + SharedPreferencesData.string(value: newValue), + SharedPreferencesDataInt() => + SharedPreferencesData.int(value: int.parse(newValue)), + SharedPreferencesDataDouble() => + SharedPreferencesData.double(value: double.parse(newValue)), + SharedPreferencesDataBool() => + SharedPreferencesData.bool(value: bool.parse(newValue)), + SharedPreferencesDataStringList() => SharedPreferencesData.stringList( + value: (jsonDecode(newValue) as List).cast(), + ), + }; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other is SharedPreferencesData && + switch (this) { + final SharedPreferencesDataString data => + other is SharedPreferencesDataString && + other.value == data.value, + final SharedPreferencesDataInt data => + other is SharedPreferencesDataInt && other.value == data.value, + final SharedPreferencesDataDouble data => + other is SharedPreferencesDataDouble && + other.value == data.value, + final SharedPreferencesDataBool data => + other is SharedPreferencesDataBool && other.value == data.value, + final SharedPreferencesDataStringList data => + other is SharedPreferencesDataStringList && + other.value == data.value, + }); + } + + @override + int get hashCode => switch (this) { + final SharedPreferencesDataString data => data.value.hashCode, + final SharedPreferencesDataInt data => data.value.hashCode, + final SharedPreferencesDataDouble data => data.value.hashCode, + final SharedPreferencesDataBool data => data.value.hashCode, + final SharedPreferencesDataStringList data => data.value.hashCode, + }; +} + +@internal +class SharedPreferencesDataString extends SharedPreferencesData { + const SharedPreferencesDataString({ + required this.value, + }); + + final String value; +} + +@internal +class SharedPreferencesDataInt extends SharedPreferencesData { + const SharedPreferencesDataInt({ + required this.value, + }); + + final int value; +} + +@internal +class SharedPreferencesDataDouble extends SharedPreferencesData { + const SharedPreferencesDataDouble({ + required this.value, + }); + + final double value; +} + +@internal +class SharedPreferencesDataBool extends SharedPreferencesData { + const SharedPreferencesDataBool({ + required this.value, + }); + + final bool value; +} + +@internal +class SharedPreferencesDataStringList extends SharedPreferencesData { + const SharedPreferencesDataStringList({ + required this.value, + }); + + final List value; +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state_notifier.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state_notifier.dart new file mode 100644 index 000000000000..5ec5fcd4400b --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state_notifier.dart @@ -0,0 +1,110 @@ +import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; + +import 'async_state.dart'; +import 'shared_preferences_state.dart'; +import 'shared_preferences_tools_eval.dart'; + +typedef _State = AsyncState; + +@internal +class SharedPreferencesStateNotifier extends ValueNotifier<_State> { + SharedPreferencesStateNotifier(this._eval) : super(const _State.loading()); + + final SharedPreferencesToolsEval _eval; + + List _keys = []; + + Future fetchAllKeys() async { + value = const _State.loading(); + try { + _keys = await _eval.fetchAllKeys(); + value = _State.data(SharedPreferencesState( + allKeys: _keys, + selectedKey: null, + )); + } catch (error, stackTrace) { + value = _State.error(error, stackTrace); + } + } + + void _setSelectedKeyValue( + String key, + AsyncState asyncValue, + ) { + value = value.whenData( + (SharedPreferencesState data) => data.copyWith( + selectedKey: SelectedSharedPreferencesKey( + key: key, + value: asyncValue, + ), + ), + ); + } + + Future selectKey(String key) async { + stopEditing(); + _setSelectedKeyValue( + key, + const AsyncState.loading(), + ); + + try { + final SharedPreferencesData keyValue = await _eval.fetchValue(key); + _setSelectedKeyValue( + key, + AsyncState.data(keyValue), + ); + } catch (error, stackTrace) { + _setSelectedKeyValue( + key, + AsyncState.error(error, stackTrace), + ); + } + } + + // poor man's fuzzy search algorithm + void filter(String token) { + final String lowercaseToken = token.toLowerCase(); + value = value.whenData((SharedPreferencesState data) { + return data.copyWith( + allKeys: _keys.where( + (String key) { + String currentSubstring = key.toLowerCase(); + for (final String char in lowercaseToken.characters) { + final int currentIndex = currentSubstring.indexOf(char); + if (currentIndex == -1) { + return false; + } + currentSubstring = currentSubstring.substring(currentIndex + 1); + } + return true; + }, + ).toList()); + }); + } + + Future changeValue(String key, SharedPreferencesData newValue) async { + await _eval.changeValue(key, newValue); + await selectKey(key); + stopEditing(); + } + + Future deleteKey(SelectedSharedPreferencesKey selectedKey) async { + await _eval.deleteKey(selectedKey.key); + await fetchAllKeys(); + stopEditing(); + } + + void startEditing() { + value = value.whenData((SharedPreferencesState data) { + return data.copyWith(editing: true); + }); + } + + void stopEditing() { + value = value.whenData((SharedPreferencesState data) { + return data.copyWith(editing: false); + }); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state_notifier_provider.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state_notifier_provider.dart new file mode 100644 index 000000000000..ea88d223fc5e --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_state_notifier_provider.dart @@ -0,0 +1,71 @@ +import 'package:devtools_app_shared/service.dart'; +import 'package:devtools_extensions/devtools_extensions.dart'; +import 'package:flutter/widgets.dart'; +import 'package:meta/meta.dart'; + +import 'shared_preferences_state_notifier.dart'; +import 'shared_preferences_tools_eval.dart'; + +@internal +@visibleForTesting +class StateInheritedNotifier + extends InheritedNotifier { + const StateInheritedNotifier({ + super.key, + required super.child, + required super.notifier, + }); +} + +@internal +class SharedPreferencesStateNotifierProvider extends StatefulWidget { + const SharedPreferencesStateNotifierProvider({ + super.key, + required this.child, + }); + + final Widget child; + + static SharedPreferencesStateNotifier of(BuildContext context) { + final StateInheritedNotifier? result = + context.dependOnInheritedWidgetOfExactType(); + return result!.notifier!; + } + + @override + State createState() => + _SharedPreferencesStateNotifierProviderState(); +} + +class _SharedPreferencesStateNotifierProviderState + extends State { + late final SharedPreferencesStateNotifier _notifier; + + @override + void initState() { + final EvalOnDartLibrary eval = EvalOnDartLibrary( + 'package:shared_preferences/shared_preferences.dart', + serviceManager.service!, + serviceManager: serviceManager, + ); + final SharedPreferencesToolsEval toolsEval = + SharedPreferencesToolsEval(eval); + _notifier = SharedPreferencesStateNotifier(toolsEval); + _notifier.fetchAllKeys(); + super.initState(); + } + + @override + void dispose() { + _notifier.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return StateInheritedNotifier( + notifier: _notifier, + child: widget.child, + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_tools_eval.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_tools_eval.dart new file mode 100644 index 000000000000..d2ad8a394f27 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/shared_preferences_tools_eval.dart @@ -0,0 +1,114 @@ +import 'package:devtools_app_shared/service.dart'; +import 'package:meta/meta.dart'; +import 'package:vm_service/vm_service.dart'; + +import 'shared_preferences_state.dart'; + +@internal +class SharedPreferencesToolsEval { + SharedPreferencesToolsEval(this._eval); + + final EvalOnDartLibrary _eval; + + Disposable? _allKeysDisposable; + Disposable? _valueDisposable; + Disposable? _changeValueDisposable; + Disposable? _removeValueDisposable; + + Future> fetchAllKeys() async { + _allKeysDisposable?.dispose(); + _allKeysDisposable = Disposable(); + final Instance keysSetInstance = await _eval.prefsGetInstance( + 'getKeys()', + _allKeysDisposable, + ); + return Future.wait(>[ + for (final InstanceRef keyRef + in keysSetInstance.elements!.cast()) + _eval.safeGetInstance(keyRef, _allKeysDisposable).then( + (Instance keyInstance) => keyInstance.valueAsString!, + ), + ]); + } + + Future fetchValue(String key) async { + _valueDisposable?.dispose(); + _valueDisposable = Disposable(); + final Instance valueInstance = await _eval.prefsGetInstance( + "get('$key')", + _valueDisposable, + ); + + return switch (valueInstance.kind) { + InstanceKind.kInt => SharedPreferencesData.int( + value: int.parse(valueInstance.valueAsString!), + ), + InstanceKind.kBool => SharedPreferencesData.bool( + value: bool.parse(valueInstance.valueAsString!), + ), + InstanceKind.kDouble => SharedPreferencesData.double( + value: double.parse(valueInstance.valueAsString!), + ), + InstanceKind.kString => SharedPreferencesData.string( + value: valueInstance.valueAsString!, + ), + InstanceKind.kList => SharedPreferencesData.stringList( + value: valueInstance.elements! + .cast() + .map( + (InstanceRef ref) => ref.valueAsString!, + ) + .toList(), + ), + _ => throw UnsupportedError( + 'Unsupported value type: ${valueInstance.kind}', + ), + }; + } + + Future changeValue(String key, SharedPreferencesData value) async { + _changeValueDisposable?.dispose(); + _changeValueDisposable = Disposable(); + final String method = switch (value) { + final SharedPreferencesDataString data => + "setString('$key', '${data.value}')", + final SharedPreferencesDataInt data => "setInt('$key', ${data.value})", + final SharedPreferencesDataDouble data => + "setDouble('$key', ${data.value})", + final SharedPreferencesDataBool data => "setBool('$key', ${data.value})", + final SharedPreferencesDataStringList data => + "setStringList('$key', [${data.value.map((String str) => "'$str'").join(', ')}])", + }; + await _eval.prefsEval(method, _changeValueDisposable); + } + + Future deleteKey(String key) async { + _removeValueDisposable?.dispose(); + _removeValueDisposable = Disposable(); + await _eval.prefsEval("remove('$key')", _removeValueDisposable); + } + + void dispose() { + _allKeysDisposable?.dispose(); + _valueDisposable?.dispose(); + _changeValueDisposable?.dispose(); + _removeValueDisposable?.dispose(); + _eval.dispose(); + } +} + +extension on EvalOnDartLibrary { + Future prefsEval(String method, Disposable? isAlive) async { + return (await asyncEval( + '(await SharedPreferences.getInstance()).$method', + isAlive: isAlive, + ))!; + } + + Future prefsGetInstance(String method, Disposable? isAlive) async { + return safeGetInstance( + prefsEval(method, isAlive), + isAlive, + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/ui/data_panel.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/data_panel.dart new file mode 100644 index 000000000000..d532faaea60d --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/data_panel.dart @@ -0,0 +1,323 @@ +import 'dart:convert'; + +import 'package:devtools_app_shared/ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; + +import '../async_state.dart'; +import '../shared_preferences_state.dart'; +import '../shared_preferences_state_notifier.dart'; +import '../shared_preferences_state_notifier_provider.dart'; +import 'error_panel.dart'; + +@internal +class DataPanel extends StatefulWidget { + const DataPanel({super.key}); + + @override + State createState() => DataPanelState(); +} + +@internal +class DataPanelState extends State { + String? currentValue; + + void _setCurrentValue(String value) { + setState(() { + currentValue = value; + }); + } + + void _showSnackBar(String message) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(message), + ), + ); + } + + void _dismissDialog() { + Navigator.of(context).pop(); + } + + @override + Widget build(BuildContext context) { + final SharedPreferencesStateNotifier notifier = + SharedPreferencesStateNotifierProvider.of(context); + final SharedPreferencesState? data = notifier.value.dataOrNull; + final SelectedSharedPreferencesKey? selectedKey = data?.selectedKey; + + if (data == null || selectedKey == null) { + return const Center( + child: Text('Select a key to view its data.'), + ); + } + + return RoundedOutlinedBorder( + clip: true, + child: switch (selectedKey.value) { + AsyncStateLoading() => const Center( + child: CircularProgressIndicator(), + ), + final AsyncStateError value => ErrorPanel( + error: value.error, + stackTrace: value.stackTrace, + ), + final AsyncStateData value => Column( + children: [ + AreaPaneHeader( + roundedTopBorder: false, + includeTopBorder: false, + tall: true, + title: Row( + children: [ + Expanded( + child: Text( + selectedKey.key, + style: Theme.of(context).textTheme.titleSmall, + ), + ), + if (data.editing) ...[ + TextButton( + onPressed: () => notifier.stopEditing(), + child: const Text('Cancel'), + ), + if (currentValue case final String currentValue? + when currentValue != value.data.valueAsString && + (value.data is SharedPreferencesDataString || + currentValue.isNotEmpty)) ...[ + const SizedBox(width: defaultSpacing), + TextButton( + onPressed: () async { + try { + await notifier.changeValue( + selectedKey.key, + value.data.changeValue(currentValue), + ); + } catch (error) { + _showSnackBar('Error: $error'); + } + }, + child: const Text('Commit changes'), + ), + ], + ] else ...[ + TextButton( + onPressed: () => showDialog( + context: context, + builder: (BuildContext context) { + return DevToolsDialog( + title: const Text('Remove Key'), + content: Text( + 'Are you sure you want to remove ${selectedKey.key}?', + ), + actions: [ + const DialogCancelButton(), + DialogTextButton( + child: const Text('REMOVE'), + onPressed: () async { + try { + await notifier.deleteKey(selectedKey); + } catch (error) { + _showSnackBar('Error: $error'); + } + _dismissDialog(); + }, + ), + ], + ); + }, + ), + child: const Text('Remove'), + ), + TextButton( + onPressed: () => notifier.startEditing(), + child: const Text('Edit'), + ), + ], + ], + ), + ), + Expanded( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(largeSpacing), + child: SelectionArea( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text('Type: ${value.data.prettyType}'), + const SizedBox(height: denseSpacing), + if (data.editing) ...[ + const Text('Value:'), + const SizedBox(height: denseSpacing), + switch (value.data) { + final SharedPreferencesDataBool state => + DropdownMenu( + initialSelection: state.value, + onSelected: (bool? value) { + _setCurrentValue(value.toString()); + }, + dropdownMenuEntries: const >[ + DropdownMenuEntry( + label: 'true', + value: true, + ), + DropdownMenuEntry( + label: 'false', + value: false, + ), + ], + ), + final SharedPreferencesDataStringList state => + _EditStringList( + selectedKey: selectedKey.key, + initialData: state.value, + onChanged: _setCurrentValue, + ), + _ => TextFormField( + autofocus: true, + initialValue: value.data.valueAsString, + inputFormatters: switch (value.data) { + SharedPreferencesDataInt() => + [ + FilteringTextInputFormatter.allow( + RegExp(r'^-?\d*'), + ), + ], + SharedPreferencesDataDouble() => + [ + FilteringTextInputFormatter.allow( + RegExp(r'^-?\d*\.?\d*'), + ), + ], + _ => [], + }, + onChanged: _setCurrentValue, + ) + }, + ] else ...[ + Text('Value: ${value.data.valueAsString}'), + ], + ], + ), + ), + ), + ), + ), + ], + ), + }, + ); + } +} + +class _EditStringList extends StatefulWidget { + const _EditStringList({ + required this.selectedKey, + required this.initialData, + required this.onChanged, + }); + + final String selectedKey; + final List initialData; + final ValueChanged onChanged; + + @override + State<_EditStringList> createState() => _EditStringListState(); +} + +class _EditStringListState extends State<_EditStringList> { + late final List<(int key, String value)> _currentList; + int _keyCounter = 0; + + void _addElementAt(int index) { + setState(() { + _currentList.insert(index, (_keyCounter++, '')); + }); + } + + @override + void initState() { + super.initState(); + _currentList = <(int, String)>[ + for (final String str in widget.initialData) (_keyCounter++, str), + ]; + } + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + for (final (int index, (int keyValue, String str)) + in _currentList.indexed) ...[ + _AddListElement( + onPressed: () => _addElementAt(index), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: densePadding), + child: Row( + children: [ + Expanded( + child: TextFormField( + key: Key('list_element_$keyValue'), + initialValue: str, + onChanged: (String value) { + setState(() { + _currentList[index] = (keyValue, value); + }); + widget.onChanged(jsonEncode( + [ + for (final (_, String value) in _currentList) value, + ], + )); + }, + ), + ), + IconButton( + icon: const Icon( + Icons.remove, + size: 16, + ), + onPressed: () { + setState(() { + _currentList.removeAt(index); + }); + }, + ) + ], + ), + ), + ], + _AddListElement( + onPressed: () => _addElementAt(_currentList.length), + ), + ], + ); + } +} + +class _AddListElement extends StatelessWidget { + const _AddListElement({ + required this.onPressed, + }); + + final VoidCallback onPressed; + + @override + Widget build(BuildContext context) { + return Center( + child: IconButton( + icon: const Icon( + Icons.add, + size: 16, + ), + onPressed: onPressed, + ), + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/ui/error_panel.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/error_panel.dart new file mode 100644 index 000000000000..29da7559ea9e --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/error_panel.dart @@ -0,0 +1,23 @@ +import 'package:devtools_app_shared/ui.dart'; +import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; + +@internal +class ErrorPanel extends StatelessWidget { + const ErrorPanel({ + super.key, + required this.error, + required this.stackTrace, + }); + + final Object error; + final StackTrace? stackTrace; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(densePadding), + child: Text('Error:\n$error\n\n$stackTrace'), + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/ui/keys_panel.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/keys_panel.dart new file mode 100644 index 000000000000..7a8db4c1fa43 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/keys_panel.dart @@ -0,0 +1,230 @@ +import 'package:devtools_app_shared/ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; + +import '../async_state.dart'; +import '../shared_preferences_state.dart'; +import '../shared_preferences_state_notifier.dart'; +import '../shared_preferences_state_notifier_provider.dart'; +import 'error_panel.dart'; + +@internal +class KeysPanel extends StatefulWidget { + const KeysPanel({super.key}); + + @override + State createState() => KeysPanelState(); +} + +@internal +class KeysPanelState extends State { + bool searching = false; + final FocusNode searchFocusNode = FocusNode(); + + @override + void dispose() { + searchFocusNode.dispose(); + super.dispose(); + } + + void _startSearching() { + setState(() { + searching = true; + }); + } + + @override + Widget build(BuildContext context) { + final SharedPreferencesStateNotifier notifier = + SharedPreferencesStateNotifierProvider.of(context); + + void stopSearching() { + setState(() { + searching = false; + }); + notifier.filter(''); + } + + return RoundedOutlinedBorder( + clip: true, + child: Column( + children: [ + AreaPaneHeader( + roundedTopBorder: false, + includeTopBorder: false, + tall: true, + title: Row( + children: [ + Text( + 'Stored Keys', + style: Theme.of(context).textTheme.titleSmall, + ), + if (searching) ...[ + const SizedBox( + width: denseSpacing, + ), + Expanded( + child: KeyboardListener( + focusNode: searchFocusNode, + onKeyEvent: (KeyEvent value) { + if (value.logicalKey == LogicalKeyboardKey.escape) { + stopSearching(); + } + }, + child: TextField( + autofocus: true, + decoration: InputDecoration( + contentPadding: const EdgeInsets.symmetric( + horizontal: densePadding, + ), + hintText: 'Search', + border: const OutlineInputBorder(), + suffix: Tooltip( + message: 'Stop searching', + child: IconButton( + icon: const Icon( + Icons.close, + size: 16, + ), + onPressed: stopSearching, + ), + ), + ), + onChanged: notifier.filter, + ), + ), + ), + const SizedBox( + width: denseSpacing, + ), + ] else ...[ + const Spacer(), + Tooltip( + message: 'Search', + child: IconButton( + icon: const Icon( + Icons.search, + size: 16, + ), + onPressed: _startSearching, + ), + ), + ], + Tooltip( + message: 'Refresh', + child: IconButton( + icon: const Icon( + Icons.refresh, + size: 16, + ), + onPressed: () { + stopSearching(); + notifier.fetchAllKeys(); + }, + ), + ), + ], + ), + ), + const Expanded( + child: _StateMapper(), + ), + ], + ), + ); + } +} + +class _StateMapper extends StatelessWidget { + const _StateMapper(); + + @override + Widget build(BuildContext context) { + return switch (SharedPreferencesStateNotifierProvider.of(context).value) { + final AsyncStateData value => _KeysList( + keys: value.data.allKeys, + ), + final AsyncStateError value => ErrorPanel( + error: value.error, + stackTrace: value.stackTrace, + ), + AsyncStateLoading() => const Center( + child: CircularProgressIndicator(), + ), + }; + } +} + +class _KeysList extends StatefulWidget { + const _KeysList({ + required this.keys, + }); + + final List keys; + + @override + State<_KeysList> createState() => _KeysListState(); +} + +class _KeysListState extends State<_KeysList> { + final ScrollController scrollController = ScrollController(); + + @override + void dispose() { + scrollController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scrollbar( + controller: scrollController, + child: ListView.builder( + controller: scrollController, + itemCount: widget.keys.length, + itemBuilder: (BuildContext context, int index) => _KeyItem( + keyName: widget.keys[index], + ), + ), + ); + } +} + +class _KeyItem extends StatelessWidget { + const _KeyItem({ + required this.keyName, + }); + + final String keyName; + + @override + Widget build(BuildContext context) { + final SharedPreferencesStateNotifier notifier = + SharedPreferencesStateNotifierProvider.of(context); + final bool isSelected = + notifier.value.dataOrNull?.selectedKey?.key == keyName; + final ColorScheme colorScheme = Theme.of(context).colorScheme; + final Color? backgroundColor = + isSelected ? colorScheme.selectedRowBackgroundColor : null; + + return InkWell( + onTap: () { + notifier.selectKey(keyName); + }, + child: Container( + color: backgroundColor, + padding: const EdgeInsets.only( + left: defaultSpacing, + right: densePadding, + top: densePadding, + bottom: densePadding, + ), + child: Text( + keyName, + style: Theme.of(context).textTheme.titleSmall, + ), + ), + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/lib/src/ui/shared_preferences_body.dart b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/shared_preferences_body.dart new file mode 100644 index 000000000000..22b72fe3e828 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/lib/src/ui/shared_preferences_body.dart @@ -0,0 +1,25 @@ +import 'package:devtools_app_shared/ui.dart'; +import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; + +import 'data_panel.dart'; +import 'keys_panel.dart'; + +@internal +class SharedPreferencesBody extends StatelessWidget { + const SharedPreferencesBody({super.key}); + + @override + Widget build(BuildContext context) { + final Axis splitAxis = SplitPane.axisFor(context, 0.85); + + return SplitPane( + axis: splitAxis, + initialFractions: const [0.33, 0.67], + children: const [ + KeysPanel(), + DataPanel(), + ], + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_tools/pubspec.yaml b/packages/shared_preferences/shared_preferences_tools/pubspec.yaml new file mode 100644 index 000000000000..4c90b9c3ef17 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/pubspec.yaml @@ -0,0 +1,25 @@ +name: shared_preferences_tools +description: "DevTools extension for Flutter: Manage SharedPreferences efficiently. Edit, search, and view keys." +publish_to: 'none' + +version: 1.0.0+1 + +environment: + sdk: '>=3.4.0-282.1.beta <4.0.0' + +dependencies: + devtools_app_shared: ^0.1.1 + devtools_extensions: ^0.1.1 + flutter: + sdk: flutter + meta: ^1.12.0 + vm_service: ^14.2.1 + +dev_dependencies: + build_runner: ^2.4.9 + flutter_test: + sdk: flutter + mockito: ^5.4.4 + +flutter: + uses-material-design: true diff --git a/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_notifier_test.dart b/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_notifier_test.dart new file mode 100644 index 000000000000..b1a9ad59b889 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_notifier_test.dart @@ -0,0 +1,184 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:shared_preferences_tools/src/async_state.dart'; +import 'package:shared_preferences_tools/src/shared_preferences_state.dart'; +import 'package:shared_preferences_tools/src/shared_preferences_state_notifier.dart'; +import 'package:shared_preferences_tools/src/shared_preferences_tools_eval.dart'; + +@GenerateNiceMocks(>[MockSpec()]) +import 'shared_preferences_state_notifier_test.mocks.dart'; + +void main() { + group('SharedPreferencesStateNotifier', () { + late MockSharedPreferencesToolsEval evalMock; + late SharedPreferencesStateNotifier notifier; + + setUpAll(() { + provideDummy(const SharedPreferencesData.int(value: 42)); + }); + + setUp(() { + evalMock = MockSharedPreferencesToolsEval(); + notifier = SharedPreferencesStateNotifier(evalMock); + }); + + test('should start in the loading state', () { + expect( + notifier.value, + equals(const AsyncState.loading()), + ); + }); + + test('should fetch all keys', () async { + const List keys = ['key1', 'key2']; + when(evalMock.fetchAllKeys()).thenAnswer((_) async => keys); + + await notifier.fetchAllKeys(); + + expect( + notifier.value, + equals( + const AsyncState.data( + SharedPreferencesState( + allKeys: keys, + selectedKey: null, + ), + ), + ), + ); + }); + + test('should select key', () async { + const List keys = ['key1', 'key2']; + const SharedPreferencesData keyValue = + SharedPreferencesData.string(value: 'value'); + when(evalMock.fetchAllKeys()).thenAnswer((_) async => keys); + when(evalMock.fetchValue('key1')).thenAnswer((_) async => keyValue); + await notifier.fetchAllKeys(); + + await notifier.selectKey('key1'); + + expect( + notifier.value, + equals( + const AsyncState.data( + SharedPreferencesState( + allKeys: keys, + selectedKey: SelectedSharedPreferencesKey( + key: 'key1', + value: AsyncState.data(keyValue), + ), + ), + ), + ), + ); + }); + + test('should filter keys and clear filter', () async { + const List keys = ['key1', 'key2']; + when(evalMock.fetchAllKeys()).thenAnswer((_) async => keys); + await notifier.fetchAllKeys(); + + notifier.filter('key1'); + + expect( + notifier.value, + equals( + const AsyncState.data( + SharedPreferencesState( + allKeys: ['key1'], + selectedKey: null, + ), + ), + ), + ); + + notifier.filter(''); + + expect( + notifier.value, + equals( + const AsyncState.data( + SharedPreferencesState( + allKeys: keys, + selectedKey: null, + ), + ), + ), + ); + }); + + test('should start/stop editing', () async { + const List keys = ['key1', 'key2']; + when(evalMock.fetchAllKeys()).thenAnswer((_) async => keys); + await notifier.fetchAllKeys(); + notifier.startEditing(); + + expect( + notifier.value, + equals( + const AsyncState.data( + SharedPreferencesState( + allKeys: keys, + selectedKey: null, + editing: true, + ), + ), + ), + ); + + notifier.stopEditing(); + + expect( + notifier.value, + equals( + const AsyncState.data( + SharedPreferencesState( + allKeys: keys, + selectedKey: null, + // ignore: avoid_redundant_argument_values + editing: false, + ), + ), + ), + ); + }); + + test('should change value', () async { + const List keys = ['key1', 'key2']; + const SharedPreferencesData keyValue = + SharedPreferencesData.string(value: 'value'); + when(evalMock.fetchAllKeys()).thenAnswer((_) async => keys); + when(evalMock.fetchValue('key1')).thenAnswer((_) async => keyValue); + await notifier.fetchAllKeys(); + await notifier.selectKey('key1'); + + await notifier.deleteKey(notifier.value.dataOrNull!.selectedKey!); + + verify(evalMock.deleteKey('key1')).called(1); + }); + + test('should change value', () async { + const List keys = ['key1', 'key2']; + const SharedPreferencesData keyValue = + SharedPreferencesData.string(value: 'value'); + when(evalMock.fetchAllKeys()).thenAnswer((_) async => keys); + when(evalMock.fetchValue('key1')).thenAnswer((_) async => keyValue); + await notifier.fetchAllKeys(); + await notifier.selectKey('key1'); + + await notifier.changeValue( + 'key1', + const SharedPreferencesData.string(value: 'newValue'), + ); + + verify( + evalMock.changeValue( + 'key1', + const SharedPreferencesData.string(value: 'newValue'), + ), + ).called(1); + }); + }); +} diff --git a/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_notifier_test.mocks.dart b/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_notifier_test.mocks.dart new file mode 100644 index 000000000000..549556ae2df0 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_notifier_test.mocks.dart @@ -0,0 +1,103 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in shared_preferences_tools/test/src/shared_preferences_state_notifier_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i5; +import 'package:shared_preferences_tools/src/shared_preferences_state.dart' + as _i4; +import 'package:shared_preferences_tools/src/shared_preferences_tools_eval.dart' + as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +/// A class which mocks [SharedPreferencesToolsEval]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSharedPreferencesToolsEval extends _i1.Mock + implements _i2.SharedPreferencesToolsEval { + @override + _i3.Future> fetchAllKeys() => (super.noSuchMethod( + Invocation.method( + #fetchAllKeys, + [], + ), + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value([]), + ) as _i3.Future>); + + @override + _i3.Future<_i4.SharedPreferencesData> fetchValue(String? key) => + (super.noSuchMethod( + Invocation.method( + #fetchValue, + [key], + ), + returnValue: _i3.Future<_i4.SharedPreferencesData>.value( + _i5.dummyValue<_i4.SharedPreferencesData>( + this, + Invocation.method( + #fetchValue, + [key], + ), + )), + returnValueForMissingStub: _i3.Future<_i4.SharedPreferencesData>.value( + _i5.dummyValue<_i4.SharedPreferencesData>( + this, + Invocation.method( + #fetchValue, + [key], + ), + )), + ) as _i3.Future<_i4.SharedPreferencesData>); + + @override + _i3.Future changeValue( + String? key, + _i4.SharedPreferencesData? value, + ) => + (super.noSuchMethod( + Invocation.method( + #changeValue, + [ + key, + value, + ], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future deleteKey(String? key) => (super.noSuchMethod( + Invocation.method( + #deleteKey, + [key], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); +} diff --git a/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_test.dart b/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_test.dart new file mode 100644 index 000000000000..148985f39484 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/test/src/shared_preferences_state_test.dart @@ -0,0 +1,109 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_preferences_tools/src/shared_preferences_state.dart'; + +void main() { + group('SharedPreferencesData', () { + test('value as string should return formatted value', () { + const SharedPreferencesData stringData = + SharedPreferencesData.string(value: 'value'); + expect(stringData.valueAsString, 'value'); + + const SharedPreferencesData intData = SharedPreferencesData.int(value: 1); + expect(intData.valueAsString, '1'); + + const SharedPreferencesData doubleData = + SharedPreferencesData.double(value: 1.0); + expect(doubleData.valueAsString, '1.0'); + + const SharedPreferencesData boolData = + SharedPreferencesData.bool(value: true); + expect(boolData.valueAsString, 'true'); + + const SharedPreferencesData stringListData = + SharedPreferencesData.stringList(value: ['value1', 'value2']); + expect(stringListData.valueAsString, '\n0 -> value1\n1 -> value2'); + }); + }); + + test('should return pretty type', () { + const SharedPreferencesData stringData = + SharedPreferencesData.string(value: 'value'); + expect(stringData.prettyType, 'String'); + + const SharedPreferencesData intData = SharedPreferencesData.int(value: 1); + expect(intData.prettyType, 'int'); + + const SharedPreferencesData doubleData = + SharedPreferencesData.double(value: 1.0); + expect(doubleData.prettyType, 'double'); + + const SharedPreferencesData boolData = + SharedPreferencesData.bool(value: true); + expect(boolData.prettyType, 'bool'); + + const SharedPreferencesData stringListData = + SharedPreferencesData.stringList(value: ['value1', 'value2']); + expect(stringListData.prettyType, 'List'); + }); + + test('should change value', () { + const SharedPreferencesData stringData = + SharedPreferencesData.string(value: 'value'); + const String newStringValue = 'newValue'; + expect( + stringData.changeValue(newStringValue), + isA().having( + (SharedPreferencesDataString data) => data.value, + 'value', + equals(newStringValue), + ), + ); + + const SharedPreferencesData intData = SharedPreferencesData.int(value: 1); + const String newIntValue = '2'; + expect( + intData.changeValue(newIntValue), + isA().having( + (SharedPreferencesDataInt data) => data.value, + 'value', + equals(int.parse(newIntValue)), + ), + ); + + const SharedPreferencesData doubleData = + SharedPreferencesData.double(value: 1.0); + const String newDoubleValue = '2.0'; + expect( + doubleData.changeValue(newDoubleValue), + isA().having( + (SharedPreferencesDataDouble data) => data.value, + 'value', + equals(double.parse(newDoubleValue)), + ), + ); + + const SharedPreferencesData boolData = + SharedPreferencesData.bool(value: true); + const String newBoolValue = 'false'; + expect( + boolData.changeValue(newBoolValue), + isA().having( + (SharedPreferencesDataBool data) => data.value, + 'value', + equals(false), + ), + ); + + const SharedPreferencesData stringListData = + SharedPreferencesData.stringList(value: ['value1', 'value2']); + const String newStringListValue = '["newValue1", "newValue2"]'; + expect( + stringListData.changeValue(newStringListValue), + isA().having( + (SharedPreferencesDataStringList data) => data.value, + 'value', + equals(['newValue1', 'newValue2']), + ), + ); + }); +} diff --git a/packages/shared_preferences/shared_preferences_tools/web/favicon.png b/packages/shared_preferences/shared_preferences_tools/web/favicon.png new file mode 100644 index 000000000000..8aaa46ac1ae2 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/web/favicon.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-192.png b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-192.png new file mode 100644 index 000000000000..b749bfef0747 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-192.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-512.png b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-512.png new file mode 100644 index 000000000000..88cfd48dff11 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-512.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-maskable-192.png b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-maskable-192.png new file mode 100644 index 000000000000..eb9b4d76e525 Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-maskable-192.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-maskable-512.png b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-maskable-512.png new file mode 100644 index 000000000000..d69c56691fbd Binary files /dev/null and b/packages/shared_preferences/shared_preferences_tools/web/icons/Icon-maskable-512.png differ diff --git a/packages/shared_preferences/shared_preferences_tools/web/index.html b/packages/shared_preferences/shared_preferences_tools/web/index.html new file mode 100644 index 000000000000..2f41d02d2e8f --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/web/index.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + shared_preferences_tools + + + + + + + + + + diff --git a/packages/shared_preferences/shared_preferences_tools/web/manifest.json b/packages/shared_preferences/shared_preferences_tools/web/manifest.json new file mode 100644 index 000000000000..7b00546c087d --- /dev/null +++ b/packages/shared_preferences/shared_preferences_tools/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "shared_preferences_tools", + "short_name": "shared_preferences_tools", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +}