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
0
Merge Requests
0
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
6b5e8028
Commit
6b5e8028
authored
Jan 19, 2020
by
XinLei
Committed by
GitHub
Jan 19, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from alibaba/master
[sync] 2020/1/19
parents
a558f1e3
138e79f2
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
104 additions
and
63 deletions
+104
-63
CHANGELOG.md
CHANGELOG.md
+4
-0
README.md
README.md
+2
-2
android/build.gradle
android/build.gradle
+4
-4
android/src/main/java/com/idlefish/flutterboost/containers/BoostFlutterActivity.java
...dlefish/flutterboost/containers/BoostFlutterActivity.java
+1
-1
example/android/app/build.gradle
example/android/app/build.gradle
+3
-0
ios/Classes/Boost/FLBFlutterApplicationInterface.h
ios/Classes/Boost/FLBFlutterApplicationInterface.h
+1
-0
ios/Classes/Boost/FlutterBoostPlugin.h
ios/Classes/Boost/FlutterBoostPlugin.h
+13
-2
ios/Classes/Boost/FlutterBoostPlugin.m
ios/Classes/Boost/FlutterBoostPlugin.m
+15
-1
ios/Classes/Engine/FLBFlutterApplication.m
ios/Classes/Engine/FLBFlutterApplication.m
+11
-0
ios/Classes/Engine/FLBFlutterEngine.m
ios/Classes/Engine/FLBFlutterEngine.m
+0
-8
lib/flutter_boost.dart
lib/flutter_boost.dart
+49
-44
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
CHANGELOG.md
View file @
6b5e8028
## 0.1.66
Fixed bugs
## 0.1.64
Fixed bugs
...
...
README.md
View file @
6b5e8028
...
...
@@ -22,12 +22,12 @@ You need to add Flutter to your project before moving on.The version of the flut
1.
0.1.50 is based on the flutter v1.5.4-hotfixes branch, android if other flutter versions or branches will compile incorrectly
2.
0.1.51--0.1.5
4
is a bugfix for 0.1.50
2.
0.1.51--0.1.5
9
is a bugfix for 0.1.50
3.
0.1.60 is based on the flutter v1.9.1-hotfixes branch. Android does not support andriodx if other flutter branches will compile incorrectly
4.
0.1.61--0.1.6
4
is a bugfix for 0.1.60
4.
0.1.61--0.1.6
9
is a bugfix for 0.1.60
5.
Statement of support for androidx
...
...
android/build.gradle
View file @
6b5e8028
...
...
@@ -35,11 +35,11 @@ android {
}
dependencies
{
implementation
'com.android.support:appcompat-v7:28.0.0'
implementation
'com.android.support:design:28.0.0'
implementation
'com.android.support:support-v4:28.0.0'
compileOnly
'com.android.support:appcompat-v7:28.0.0'
compileOnly
'com.android.support:design:28.0.0'
compileOnly
'com.android.support:support-v4:28.0.0'
implementation
'android.arch.lifecycle:common-java8:1.1.1'
implementation
'com.alibaba:fastjson:1.2.41'
compileOnly
'com.alibaba:fastjson:1.2.41'
}
...
...
android/src/main/java/com/idlefish/flutterboost/containers/BoostFlutterActivity.java
View file @
6b5e8028
...
...
@@ -73,7 +73,7 @@ public class BoostFlutterActivity extends Activity
private
Map
params
=
new
HashMap
();
p
rotected
NewEngineIntentBuilder
(
@NonNull
Class
<?
extends
BoostFlutterActivity
>
activityClass
)
{
p
ublic
NewEngineIntentBuilder
(
@NonNull
Class
<?
extends
BoostFlutterActivity
>
activityClass
)
{
this
.
activityClass
=
activityClass
;
}
...
...
example/android/app/build.gradle
View file @
6b5e8028
...
...
@@ -59,5 +59,8 @@ dependencies {
androidTestImplementation
'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.2'
implementation
'com.android.support:appcompat-v7:28.0.0'
implementation
'com.android.support:design:28.0.0'
implementation
'com.android.support:support-v4:28.0.0'
implementation
'com.alibaba:fastjson:1.2.41'
}
ios/Classes/Boost/FLBFlutterApplicationInterface.h
View file @
6b5e8028
...
...
@@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
withEngine
:(
FlutterEngine
*
_Nullable
)
engine
withPluginRegisterred
:(
BOOL
)
registerPlugin
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
-
(
FlutterViewController
*
)
flutterViewController
;
...
...
ios/Classes/Boost/FlutterBoostPlugin.h
View file @
6b5e8028
...
...
@@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
+
(
NSInteger
)
pageCount
;
/**
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
。本函数默认需要flutter boost来注册所有插件。
*
* @param platform 平台层实现FLBPlatform的对象
* @param callback 启动之后回调
...
...
@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
/**
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
。本函数默认需要flutter boost来注册所有插件。
*
* @param platform 平台层实现FLBPlatform的对象
* @param engine 外部实例化engine后传入
...
...
@@ -56,6 +56,17 @@ NS_ASSUME_NONNULL_BEGIN
engine
:(
FlutterEngine
*
_Nullable
)
engine
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
/**
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中。本函数可以控制是否需要flutter boost来注册所有插件
*
* @param platform 平台层实现FLBPlatform的对象
* @param engine 外部实例化engine后传入
* @param callback 启动之后回调
*/
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
engine
:(
FlutterEngine
*
_Nullable
)
engine
pluginRegisterred
:(
BOOL
)
registerPlugin
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
#pragma mark - Some properties.
-
(
BOOL
)
isRunning
;
...
...
ios/Classes/Boost/FlutterBoostPlugin.m
View file @
6b5e8028
...
...
@@ -119,13 +119,26 @@
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
{
[
self
startFlutterWithPlatform
:
platform
engine
:
nil
onStart
:
callback
];
[
self
startFlutterWithPlatform
:
platform
engine:
nil
pluginRegisterred:
YES
onStart:
callback
];
}
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
engine
:(
FlutterEngine
*
_Nullable
)
engine
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
{
[
self
startFlutterWithPlatform
:
platform
engine:
engine
pluginRegisterred:
YES
onStart:
callback
];
}
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
engine
:(
FlutterEngine
*
)
engine
pluginRegisterred
:(
BOOL
)
registerPlugin
onStart
:(
void
(
^
)(
FlutterEngine
*
_Nonnull
))
callback
{
static
dispatch_once_t
onceToken
;
__weak
__typeof__
(
self
)
weakSelf
=
self
;
dispatch_once
(
&
onceToken
,
^
{
...
...
@@ -134,6 +147,7 @@
self
.
application
=
[
factory
createApplication
:
platform
];
[
self
.
application
startFlutterWithPlatform
:
platform
withEngine:
engine
withPluginRegisterred:
registerPlugin
onStart:
callback
];
});
}
...
...
ios/Classes/Engine/FLBFlutterApplication.m
View file @
6b5e8028
...
...
@@ -51,6 +51,7 @@
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
withEngine
:(
FlutterEngine
*
_Nullable
)
engine
withPluginRegisterred
:(
BOOL
)
registerPlugin
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
{
static
dispatch_once_t
onceToken
;
...
...
@@ -58,6 +59,16 @@
self
.
platform
=
platform
;
self
.
viewProvider
=
[[
FLBFlutterEngine
alloc
]
initWithPlatform
:
platform
engine
:
engine
];
self
.
isRunning
=
YES
;
if
(
registerPlugin
){
Class
clazz
=
NSClassFromString
(
@"GeneratedPluginRegistrant"
);
FlutterEngine
*
myengine
=
[
self
.
viewProvider
engine
];
if
(
clazz
&&
myengine
)
{
if
([
clazz
respondsToSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)])
{
[
clazz
performSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)
withObject:
myengine
];
}
}
}
if
(
callback
)
callback
(
self
.
viewProvider
.
engine
);
});
}
...
...
ios/Classes/Engine/FLBFlutterEngine.m
View file @
6b5e8028
...
...
@@ -57,14 +57,6 @@
nibName:
nil
bundle:
nil
];
_dummy
.
name
=
kIgnoreMessageWithName
;
Class
clazz
=
NSClassFromString
(
@"GeneratedPluginRegistrant"
);
if
(
clazz
)
{
if
([
clazz
respondsToSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)])
{
[
clazz
performSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)
withObject:
_engine
];
}
}
}
return
self
;
...
...
lib/flutter_boost.dart
View file @
6b5e8028
...
...
@@ -44,7 +44,6 @@ typedef void PostPushRoute(
String
url
,
String
uniqueId
,
Map
params
,
Route
route
,
Future
result
);
class
FlutterBoost
{
static
final
FlutterBoost
_instance
=
FlutterBoost
();
final
GlobalKey
<
ContainerManagerState
>
containerManagerKey
=
GlobalKey
<
ContainerManagerState
>();
...
...
@@ -56,23 +55,14 @@ class FlutterBoost {
static
ContainerManagerState
get
containerManager
=>
_instance
.
containerManagerKey
.
currentState
;
static
TransitionBuilder
init
(
{
TransitionBuilder
builder
,
PrePushRoute
prePush
,
PostPushRoute
postPush
})
{
if
(
Platform
.
isAndroid
){
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
){
singleton
.
channel
.
invokeMethod
<
Map
>(
'pageOnStart'
).
then
((
Map
pageInfo
){
static
void
onPageStart
()
{
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"
],
pageInfo
[
"params"
],
pageInfo
[
"uniqueId"
]);
}
...
...
@@ -80,6 +70,22 @@ class FlutterBoost {
});
}
static
TransitionBuilder
init
(
{
TransitionBuilder
builder
,
PrePushRoute
prePush
,
PostPushRoute
postPush
})
{
if
(
Platform
.
isAndroid
)
{
onPageStart
();
}
assert
(()
{
()
async
{
if
(
Platform
.
isIOS
)
{
onPageStart
();
}
}();
return
true
;
}());
return
(
BuildContext
context
,
Widget
child
)
{
assert
(
child
is
Navigator
,
'child must be Navigator, what is wrong?'
);
...
...
@@ -102,7 +108,7 @@ class FlutterBoost {
BoostChannel
get
channel
=>
_boostChannel
;
FlutterBoost
(){
FlutterBoost
()
{
ContainerCoordinator
(
_boostChannel
);
}
...
...
@@ -116,30 +122,29 @@ class FlutterBoost {
ContainerCoordinator
.
singleton
.
registerPageBuilders
(
builders
);
}
Future
<
Map
<
dynamic
,
dynamic
>>
open
(
String
url
,{
Map
<
dynamic
,
dynamic
>
urlParams
,
Map
<
dynamic
,
dynamic
>
exts
}){
Future
<
Map
<
dynamic
,
dynamic
>>
open
(
String
url
,
{
Map
<
dynamic
,
dynamic
>
urlParams
,
Map
<
dynamic
,
dynamic
>
exts
})
{
Map
<
dynamic
,
dynamic
>
properties
=
new
Map
<
dynamic
,
dynamic
>();
properties
[
"url"
]
=
url
;
properties
[
"urlParams"
]
=
urlParams
;
properties
[
"exts"
]
=
exts
;
return
channel
.
invokeMethod
<
Map
<
dynamic
,
dynamic
>>(
'openPage'
,
properties
);
return
channel
.
invokeMethod
<
Map
<
dynamic
,
dynamic
>>(
'openPage'
,
properties
);
}
Future
<
bool
>
close
(
String
id
,
{
Map
<
dynamic
,
dynamic
>
result
,
Map
<
dynamic
,
dynamic
>
exts
}){
Future
<
bool
>
close
(
String
id
,
{
Map
<
dynamic
,
dynamic
>
result
,
Map
<
dynamic
,
dynamic
>
exts
})
{
assert
(
id
!=
null
);
BoostContainerSettings
settings
=
containerManager
?.
onstageSettings
;
Map
<
dynamic
,
dynamic
>
properties
=
new
Map
<
dynamic
,
dynamic
>();
if
(
exts
==
null
)
{
exts
=
Map
<
dynamic
,
dynamic
>();
if
(
exts
==
null
)
{
exts
=
Map
<
dynamic
,
dynamic
>();
}
exts
[
"params"
]
=
settings
.
params
;
if
(!
exts
.
containsKey
(
"animated"
))
{
if
(!
exts
.
containsKey
(
"animated"
))
{
exts
[
"animated"
]
=
true
;
}
...
...
@@ -155,28 +160,30 @@ class FlutterBoost {
return
channel
.
invokeMethod
<
bool
>(
'closePage'
,
properties
);
}
Future
<
bool
>
closeCurrent
({
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
})
{
Future
<
bool
>
closeCurrent
(
{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
})
{
BoostContainerSettings
settings
=
containerManager
?.
onstageSettings
;
if
(
exts
==
null
)
{
exts
=
Map
<
String
,
dynamic
>();
if
(
exts
==
null
)
{
exts
=
Map
<
String
,
dynamic
>();
}
exts
[
"params"
]
=
settings
.
params
;
if
(!
exts
.
containsKey
(
"animated"
))
{
if
(!
exts
.
containsKey
(
"animated"
))
{
exts
[
"animated"
]
=
true
;
}
return
close
(
settings
.
uniqueId
,
result:
result
,
exts:
exts
);
return
close
(
settings
.
uniqueId
,
result:
result
,
exts:
exts
);
}
Future
<
bool
>
closeByContext
(
BuildContext
context
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
})
{
Future
<
bool
>
closeByContext
(
BuildContext
context
,
{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
})
{
BoostContainerSettings
settings
=
containerManager
?.
onstageSettings
;
if
(
exts
==
null
)
{
exts
=
Map
<
String
,
dynamic
>();
if
(
exts
==
null
)
{
exts
=
Map
<
String
,
dynamic
>();
}
exts
[
"params"
]
=
settings
.
params
;
if
(!
exts
.
containsKey
(
"animated"
))
{
if
(!
exts
.
containsKey
(
"animated"
))
{
exts
[
"animated"
]
=
true
;
}
return
close
(
settings
.
uniqueId
,
result:
result
,
exts:
exts
);
return
close
(
settings
.
uniqueId
,
result:
result
,
exts:
exts
);
}
///register for Container changed callbacks
...
...
@@ -191,6 +198,4 @@ class FlutterBoost {
///register callbacks for Navigators push & pop
VoidCallback
addBoostNavigatorObserver
(
BoostNavigatorObserver
observer
)
=>
_observersHolder
.
addObserver
<
BoostNavigatorObserver
>(
observer
);
}
pubspec.yaml
View file @
6b5e8028
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
:
0.1.6
4
version
:
0.1.6
6
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