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
6c01fb3b
Commit
6c01fb3b
authored
Jan 10, 2020
by
yangwu.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容新插件注册方式
parent
96b82a70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
12 deletions
+33
-12
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
...src/main/java/com/idlefish/flutterboost/FlutterBoost.java
+1
-7
example/android/app/src/main/java/com/taobao/idlefish/flutterboostexample/MyApplication.java
...om/taobao/idlefish/flutterboostexample/MyApplication.java
+24
-5
example/ios/Runner/GeneratedPluginRegistrant.h
example/ios/Runner/GeneratedPluginRegistrant.h
+3
-0
example/ios/Runner/GeneratedPluginRegistrant.m
example/ios/Runner/GeneratedPluginRegistrant.m
+5
-0
No files found.
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
View file @
6c01fb3b
...
...
@@ -200,7 +200,6 @@ public class FlutterBoost {
private
BoostLifecycleListener
lifecycleListener
;
private
BoostPluginsRegister
boostPluginsRegister
;
...
...
@@ -235,15 +234,11 @@ public class FlutterBoost {
}
public
ConfigBuilder
lifecycleListener
(
BoostLifecycleListener
lifecycleListener
)
{
this
.
lifecycleListener
=
lifecycleListener
;
return
this
;
}
public
ConfigBuilder
pluginsRegister
(
BoostPluginsRegister
boostPluginsRegister
)
{
this
.
boostPluginsRegister
=
boostPluginsRegister
;
return
this
;
}
public
Platform
build
()
{
Platform
platform
=
new
Platform
()
{
...
...
@@ -278,7 +273,6 @@ public class FlutterBoost {
};
platform
.
lifecycleListener
=
this
.
lifecycleListener
;
platform
.
pluginsRegister
=
this
.
boostPluginsRegister
;
return
platform
;
}
...
...
example/android/app/src/main/java/com/taobao/idlefish/flutterboostexample/MyApplication.java
View file @
6c01fb3b
...
...
@@ -30,21 +30,40 @@ public class MyApplication extends Application {
};
FlutterBoost
.
Boost
PluginsRegister
pluginsRegister
=
new
FlutterBoost
.
BoostPluginsRegist
er
(){
FlutterBoost
.
Boost
LifecycleListener
boostLifecycleListener
=
new
FlutterBoost
.
BoostLifecycleListen
er
(){
@Override
public
void
registerPlugins
(
PluginRegistry
mRegistry
)
{
GeneratedPluginRegistrant
.
registerWith
(
mRegistry
);
TextPlatformViewPlugin
.
register
(
mRegistry
.
registrarFor
(
"TextPlatformViewPlugin"
));
public
void
onEngineCreated
()
{
}
@Override
public
void
onPluginsRegistered
()
{
}
@Override
public
void
onEngineDestroy
()
{
}
};
//
// AndroidManifest.xml 中必须要添加 flutterEmbedding 版本设置
//
// <meta-data android:name="flutterEmbedding"
// android:value="2">
// </meta-data>
// GeneratedPluginRegistrant 会自动生成 新的插件方式
//
//
Platform
platform
=
new
FlutterBoost
.
ConfigBuilder
(
this
,
router
)
.
isDebug
(
true
)
.
whenEngineStart
(
FlutterBoost
.
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
.
renderMode
(
FlutterView
.
RenderMode
.
texture
)
.
pluginsRegister
(
pluginsRegist
er
)
.
lifecycleListener
(
boostLifecycleListen
er
)
.
build
();
FlutterBoost
.
instance
().
init
(
platform
);
...
...
example/ios/Runner/GeneratedPluginRegistrant.h
View file @
6c01fb3b
...
...
@@ -7,8 +7,11 @@
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface
GeneratedPluginRegistrant
:
NSObject
+
(
void
)
registerWithRegistry
:(
NSObject
<
FlutterPluginRegistry
>*
)
registry
;
@end
NS_ASSUME_NONNULL_END
#endif
/* GeneratedPluginRegistrant_h */
example/ios/Runner/GeneratedPluginRegistrant.m
View file @
6c01fb3b
...
...
@@ -3,7 +3,12 @@
//
#import "GeneratedPluginRegistrant.h"
#if __has_include(<flutter_boost/FlutterBoostPlugin.h>)
#import <flutter_boost/FlutterBoostPlugin.h>
#else
@import
flutter_boost
;
#endif
@implementation
GeneratedPluginRegistrant
...
...
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