Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
flutter_boost_1.22.4
Commits
02a8a0a2
Commit
02a8a0a2
authored
Mar 21, 2020
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决bug:
https://github.com/flutter/flutter/issues/52455
parent
8a8f9f35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
18 deletions
+28
-18
ios/Classes/container/FLBFlutterViewContainer.m
ios/Classes/container/FLBFlutterViewContainer.m
+28
-18
No files found.
ios/Classes/container/FLBFlutterViewContainer.m
View file @
02a8a0a2
...
...
@@ -36,7 +36,8 @@
@interface
FlutterViewController
(
bridgeToviewDidDisappear
)
-
(
void
)
flushOngoingTouches
;
-
(
void
)
override_viewDidDisappear
:(
BOOL
)
animated
;
-
(
void
)
bridge_viewDidDisappear
:(
BOOL
)
animated
;
-
(
void
)
bridge_viewWillAppear
:(
BOOL
)
animated
;
@end
#pragma clang diagnostic push
...
...
@@ -48,7 +49,20 @@
[
super
viewDidDisappear
:
animated
];
}
-
(
void
)
bridge_viewWillAppear
:(
BOOL
)
animated
{
// TRACE_EVENT0("flutter", "viewWillAppear");
// if (_engineNeedsLaunch) {
// [_engine.get() launchEngine:nil libraryURI:nil];
// [_engine.get() setViewController:self];
// _engineNeedsLaunch = NO;
// }
[
FLUTTER_APP
inactive
];
[
super
viewWillAppear
:
animated
];
}
@end
#pragma pop
@interface
FLBFlutterViewContainer
()
@property
(
nonatomic
,
strong
,
readwrite
)
NSDictionary
*
params
;
...
...
@@ -75,6 +89,13 @@
return
self
;
}
-
(
instancetype
)
initWithProject
:(
FlutterDartProject
*
)
projectOrNil
nibName
:(
NSString
*
)
nibNameOrNil
bundle
:(
NSBundle
*
)
nibBundleOrNil
{
NSAssert
(
NO
,
@"unsupported init method!"
);
return
nil
;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
-
(
instancetype
)
initWithCoder
:(
NSCoder
*
)
aDecoder
{
...
...
@@ -190,6 +211,8 @@ static NSUInteger kInstanceCounter = 0;
//For new page we should attach flutter view in view will appear
//for better performance.
[
self
attatchFlutterEngine
];
[
BoostMessageChannel
willShowPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
...
...
@@ -200,8 +223,8 @@ static NSUInteger kInstanceCounter = 0;
[
FlutterBoostPlugin
sharedInstance
].
fParams
=
_params
;
[
self
attatchFlutterEngine
];
[
super
viewWillAppear
:
animated
];
[
super
bridge_
viewWillAppear
:
animated
];
[
self
.
view
setNeedsLayout
];
//TODO:通过param来设定
}
...
...
@@ -216,6 +239,8 @@ static NSUInteger kInstanceCounter = 0;
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
//NOTES:务必在show之后再update,否则有闪烁; 或导致侧滑返回时上一个页面会和top页面内容一样
[
self
surfaceUpdated
:
YES
];
[
super
viewDidAppear
:
animated
];
}
...
...
@@ -228,13 +253,6 @@ static NSUInteger kInstanceCounter = 0;
uniqueId:
self
.
uniqueIDString
];
[[[
UIApplication
sharedApplication
]
keyWindow
]
endEditing
:
YES
];
[
super
viewWillDisappear
:
animated
];
//NOTES:因为UIViewController在present view后dismiss其页面的view disappear会发生在下一个页面view appear之后,从而让当前engine持有的vc inactive,此处可驱使其重新resume
if
(
!
[
self
.
uniqueIDString
isEqualToString
:[(
FLBFlutterViewContainer
*
)
FLUTTER_VC
uniqueIDString
]])
{
[
FLUTTER_APP
resume
];
}
}
...
...
@@ -244,14 +262,6 @@ static NSUInteger kInstanceCounter = 0;
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
//NOTES:因为UIViewController在present view后dismiss其页面的view disappear会发生在下一个页面view appear之后,导致当前engine持有的VC被surfaceUpdate(NO),从而销毁底层的raster。此处是考虑到这种情形,重建surface
if
(
FLUTTER_VC
.
beingPresented
||
self
.
beingDismissed
/*|| ![self.uniqueIDString isEqualToString:[(FLBFlutterViewContainer*)FLUTTER_VC uniqueIDString]]*/
)
{
[
FLUTTER_APP
resume
];
[(
FLBFlutterViewContainer
*
)
FLUTTER_VC
surfaceUpdated
:
YES
];
}
[
self
bridge_viewDidDisappear
:
animated
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment