Skip to content

Commit 44098fe

Browse files
[shared_preferences] Switch to shared_preferences_foundation (flutter#6940)
* [shared_preferences] Switch to `shared_preferences_foundation` Switches to using the new combined `shared_prefences_foundation` for iOS and macOS. Part of flutter/flutter#117941 * Update build-all exclusion * not for landing - try no-op test * Revert "not for landing - try no-op test" This reverts commit bf2ad1e. * Try recreating the example app
1 parent 1226684 commit 44098fe

File tree

16 files changed

+216
-169
lines changed

16 files changed

+216
-169
lines changed

packages/shared_preferences/shared_preferences/CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## NEXT
1+
## 2.0.16
22

3+
* Switches to the new `shared_preferences_foundation` implementation package
4+
for iOS and macOS.
35
* Updates code for `no_leading_underscores_for_local_identifiers` lint.
46
* Updates minimum Flutter version to 2.10.
57

packages/shared_preferences/shared_preferences/example/ios/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/dgph
12
*.mode1v3
23
*.mode2v3
34
*.moved-aside
@@ -18,6 +19,7 @@ Flutter/App.framework
1819
Flutter/Flutter.framework
1920
Flutter/Flutter.podspec
2021
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
2123
Flutter/app.flx
2224
Flutter/app.zip
2325
Flutter/flutter_assets/

packages/shared_preferences/shared_preferences/example/ios/Flutter/AppFrameworkInfo.plist

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>UIRequiredDeviceCapabilities</key>
24-
<array>
25-
<string>arm64</string>
26-
</array>
2723
<key>MinimumOSVersion</key>
28-
<string>9.0</string>
24+
<string>11.0</string>
2925
</dict>
3026
</plist>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
22
#include "Generated.xcconfig"
3-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
22
#include "Generated.xcconfig"
3-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"

packages/shared_preferences/shared_preferences/example/ios/Podfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -28,6 +28,9 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2828
flutter_ios_podfile_setup
2929

3030
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
3134
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3235
end
3336

packages/shared_preferences/shared_preferences/example/ios/Runner.xcodeproj/project.pbxproj

+168-85
Large diffs are not rendered by default.

packages/shared_preferences/shared_preferences/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1100"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -37,16 +37,6 @@
3737
</BuildableReference>
3838
</MacroExpansion>
3939
<Testables>
40-
<TestableReference
41-
skipped = "NO">
42-
<BuildableReference
43-
BuildableIdentifier = "primary"
44-
BlueprintIdentifier = "F76AC2052669B6AE0040C8BC"
45-
BuildableName = "RunnerTests.xctest"
46-
BlueprintName = "RunnerTests"
47-
ReferencedContainer = "container:Runner.xcodeproj">
48-
</BuildableReference>
49-
</TestableReference>
5040
</Testables>
5141
</TestAction>
5242
<LaunchAction
@@ -71,7 +61,7 @@
7161
</BuildableProductRunnable>
7262
</LaunchAction>
7363
<ProfileAction
74-
buildConfiguration = "Release"
64+
buildConfiguration = "Profile"
7565
shouldUseLaunchSchemeArgsEnv = "YES"
7666
savedToolIdentifier = ""
7767
useCustomWorkingDirectory = "NO"

packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.h

-10
This file was deleted.

packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.m

-16
This file was deleted.

packages/shared_preferences/shared_preferences/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@
107107
"idiom" : "ipad",
108108
"filename" : "[email protected]",
109109
"scale" : "2x"
110+
},
111+
{
112+
"size" : "1024x1024",
113+
"idiom" : "ios-marketing",
114+
"filename" : "[email protected]",
115+
"scale" : "1x"
110116
}
111117
],
112118
"info" : {
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
66
</dependencies>
77
<scenes>
88
<!--View Controller-->
99
<scene sceneID="EHf-IW-A2E">
1010
<objects>
1111
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
1212
<layoutGuides>
13-
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14-
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
13+
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
14+
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
1515
</layoutGuides>
1616
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1817
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
18+
<subviews>
19+
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
20+
</imageView>
21+
</subviews>
22+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
23+
<constraints>
24+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
25+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
26+
</constraints>
2027
</view>
2128
</viewController>
2229
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
2330
</objects>
2431
<point key="canvasLocation" x="53" y="375"/>
2532
</scene>
2633
</scenes>
34+
<resources>
35+
<image name="LaunchImage" width="168" height="185"/>
36+
</resources>
2737
</document>

packages/shared_preferences/shared_preferences/example/ios/Runner/Info.plist

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,31 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>Example</string>
79
<key>CFBundleExecutable</key>
810
<string>$(EXECUTABLE_NAME)</string>
911
<key>CFBundleIdentifier</key>
1012
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1113
<key>CFBundleInfoDictionaryVersion</key>
1214
<string>6.0</string>
1315
<key>CFBundleName</key>
14-
<string>shared_preferences_example</string>
16+
<string>example</string>
1517
<key>CFBundlePackageType</key>
1618
<string>APPL</string>
1719
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
20+
<string>$(FLUTTER_BUILD_NAME)</string>
1921
<key>CFBundleSignature</key>
2022
<string>????</string>
2123
<key>CFBundleVersion</key>
22-
<string>1</string>
24+
<string>$(FLUTTER_BUILD_NUMBER)</string>
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
2527
<key>UILaunchStoryboardName</key>
2628
<string>LaunchScreen</string>
2729
<key>UIMainStoryboardFile</key>
2830
<string>Main</string>
29-
<key>UIRequiredDeviceCapabilities</key>
30-
<array>
31-
<string>arm64</string>
32-
</array>
3331
<key>UISupportedInterfaceOrientations</key>
3432
<array>
3533
<string>UIInterfaceOrientationPortrait</string>
@@ -45,5 +43,9 @@
4543
</array>
4644
<key>UIViewControllerBasedStatusBarAppearance</key>
4745
<false/>
46+
<key>CADisableMinimumFrameDurationOnPhone</key>
47+
<true/>
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true/>
4850
</dict>
4951
</plist>

packages/shared_preferences/shared_preferences/example/ios/Runner/main.m

-13
This file was deleted.

packages/shared_preferences/shared_preferences/pubspec.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for reading and writing simple key-value pairs.
33
Wraps NSUserDefaults on iOS and SharedPreferences on Android.
44
repository: https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22
6-
version: 2.0.15
6+
version: 2.0.16
77

88
environment:
99
sdk: ">=2.14.0 <3.0.0"
@@ -15,11 +15,11 @@ flutter:
1515
android:
1616
default_package: shared_preferences_android
1717
ios:
18-
default_package: shared_preferences_ios
18+
default_package: shared_preferences_foundation
1919
linux:
2020
default_package: shared_preferences_linux
2121
macos:
22-
default_package: shared_preferences_macos
22+
default_package: shared_preferences_foundation
2323
web:
2424
default_package: shared_preferences_web
2525
windows:
@@ -29,9 +29,8 @@ dependencies:
2929
flutter:
3030
sdk: flutter
3131
shared_preferences_android: ^2.0.8
32-
shared_preferences_ios: ^2.0.8
32+
shared_preferences_foundation: ^2.1.0
3333
shared_preferences_linux: ^2.0.1
34-
shared_preferences_macos: ^2.0.0
3534
shared_preferences_platform_interface: ^2.0.0
3635
shared_preferences_web: ^2.0.0
3736
shared_preferences_windows: ^2.0.1

script/configs/exclude_all_plugins_app.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@
88

99
# This is a permament entry, as it should never be a direct app dependency.
1010
- plugin_platform_interface
11-
# Temporarily excluded to avoid runtime conflicts with
12-
# shared_preferences_macos and _ios, which are still what shared_preferences
13-
# uses. This will be removed when the switch to shared_preferences_foundation
14-
# is complete. See https://github.com/flutter/flutter/issues/117941
15-
- shared_preferences_foundation

0 commit comments

Comments
 (0)