Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3f70536

Browse files
committed
it works
1 parent 0069f47 commit 3f70536

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

shell/platform/darwin/ios/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ source_set("flutter_framework_source") {
6666
"framework/Source/FlutterPlatformViews_Internal.h",
6767
"framework/Source/FlutterPlatformViews_Internal.mm",
6868
"framework/Source/FlutterPluginAppLifeCycleDelegate.mm",
69+
"framework/Source/FlutterRestorationPlugin.h",
70+
"framework/Source/FlutterRestorationPlugin.mm",
6971
"framework/Source/FlutterTextInputDelegate.h",
7072
"framework/Source/FlutterTextInputPlugin.h",
7173
"framework/Source/FlutterTextInputPlugin.mm",

shell/platform/darwin/ios/framework/Source/FlutterRestorationPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
- (instancetype)init NS_UNAVAILABLE;
1616
+ (instancetype)new NS_UNAVAILABLE;
17-
- (instancetype)initWithChannel:(fml::WeakPtr<FlutterMethodChannel>)channel restorationEnabled:(BOOL)waitForData NS_DESIGNATED_INITIALIZER;
17+
- (instancetype)initWithChannel:(FlutterMethodChannel*)channel restorationEnabled:(BOOL)waitForData NS_DESIGNATED_INITIALIZER;
1818

1919
- (NSData*)restorationData;
2020
- (void)restorationData:(NSData *)data;

shell/platform/darwin/ios/framework/Source/FlutterRestorationPlugin.mm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@ @implementation FlutterRestorationPlugin {
1818
}
1919

2020
- (instancetype)init {
21-
@throw([NSException exceptionWithName:@"FlutterRestorationPlugin must initWithEngine"
21+
@throw([NSException exceptionWithName:@"FlutterRestorationPlugin must initWithChannel:restorationEnabled:"
2222
reason:nil
2323
userInfo:nil]);
24-
/Users/goderbauer/dev/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterRestorationPlugin.h
2524
}
2625

27-
- (instancetype)initWithChannel:(fml::WeakPtr<FlutterMethodChannel>)channel restorationEnabled:(BOOL)restorationEnabled {
26+
- (instancetype)initWithChannel:(FlutterMethodChannel*)channel restorationEnabled:(BOOL)restorationEnabled {
2827
FML_DCHECK(channel) << "channel must be set";
2928
self = [super init];
3029
if (self) {
31-
[channel.get() setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {
30+
[channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {
3231
[self handleMethodCall:call result:result];
3332
}];
3433
_restorationEnabled = restorationEnabled;
@@ -57,7 +56,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
5756
}
5857
}
5958

60-
_ (NSData*)restorationData {
59+
- (NSData*)restorationData {
6160
return _restorationData;
6261
}
6362

shell/platform/darwin/ios/framework/Source/FlutterViewController.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,14 +1438,14 @@ - (BOOL)isPresentingViewController {
14381438
#pragma mark - State Restoration
14391439

14401440
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder {
1441-
NSLog(@"FlutterViewController: encodeRestorableStateWithCoder");
14421441
NSData* restorationData = [[_engine.get() restorationPlugin] restorationData];
1442+
NSLog(@"FlutterViewController: encodeRestorableStateWithCoder %@", restorationData);
14431443
[coder encodeDataObject:restorationData];
14441444
}
14451445

14461446
- (void)decodeRestorableStateWithCoder:(NSCoder *)coder {
1447-
NSLog(@"FlutterViewController: decodeRestorableStateWithCoder");
14481447
NSData* restorationData = [coder decodeDataObject];
1448+
NSLog(@"FlutterViewController: decodeRestorableStateWithCoder %@", restorationData);
14491449
[[_engine.get() restorationPlugin] restorationData:restorationData];
14501450
}
14511451

0 commit comments

Comments
 (0)