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
b4045960
Commit
b4045960
authored
Jun 15, 2020
by
justin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge from v1.12.13-hotfixes
parent
64f35f92
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
49 deletions
+71
-49
CHANGELOG.md
CHANGELOG.md
+3
-0
README.md
README.md
+3
-1
README_CN.md
README_CN.md
+3
-1
ios/Classes/Engine/FLBFlutterEngine.m
ios/Classes/Engine/FLBFlutterEngine.m
+5
-8
ios/Classes/container/FLBFlutterViewContainer.m
ios/Classes/container/FLBFlutterViewContainer.m
+18
-2
lib/container/container_coordinator.dart
lib/container/container_coordinator.dart
+21
-11
lib/flutter_boost.dart
lib/flutter_boost.dart
+17
-25
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
CHANGELOG.md
View file @
b4045960
## 1.12.13+2
Fixed bugs
## 1.12.13
Supported Flutter sdk 1.12.13
...
...
README.md
View file @
b4045960
...
...
@@ -27,6 +27,7 @@ You need to add Flutter to your project before moving on.The version of the flut
| --------------------- | --------------------------- | ------------------------------------------------------------ | ------------------ |
| 1.9.1+2 | 1.9.1-hotfixes | Rename the version number and start supporting androidx by default | Yes |
| 1.12.13+1 | 1.12.13-hotfixes | supporting androidx | Yes |
| 1.12.13+2 | 1.12.13-hotfixes | supporting androidx | Yes |
...
...
@@ -36,6 +37,7 @@ You need to add Flutter to your project before moving on.The version of the flut
| --------------------- | --------------------------- | ------------------------------------------------------------ | ------------------ |
| v1.9.1-hotfixes | 1.9.1-hotfixes | for androidx | Yes |
| v1.12.13-hotfixes | 1.12.13-hotfixes | for androidx | Yes |
| v1.17.1-hotfixes | 1.17.1 | for androidx | Yes |
# Getting Started
...
...
@@ -49,7 +51,7 @@ androidx branch
flutter_boost:
git:
url:
'https://github.com/alibaba/flutter_boost.git'
ref:
'
1.12
.
13
+
1
'
ref:
'
1.12
.
13
+
2
'
```
...
...
README_CN.md
View file @
b4045960
...
...
@@ -26,6 +26,7 @@
| ----------------------- | ----------------------- | ------------------------------------------------------------ | ------------------- |
| 1.9.1+2 | 1.9.1-hotfixes | 版本号重新命名,开始默认支持androidx | Yes |
| 1.12.13+1 | 1.12.13 -hotfixes | 支持androidx | Yes |
| 1.12.13+2 | 1.17.1-hotfixes | 支持androidx | Yes |
...
...
@@ -35,6 +36,7 @@
| --------------------- | --------------------------- | ------------------------------------------------------------ | ------------------ |
| v1.9.1-hotfixes | 1.9.1-hotfixes | for androidx | Yes |
| v1.12.13-hotfixes | 1.12.13-hotfixes | for androidx | Yes |
| v1.17.1-hotfixes | 1.17.1 | for androidx | Yes |
# 安装
...
...
@@ -48,7 +50,7 @@ androidx branch
flutter_boost:
git:
url:
'https://github.com/alibaba/flutter_boost.git'
ref:
'
1.12
.
13
+
1
'
ref:
'
1.12
.
13
+
2
'
```
...
...
ios/Classes/Engine/FLBFlutterEngine.m
View file @
b4045960
...
...
@@ -30,7 +30,6 @@
@interface
FLBFlutterEngine
()
@property
(
nonatomic
,
strong
)
FlutterEngine
*
engine
;
@property
(
nonatomic
,
strong
)
FLBFlutterViewContainer
*
dummy
;
@end
@implementation
FLBFlutterEngine
...
...
@@ -53,10 +52,6 @@
}
else
{
[
_engine
runWithEntrypoint
:
nil
];
}
// _dummy = [[FLBFlutterViewContainer alloc] initWithEngine:_engine
// nibName:nil
// bundle:nil];
// _dummy.name = kIgnoreMessageWithName;
}
return
self
;
...
...
@@ -76,7 +71,9 @@
-
(
void
)
resume
{
if
([
UIApplication
sharedApplication
].
applicationState
==
UIApplicationStateActive
){
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.resumed"
];
}
}
-
(
void
)
inactive
...
...
@@ -108,9 +105,9 @@
-
(
void
)
detach
{
if
(
_engine
.
viewController
!=
_dummy
){
if
(
_engine
.
viewController
!=
nil
){
[(
FLBFlutterViewContainer
*
)
_engine
.
viewController
surfaceUpdated
:
NO
];
_engine
.
viewController
=
_dummy
;
_engine
.
viewController
=
nil
;
}
}
...
...
ios/Classes/container/FLBFlutterViewContainer.m
View file @
b4045960
...
...
@@ -38,6 +38,7 @@
-
(
void
)
flushOngoingTouches
;
-
(
void
)
bridge_viewDidDisappear
:(
BOOL
)
animated
;
-
(
void
)
bridge_viewWillAppear
:(
BOOL
)
animated
;
-
(
void
)
surfaceUpdated
:(
BOOL
)
appeared
;
@end
#pragma clang diagnostic push
...
...
@@ -231,6 +232,12 @@ static NSUInteger kInstanceCounter = 0;
[
FLUTTER_APP
.
flutterProvider
detach
];
}
-
(
void
)
surfaceUpdated
:(
BOOL
)
appeared
{
if
(
self
.
engine
&&
self
.
engine
.
viewController
==
self
)
{
[
super
surfaceUpdated
:
appeared
];
}
}
#pragma mark - Life circle methods
-
(
void
)
viewDidLayoutSubviews
...
...
@@ -272,8 +279,13 @@ static NSUInteger kInstanceCounter = 0;
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
//根据淘宝特价版日志证明,即使在UIViewController的viewDidAppear下,application也可能在inactive模式,此时如果提交渲染会导致GPU后台渲染而crash
//参考:https://github.com/flutter/flutter/issues/57973
//https://github.com/flutter/engine/pull/18742
if
([
UIApplication
sharedApplication
].
applicationState
==
UIApplicationStateActive
){
//NOTES:务必在show之后再update,否则有闪烁; 或导致侧滑返回时上一个页面会和top页面内容一样
[
self
surfaceUpdated
:
YES
];
}
[
super
viewDidAppear
:
animated
];
}
...
...
@@ -296,6 +308,10 @@ static NSUInteger kInstanceCounter = 0;
params:
_params
uniqueId:
self
.
uniqueIDString
];
[
super
bridge_viewDidDisappear
:
animated
];
if
(
self
.
engine
.
viewController
==
self
)
{
[
self
detatchFlutterEngine
];
}
}
-
(
void
)
installSplashScreenViewIfNecessary
{
...
...
lib/container/container_coordinator.dart
View file @
b4045960
...
...
@@ -208,8 +208,7 @@ class ContainerCoordinator {
FlutterBoost
.
containerManager
?.
showContainer
(
_createContainerSettings
(
name
,
params
,
pageId
));
// Compatible to accessibility mode on Android.
if
(
Platform
.
isAndroid
)
{
//对无障碍辅助模式的兼容
try
{
final
SemanticsOwner
owner
=
WidgetsBinding
.
instance
.
pipelineOwner
?.
semanticsOwner
;
...
...
@@ -219,7 +218,6 @@ class ContainerCoordinator {
}
catch
(
e
)
{
assert
(
false
,
e
.
toString
());
}
}
performContainerLifeCycle
(
_createContainerSettings
(
name
,
params
,
pageId
),
...
...
@@ -256,6 +254,12 @@ class ContainerCoordinator {
_createContainerSettings
(
name
,
params
,
pageId
),
ContainerLifeCycle
.
Disappear
,
);
Logger
.
log
(
'native containner did disappear-
$name
,
\n
'
'manager dump:
\n
'
'
${FlutterBoost.containerManager?.dump()}
'
,
);
return
true
;
}
...
...
@@ -268,6 +272,12 @@ class ContainerCoordinator {
_createContainerSettings
(
name
,
params
,
pageId
),
ContainerLifeCycle
.
Init
,
);
Logger
.
log
(
'native containner did init-
$name
,
\n
'
'manager dump:
\n
'
'
${FlutterBoost.containerManager?.dump()}
'
,
);
return
true
;
}
...
...
lib/flutter_boost.dart
View file @
b4045960
...
...
@@ -58,46 +58,38 @@ class FlutterBoost {
static
FlutterBoost
get
singleton
=>
_instance
;
static
ContainerManagerState
get
containerManager
=>
_instance
.
containerManagerKey
.
currentState
;
final
GlobalKey
<
ContainerManagerState
>
containerManagerKey
=
GlobalKey
<
ContainerManagerState
>();
final
ObserversHolder
_observersHolder
=
ObserversHolder
();
final
BoostChannel
_boostChannel
=
BoostChannel
();
static
ContainerManagerState
get
containerManager
=>
_instance
.
containerManagerKey
.
currentState
;
static
void
onPageStart
()
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
Duration
_
)
{
singleton
.
channel
.
invokeMethod
<
Map
<
dynamic
,
dynamic
>>(
'pageOnStart'
)
.
then
((
Map
<
dynamic
,
dynamic
>
_pageInfo
)
{
final
Map
<
String
,
dynamic
>
pageInfo
=
_pageInfo
?.
cast
<
String
,
dynamic
>();
if
(
pageInfo
?.
isEmpty
??
true
)
{
return
;
}
if
(
pageInfo
.
containsKey
(
'name'
)
&&
pageInfo
.
containsKey
(
'params'
)
&&
pageInfo
.
containsKey
(
'uniqueId'
))
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
singleton
.
channel
.
invokeMethod
<
Map
>(
'pageOnStart'
).
then
((
Map
pageInfo
)
{
if
(
pageInfo
==
null
||
pageInfo
.
isEmpty
)
return
;
if
(
pageInfo
.
containsKey
(
"name"
)
&&
pageInfo
.
containsKey
(
"params"
)
&&
pageInfo
.
containsKey
(
"uniqueId"
))
{
ContainerCoordinator
.
singleton
.
nativeContainerDidShow
(
pageInfo
[
'name'
]
as
String
,
(
pageInfo
[
'params'
]
as
Map
<
dynamic
,
dynamic
>)
?.
cast
<
String
,
dynamic
>(),
pageInfo
[
'uniqueId'
]
as
String
,
);
pageInfo
[
"name"
],
pageInfo
[
"params"
],
pageInfo
[
"uniqueId"
]);
}
});
});
}
static
TransitionBuilder
init
(
{
TransitionBuilder
builder
,
static
TransitionBuilder
init
(
{
TransitionBuilder
builder
,
PrePushRoute
prePush
,
PostPushRoute
postPush
,
})
{
PostPushRoute
postPush
})
{
if
(
Platform
.
isAndroid
)
{
onPageStart
();
}
else
if
(
Platform
.
isIOS
)
{
// TODO(AlexVincent525): 未解之谜
assert
(()
{
()
async
{
onPageStart
();
...
...
pubspec.yaml
View file @
b4045960
name
:
flutter_boost
description
:
A next-generation Flutter-Native hybrid solution. FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts.
version
:
1.12.13+
1
version
:
1.12.13+
2
author
:
Alibaba Xianyu
homepage
:
https://github.com/alibaba/flutter_boost
...
...
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