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
927c405e
Commit
927c405e
authored
Dec 11, 2019
by
yangwu.jia
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into v0.1.61-androidx-hotfixes
parents
092117c2
7876e30e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
8 deletions
+47
-8
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
...src/main/java/com/idlefish/flutterboost/FlutterBoost.java
+13
-1
android/src/main/java/com/idlefish/flutterboost/containers/FlutterActivityAndFragmentDelegate.java
...rboost/containers/FlutterActivityAndFragmentDelegate.java
+1
-0
example/ios/Runner/AppDelegate.h
example/ios/Runner/AppDelegate.h
+2
-2
ios/Classes/Boost/FLBFlutterApplicationInterface.h
ios/Classes/Boost/FLBFlutterApplicationInterface.h
+1
-0
ios/Classes/Boost/FlutterBoostPlugin.h
ios/Classes/Boost/FlutterBoostPlugin.h
+12
-0
ios/Classes/Boost/FlutterBoostPlugin.m
ios/Classes/Boost/FlutterBoostPlugin.m
+8
-0
ios/Classes/Engine/FLBFlutterApplication.m
ios/Classes/Engine/FLBFlutterApplication.m
+2
-1
ios/Classes/Engine/FLBFlutterEngine.h
ios/Classes/Engine/FLBFlutterEngine.h
+1
-1
ios/Classes/Engine/FLBFlutterEngine.m
ios/Classes/Engine/FLBFlutterEngine.m
+7
-3
No files found.
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
View file @
927c405e
...
@@ -58,7 +58,13 @@ public class FlutterBoost {
...
@@ -58,7 +58,13 @@ public class FlutterBoost {
mCurrentActiveActivity
=
activity
;
mCurrentActiveActivity
=
activity
;
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
doInitialFlutter
();
doInitialFlutter
();
boostPluginRegistry
();
}
}
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
IMMEDIATELY
)
{
boostPluginRegistry
();
}
}
}
@Override
@Override
...
@@ -150,10 +156,16 @@ public class FlutterBoost {
...
@@ -150,10 +156,16 @@ public class FlutterBoost {
flutterEngine
.
getDartExecutor
().
executeDartEntrypoint
(
entrypoint
);
flutterEngine
.
getDartExecutor
().
executeDartEntrypoint
(
entrypoint
);
mRegistry
=
new
BoostPluginRegistry
(
createEngine
());
mRegistry
=
new
BoostPluginRegistry
(
createEngine
());
mPlatform
.
registerPlugins
(
mRegistry
);
}
}
public
void
boostPluginRegistry
(){
if
(
mRegistry
!=
null
&&
!
mRegistry
.
hasPlugin
(
"boostPluginRegistry"
)){
mPlatform
.
registerPlugins
(
mRegistry
);
mRegistry
.
registrarFor
(
"boostPluginRegistry"
);
}
}
public
static
class
ConfigBuilder
{
public
static
class
ConfigBuilder
{
...
...
android/src/main/java/com/idlefish/flutterboost/containers/FlutterActivityAndFragmentDelegate.java
View file @
927c405e
...
@@ -83,6 +83,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
...
@@ -83,6 +83,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
ensureAlive
();
ensureAlive
();
if
(
FlutterBoost
.
instance
().
platform
().
whenEngineStart
()
==
FlutterBoost
.
ConfigBuilder
.
FLUTTER_ACTIVITY_CREATED
)
{
if
(
FlutterBoost
.
instance
().
platform
().
whenEngineStart
()
==
FlutterBoost
.
ConfigBuilder
.
FLUTTER_ACTIVITY_CREATED
)
{
FlutterBoost
.
instance
().
doInitialFlutter
();
FlutterBoost
.
instance
().
doInitialFlutter
();
FlutterBoost
.
instance
().
boostPluginRegistry
();
}
}
// When "retain instance" is true, the FlutterEngine will survive configuration
// When "retain instance" is true, the FlutterEngine will survive configuration
// changes. Therefore, we create a new one only if one does not already exist.
// changes. Therefore, we create a new one only if one does not already exist.
...
...
example/ios/Runner/AppDelegate.h
View file @
927c405e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import <flutter_boost/FlutterBoost.h>
#import <flutter_boost/FlutterBoost.h>
@interface
AppDelegate
:
FLBFlutterAppDelegate
<
UIApplicationDelegate
>
@interface
AppDelegate
:
UIResponder
<
UIApplicationDelegate
>
@property
(
nullable
,
nonatomic
,
strong
)
UIWindow
*
window
;
@end
@end
ios/Classes/Boost/FLBFlutterApplicationInterface.h
View file @
927c405e
...
@@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
-
(
id
<
FLBFlutterProvider
>
)
flutterProvider
;
-
(
id
<
FLBFlutterProvider
>
)
flutterProvider
;
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
withEngine
:(
FlutterEngine
*
_Nullable
)
engine
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
-
(
FlutterViewController
*
)
flutterViewController
;
-
(
FlutterViewController
*
)
flutterViewController
;
...
...
ios/Classes/Boost/FlutterBoostPlugin.h
View file @
927c405e
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#import "FLBPlatform.h"
#import "FLBPlatform.h"
#import "FLBTypes.h"
#import "FLBTypes.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FlutterBoostPlugin
:
NSObject
<
FlutterPlugin
>
@interface
FlutterBoostPlugin
:
NSObject
<
FlutterPlugin
>
#pragma mark - Initializer
#pragma mark - Initializer
+
(
instancetype
)
sharedInstance
;
+
(
instancetype
)
sharedInstance
;
...
@@ -38,6 +39,16 @@
...
@@ -38,6 +39,16 @@
*/
*/
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
/**
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
*
* @param platform 平台层实现FLBPlatform的对象
* @param engine 外部实例化engine后传入
* @param callback 启动之后回调
*/
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
engine
:(
FlutterEngine
*
_Nullable
)
engine
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
#pragma mark - Some properties.
#pragma mark - Some properties.
-
(
BOOL
)
isRunning
;
-
(
BOOL
)
isRunning
;
...
@@ -109,3 +120,4 @@
...
@@ -109,3 +120,4 @@
onPageFinished
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
onPageFinished
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
;
completion
:(
void
(
^
)(
BOOL
))
completion
;
@end
@end
NS_ASSUME_NONNULL_END
ios/Classes/Boost/FlutterBoostPlugin.m
View file @
927c405e
...
@@ -113,6 +113,13 @@
...
@@ -113,6 +113,13 @@
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
{
[
self
startFlutterWithPlatform
:
platform
engine
:
nil
onStart
:
callback
];
}
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
engine
:(
FlutterEngine
*
_Nullable
)
engine
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
;
{
{
static
dispatch_once_t
onceToken
;
static
dispatch_once_t
onceToken
;
__weak
__typeof__
(
self
)
weakSelf
=
self
;
__weak
__typeof__
(
self
)
weakSelf
=
self
;
...
@@ -121,6 +128,7 @@
...
@@ -121,6 +128,7 @@
self
.
factory
=
FLBFactory
.
new
;
self
.
factory
=
FLBFactory
.
new
;
self
.
application
=
[
self
->
_factory
createApplication
:
platform
];
self
.
application
=
[
self
->
_factory
createApplication
:
platform
];
[
self
.
application
startFlutterWithPlatform
:
platform
[
self
.
application
startFlutterWithPlatform
:
platform
withEngine:
engine
onStart:
callback
];
onStart:
callback
];
});
});
}
}
...
...
ios/Classes/Engine/FLBFlutterApplication.m
View file @
927c405e
...
@@ -50,12 +50,13 @@
...
@@ -50,12 +50,13 @@
}
}
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLBPlatform
>
)
platform
withEngine
:(
FlutterEngine
*
_Nullable
)
engine
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
onStart
:(
void
(
^
)(
FlutterEngine
*
engine
))
callback
{
{
static
dispatch_once_t
onceToken
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
dispatch_once
(
&
onceToken
,
^
{
self
.
platform
=
platform
;
self
.
platform
=
platform
;
self
.
viewProvider
=
[[
FLBFlutterEngine
alloc
]
initWithPlatform
:
platform
];
self
.
viewProvider
=
[[
FLBFlutterEngine
alloc
]
initWithPlatform
:
platform
engine
:
engine
];
self
.
isRunning
=
YES
;
self
.
isRunning
=
YES
;
if
(
callback
)
callback
(
self
.
viewProvider
.
engine
);
if
(
callback
)
callback
(
self
.
viewProvider
.
engine
);
});
});
...
...
ios/Classes/Engine/FLBFlutterEngine.h
View file @
927c405e
...
@@ -28,6 +28,6 @@
...
@@ -28,6 +28,6 @@
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterEngine
:
NSObject
<
FLBFlutterProvider
>
@interface
FLBFlutterEngine
:
NSObject
<
FLBFlutterProvider
>
-
(
instancetype
)
initWithPlatform
:(
id
<
FLBPlatform
>
_Nullable
)
platform
;
-
(
instancetype
)
initWithPlatform
:(
id
<
FLBPlatform
>
_Nullable
)
platform
engine
:(
FlutterEngine
*
_Nullable
)
engine
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
ios/Classes/Engine/FLBFlutterEngine.m
View file @
927c405e
...
@@ -35,13 +35,17 @@
...
@@ -35,13 +35,17 @@
@implementation
FLBFlutterEngine
@implementation
FLBFlutterEngine
-
(
instancetype
)
initWithPlatform
:(
id
<
FLBPlatform
>
_Nullable
)
platform
-
(
instancetype
)
initWithPlatform
:(
id
<
FLBPlatform
>
_Nullable
)
platform
engine
:(
FlutterEngine
*
_Nullable
)
engine
{
{
#pragma clang diagnostic push
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_engine
=
[[
FlutterEngine
alloc
]
initWithName
:
@"io.flutter"
project
:
nil
];
if
(
!
engine
){
_engine
=
[[
FlutterEngine
alloc
]
initWithName
:
@"io.flutter"
project
:
nil
];
}
else
{
_engine
=
engine
;
}
if
(
platform
&&
if
(
platform
&&
[
platform
respondsToSelector
:
@selector
(
entryForDart
)]
&&
[
platform
respondsToSelector
:
@selector
(
entryForDart
)]
&&
platform
.
entryForDart
){
platform
.
entryForDart
){
...
@@ -69,7 +73,7 @@
...
@@ -69,7 +73,7 @@
-
(
instancetype
)
init
-
(
instancetype
)
init
{
{
return
[
self
initWithPlatform
:
nil
];
return
[
self
initWithPlatform
:
nil
engine
:
nil
];
}
}
-
(
void
)
pause
-
(
void
)
pause
...
...
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