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
7173964f
Commit
7173964f
authored
Jan 17, 2020
by
卢克
Committed by
GitHub
Jan 17, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #578 from xujim/flutter_1.5_upgrade_opt
精简代码,避免过多的surfaceUpdate,原因:
parents
b0aa14f9
208afc9e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
21 deletions
+13
-21
ios/Classes/1.5/FLB2FlutterEngine.m
ios/Classes/1.5/FLB2FlutterEngine.m
+11
-7
ios/Classes/1.5/FLB2FlutterViewContainer.m
ios/Classes/1.5/FLB2FlutterViewContainer.m
+2
-14
No files found.
ios/Classes/1.5/FLB2FlutterEngine.m
View file @
7173964f
...
...
@@ -49,10 +49,11 @@
}
else
{
[
_engine
runWithEntrypoint
:
nil
];
}
_dummy
=
[[
FLB2FlutterViewContainer
alloc
]
initWithEngine
:
_engine
nibName:
nil
bundle:
nil
];
_dummy
.
name
=
kIgnoreMessageWithName
;
_dummy
=
nil
;
// _dummy = [[FLB2FlutterViewContainer alloc] initWithEngine:_engine
// nibName:nil
// bundle:nil];
// _dummy.name = kIgnoreMessageWithName;
Class
clazz
=
NSClassFromString
(
@"GeneratedPluginRegistrant"
);
if
(
clazz
)
{
...
...
@@ -81,7 +82,7 @@
-
(
void
)
resume
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.resumed"
];
[(
FLB2FlutterViewContainer
*
)
_engine
.
viewController
surfaceUpdated
:
YES
];
//
[(FLB2FlutterViewContainer *)_engine.viewController surfaceUpdated:YES];
}
-
(
void
)
inactive
...
...
@@ -126,9 +127,12 @@
// if ([_dummy respondsToSelector:@selector(setEnableForRunnersBatch:)]) {
// [_dummy setEnableForRunnersBatch:YES];
// }
[
self
detach
];
[
_dummy
surfaceUpdated
:
YES
];
//
[self detach];
//
[_dummy surfaceUpdated:YES];
}
-
(
void
)
dealloc
{
[
self
.
engine
setViewController
:
nil
];
}
@end
ios/Classes/1.5/FLB2FlutterViewContainer.m
View file @
7173964f
...
...
@@ -155,16 +155,6 @@ static NSUInteger kInstanceCounter = 0;
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
if
([
FLUTTER_APP
contains
:
self
]){
[
self
surfaceUpdated
:
NO
];
[
self
detatchFlutterEngine
];
}
else
{
[
self
attatchFlutterEngine
];
[
self
surfaceUpdated
:
YES
];
}
[
FLUTTER_APP
resume
];
//For new page we should attach flutter view in view will appear
//for better performance.
...
...
@@ -188,13 +178,13 @@ static NSUInteger kInstanceCounter = 0;
//Ensure flutter view is attached.
[
self
attatchFlutterEngine
];
[
FLUTTER_APP
resume
];
[
BoostMessageChannel
didShowPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
//NOTES:务必在show之后再update,否则有闪烁
[
self
surfaceUpdated
:
YES
];
[
super
viewDidAppear
:
animated
];
}
...
...
@@ -211,13 +201,11 @@ static NSUInteger kInstanceCounter = 0;
-
(
void
)
viewDidDisappear
:(
BOOL
)
animated
{
[
FLUTTER_APP
resume
];
[
BoostMessageChannel
didDisappearPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
[
super
viewDidDisappear
:
animated
];
[
FLUTTER_APP
resume
];
}
...
...
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