Skip to content

Commit f880ed8

Browse files
committed
feat: initial state restoration working
1 parent 9aa9957 commit f880ed8

File tree

27 files changed

+1978
-1845
lines changed

27 files changed

+1978
-1845
lines changed

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ linter:
2626
# - diagnostic_describe_all_properties -- DISABLED: experimental feature
2727
- empty_statements
2828
- hash_and_equals
29-
- invariant_booleans
29+
# - invariant_booleans
3030
- iterable_contains_unrelated_type
3131
- list_remove_unrelated_type
3232
- literal_only_boolean_expressions

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
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'

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ EXTERNAL SOURCES:
2323
:path: ".symlinks/plugins/reactive_ble_mobile/ios"
2424

2525
SPEC CHECKSUMS:
26-
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
26+
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
2727
Protobuf: 1a37ebea1338949e9ac35a3f06e80b3f536eec8d
2828
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
2929
SwiftProtobuf: 9c85136c6ba74b0a1b84279dbf0f6db8efb714e0
3030

31-
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
31+
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
3232

33-
COCOAPODS: 1.11.2
33+
COCOAPODS: 1.11.3

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -33,6 +33,7 @@
3333
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3434
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3535
2DC939A6C6230516B6561DA7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
36+
3AB1B41129E6FF160046DF89 /* Info-Release.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Release.plist"; sourceTree = "<group>"; };
3637
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3738
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3839
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -44,7 +45,7 @@
4445
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4546
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4647
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
47-
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
48+
97C147021CF9000F007C117D /* Info-Debug.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Debug.plist"; sourceTree = "<group>"; };
4849
A1AB08F7B02CE763EEA8E83F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4950
/* End PBXFileReference section */
5051

@@ -93,10 +94,11 @@
9394
97C146F01CF9000F007C117D /* Runner */ = {
9495
isa = PBXGroup;
9596
children = (
97+
3AB1B41129E6FF160046DF89 /* Info-Release.plist */,
9698
97C146FA1CF9000F007C117D /* Main.storyboard */,
9799
97C146FD1CF9000F007C117D /* Assets.xcassets */,
98100
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
99-
97C147021CF9000F007C117D /* Info.plist */,
101+
97C147021CF9000F007C117D /* Info-Debug.plist */,
100102
97C146F11CF9000F007C117D /* Supporting Files */,
101103
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
102104
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
@@ -161,7 +163,7 @@
161163
97C146E61CF9000F007C117D /* Project object */ = {
162164
isa = PBXProject;
163165
attributes = {
164-
LastUpgradeCheck = 1010;
166+
LastUpgradeCheck = 1300;
165167
ORGANIZATIONNAME = "The Chromium Authors";
166168
TargetAttributes = {
167169
97C146ED1CF9000F007C117D = {
@@ -207,6 +209,7 @@
207209
/* Begin PBXShellScriptBuildPhase section */
208210
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
209211
isa = PBXShellScriptBuildPhase;
212+
alwaysOutOfDate = 1;
210213
buildActionMask = 2147483647;
211214
files = (
212215
);
@@ -221,6 +224,7 @@
221224
};
222225
9740EEB61CF901F6004384FC /* Run Script */ = {
223226
isa = PBXShellScriptBuildPhase;
227+
alwaysOutOfDate = 1;
224228
buildActionMask = 2147483647;
225229
files = (
226230
);
@@ -431,8 +435,11 @@
431435
"$(inherited)",
432436
"$(PROJECT_DIR)/Flutter",
433437
);
434-
INFOPLIST_FILE = Runner/Info.plist;
435-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
438+
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
439+
LD_RUNPATH_SEARCH_PATHS = (
440+
"$(inherited)",
441+
"@executable_path/Frameworks",
442+
);
436443
LIBRARY_SEARCH_PATHS = (
437444
"$(inherited)",
438445
"$(PROJECT_DIR)/Flutter",
@@ -458,8 +465,11 @@
458465
"$(inherited)",
459466
"$(PROJECT_DIR)/Flutter",
460467
);
461-
INFOPLIST_FILE = Runner/Info.plist;
462-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
468+
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
469+
LD_RUNPATH_SEARCH_PATHS = (
470+
"$(inherited)",
471+
"@executable_path/Frameworks",
472+
);
463473
LIBRARY_SEARCH_PATHS = (
464474
"$(inherited)",
465475
"$(PROJECT_DIR)/Flutter",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1010"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<?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" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina6_12" orientation="portrait" appearance="light"/>
34
<dependencies>
45
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
68
</dependencies>
79
<scenes>
810
<!--Flutter View Controller-->
@@ -14,13 +16,14 @@
1416
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
1517
</layoutGuides>
1618
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
19+
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
1820
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2022
</view>
2123
</viewController>
2224
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2325
</objects>
26+
<point key="canvasLocation" x="-16" y="-40"/>
2427
</scene>
2528
</scenes>
2629
</document>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
7+
<key>CFBundleDevelopmentRegion</key>
8+
<string>en</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>hue_ble_lib_example</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>$(FLUTTER_BUILD_NAME)</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>$(FLUTTER_BUILD_NUMBER)</string>
25+
<key>LSRequiresIPhoneOS</key>
26+
<true/>
27+
<key>NSBluetoothAlwaysUsageDescription</key>
28+
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
29+
<key>NSBluetoothPeripheralUsageDescription</key>
30+
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
31+
<key>UIApplicationSupportsIndirectInputEvents</key>
32+
<true/>
33+
<key>UIBackgroundModes</key>
34+
<array>
35+
<string>bluetooth-central</string>
36+
</array>
37+
<key>UILaunchStoryboardName</key>
38+
<string>LaunchScreen</string>
39+
<key>UIMainStoryboardFile</key>
40+
<string>Main</string>
41+
<key>UISupportedInterfaceOrientations</key>
42+
<array>
43+
<string>UIInterfaceOrientationPortrait</string>
44+
<string>UIInterfaceOrientationLandscapeLeft</string>
45+
<string>UIInterfaceOrientationLandscapeRight</string>
46+
</array>
47+
<key>UISupportedInterfaceOrientations~ipad</key>
48+
<array>
49+
<string>UIInterfaceOrientationPortrait</string>
50+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
51+
<string>UIInterfaceOrientationLandscapeLeft</string>
52+
<string>UIInterfaceOrientationLandscapeRight</string>
53+
</array>
54+
<key>NSBonjourServices</key>
55+
<array>
56+
<string>_dartobservatory._tcp</string>
57+
</array>
58+
<key>NSLocalNetworkUsageDescription</key>
59+
<string>Allow Flutter tools to connect for hot reloads and restarts</string>
60+
<key>UIViewControllerBasedStatusBarAppearance</key>
61+
<false/>
62+
</dict>
63+
</plist>

example/ios/Runner/Info.plist renamed to example/ios/Runner/Info-Release.plist

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>en</string>
79
<key>CFBundleExecutable</key>
@@ -22,6 +24,12 @@
2224
<string>$(FLUTTER_BUILD_NUMBER)</string>
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
27+
<key>NSBluetoothAlwaysUsageDescription</key>
28+
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
29+
<key>NSBluetoothPeripheralUsageDescription</key>
30+
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
31+
<key>UIApplicationSupportsIndirectInputEvents</key>
32+
<true/>
2533
<key>UIBackgroundModes</key>
2634
<array>
2735
<string>bluetooth-central</string>
@@ -45,9 +53,5 @@
4553
</array>
4654
<key>UIViewControllerBasedStatusBarAppearance</key>
4755
<false/>
48-
<key>NSBluetoothAlwaysUsageDescription</key>
49-
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
50-
<key>NSBluetoothPeripheralUsageDescription</key>
51-
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
5256
</dict>
5357
</plist>

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const _themeColor = Colors.lightGreen;
1515
void main() {
1616
WidgetsFlutterBinding.ensureInitialized();
1717

18-
final _ble = FlutterReactiveBle();
18+
final _ble = FlutterReactiveBle.withRestorationKey('someRestorationKey');
1919
final _bleLogger = BleLogger(ble: _ble);
2020
final _scanner = BleScanner(ble: _ble, logMessage: _bleLogger.addToLog);
2121
final _monitor = BleStatusMonitor(_ble);

0 commit comments

Comments
 (0)