flutter_boost_assassin 0.0.5

  • README.md
  • Example
  • Installing
  • Versions
  • new51

中文文档 中文介绍

FlutterBoost #

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.The philosophy of FlutterBoost is to use Flutter as easy as using a WebView. Managing Native pages and Flutter pages at the same time is non-trivial in an existing App. FlutterBoost takes care of page resolution for you. The only thing you need to care about is the name of the page(usually could be an URL).  <a name="bf647454"></a>

Prerequisites #

You need to add Flutter to your project before moving on.

Getting Started #

Add a dependency in you Flutter project. #

Open you pubspec.yaml and add the following line to dependencies:

flutter_boost: ^0.0.400

Integration with Flutter code. #

Add init code to you App

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  void initState() {

    ///register page widget builders,the key is pageName
      'sample://firstPage': (pageName, params, _) => FirstRouteWidget(),
      'sample://secondPage': (pageName, params, _) => SecondRouteWidget(),

    ///query current top page and load it

  Widget build(BuildContext context) => MaterialApp(
      title: 'Flutter Boost example',
      builder: FlutterBoost.init(), ///init container manager
      home: Container());

Integration with iOS code. #

Use FLBFlutterAppDelegate as the superclass of your AppDelegate

@interface AppDelegate : FLBFlutterAppDelegate <UIApplicationDelegate>

Implement FLBPlatform protocol methods for your App.

@interface DemoRouter : NSObject<FLBPlatform>

@property (nonatomic,strong) UINavigationController *navigationController;

+ (DemoRouter *)sharedRouter;


@implementation DemoRouter

- (void)openPage:(NSString *)name
          params:(NSDictionary *)params
      completion:(void (^)(BOOL))completion
    if([params[@"present"] boolValue]){
        FLBFlutterViewContainer *vc = FLBFlutterViewContainer.new;
        [vc setName:name params:params];
        [self.navigationController presentViewController:vc animated:animated completion:^{}];
        FLBFlutterViewContainer *vc = FLBFlutterViewContainer.new;
        [vc setName:name params:params];
        [self.navigationController pushViewController:vc animated:animated];

- (void)closePage:(NSString *)uid animated:(BOOL)animated params:(NSDictionary *)params completion:(void (^)(BOOL))completion
    FLBFlutterViewContainer *vc = (id)self.navigationController.presentedViewController;
    if([vc isKindOfClass:FLBFlutterViewContainer.class] && [vc.uniqueIDString isEqual: uid]){
        [vc dismissViewControllerAnimated:animated completion:^{}];
        [self.navigationController popViewControllerAnimated:animated];


Initialize FlutterBoost with FLBPlatform at the beginning of your App.

 [FlutterBoostPlugin.sharedInstance startFlutterWithPlatform:router
                                                        onStart:^(FlutterViewController *fvc) {

Integration with Android code. #

Init FlutterBoost in Application.onCreate() 

public class MyApplication extends FlutterApplication {
    public void onCreate() {
        FlutterBoostPlugin.init(new IPlatform() {
            public Application getApplication() {
                return MyApplication.this;

             * get the main activity, this activity should always at the bottom of task stack.
            public Activity getMainActivity() {
                return MainActivity.sRef.get();

            public boolean isDebug() {
                return false;

             * start a new activity from flutter page, you may need a activity router.
            public boolean startActivity(Context context, String url, int requestCode) {
                return PageRouter.openPageByUrl(context,url,requestCode);

            public Map getSettings() {
                return null;

Basic Usage #

Concepts #

All page routing requests are being sent to the native router. Native router communicates with Native Container Manager, Native Container Manager takes care of building and destroying of Native Containers. 

Use Flutter Boost Native Container to show a Flutter page in native code. #


 FLBFlutterViewContainer *vc = FLBFlutterViewContainer.new;
        [vc setName:name params:params];
        [self.navigationController presentViewController:vc animated:animated completion:^{}];


public class FlutterPageActivity extends BoostFlutterActivity {

    public void onRegisterPlugins(PluginRegistry registry) {
        //register flutter plugins

    public String getContainerName() {
        //specify the page name register in FlutterBoost
        return "sample://firstPage";

    public Map getContainerParams() {
        //params of the page
        Map<String,String> params = new HashMap<>();
        return params;


public class FlutterFragment extends BoostFlutterFragment {
    public void onRegisterPlugins(PluginRegistry registry) {

    public String getContainerName() {
        return "sample://firstPage";

    public Map getContainerParams() {
        Map<String,String> params = new HashMap<>();
        return params;

Use Flutter Boost to open a page in dart code. #


 FlutterBoost.singleton.openPage("pagename", {}, true);

Use Flutter Boost to close a page in dart code. #


Running the Demo #

Please see the example for details.

License #

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments #

  • Flutter

0.0.1 #

  • TODO: Describe initial release.


flutter_boost_example #

Demonstrates how to use the flutter_boost plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_boost_assassin: ^0.0.5

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_boost_assassin/flutter_boost_assassin.dart';
Version Uploaded Documentation Archive
0.0.5 Mar 27, 2019 Go to the documentation of flutter_boost_assassin 0.0.5 Download flutter_boost_assassin 0.0.5 archive
0.0.4 Mar 27, 2019 Go to the documentation of flutter_boost_assassin 0.0.4 Download flutter_boost_assassin 0.0.4 archive
0.0.3 Mar 27, 2019 Go to the documentation of flutter_boost_assassin 0.0.3 Download flutter_boost_assassin 0.0.3 archive
0.0.2 Mar 27, 2019 Go to the documentation of flutter_boost_assassin 0.0.2 Download flutter_boost_assassin 0.0.2 archive
0.0.1 Mar 27, 2019 Go to the documentation of flutter_boost_assassin 0.0.1 Download flutter_boost_assassin 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/AIOService/NavigationService/service/navigation_service.dart. (-1 points)

Analysis of lib/AIOService/NavigationService/service/navigation_service.dart reported 2 hints:

line 40 col 22: 'listenEvent' is deprecated and shouldn't be used.

line 44 col 16: 'cancelEventForSubscription' is deprecated and shouldn't be used.

Fix lib/AIOService/NavigationService/handlers/navigation_service_did_disappear_page_container.dart. (-0.50 points)

Analysis of lib/AIOService/NavigationService/handlers/navigation_service_did_disappear_page_container.dart reported 1 hint:

line 31 col 7: Name types using UpperCamelCase.

Fix lib/AIOService/NavigationService/handlers/navigation_service_did_init_page_container.dart. (-0.50 points)

Analysis of lib/AIOService/NavigationService/handlers/navigation_service_did_init_page_container.dart reported 1 hint:

line 31 col 7: Name types using UpperCamelCase.

Fix additional 13 files with analysis or formatting issues. (-3.50 points)

Additional issues in the following files:

  • lib/AIOService/NavigationService/handlers/navigation_service_did_show_page_container.dart (1 hint)
  • lib/AIOService/NavigationService/handlers/navigation_service_on_native_page_result.dart (1 hint)
  • lib/AIOService/NavigationService/handlers/navigation_service_will_dealloc_page_container.dart (1 hint)
  • lib/AIOService/NavigationService/handlers/navigation_service_will_disappear_page_container.dart (1 hint)
  • lib/AIOService/NavigationService/handlers/navigation_service_will_show_page_container.dart (1 hint)
  • lib/container/container_coordinator.dart (1 hint)
  • lib/flutter_boost_assassin.dart (1 hint)
  • lib/AIOService/NavigationService/service/navigation_service_register.dart (Run flutter format to format lib/AIOService/NavigationService/service/navigation_service_register.dart.)
  • lib/AIOService/loader/service_loader.dart (Run flutter format to format lib/AIOService/loader/service_loader.dart.)
  • lib/messaging/message_proxy.dart (Run flutter format to format lib/messaging/message_proxy.dart.)
  • lib/messaging/native_page_container_event_handler.dart (Run flutter format to format lib/messaging/native_page_container_event_handler.dart.)
  • lib/messaging/page_result_mediator.dart (Run flutter format to format lib/messaging/page_result_mediator.dart.)
  • lib/support/logger.dart (Run flutter format to format lib/support/logger.dart.)

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
xservice_kit ^0.0.26 0.0.27
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8