io.flutter.embedding.engine.FlutterEngine Java Examples

The following examples show how to use io.flutter.embedding.engine.FlutterEngine. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EmbeddingV1Activity.java    From flutter_barcode_scanner with MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(new FlutterEngine(this));
}
 
Example #2
Source File: FlutterIsolatePlugin.java    From flutter_isolate with MIT License 5 votes vote down vote up
private void startNextIsolate() {

        IsolateHolder isolate = queuedIsolates.peek();

        FlutterMain.ensureInitializationComplete(context, null);

        if (flutterPluginBinding == null)
            isolate.view = new FlutterNativeView(context, true);
        else
            isolate.engine = new FlutterEngine(context);


        FlutterCallbackInformation cbInfo = FlutterCallbackInformation.lookupCallbackInformation(isolate.entryPoint);
        FlutterRunArguments runArgs = new FlutterRunArguments();

        runArgs.bundlePath = FlutterMain.findAppBundlePath(context);
        runArgs.libraryPath = cbInfo.callbackLibraryPath;
        runArgs.entrypoint = cbInfo.callbackName;

        if (flutterPluginBinding == null) {
            isolate.controlChannel = new MethodChannel(isolate.view, NAMESPACE + "/control");
            isolate.startupChannel = new EventChannel(isolate.view, NAMESPACE + "/event");
        } else {
            isolate.controlChannel = new MethodChannel(isolate.engine.getDartExecutor().getBinaryMessenger(), NAMESPACE + "/control");
            isolate.startupChannel = new EventChannel(isolate.engine.getDartExecutor().getBinaryMessenger(), NAMESPACE + "/event");
        }
        isolate.startupChannel.setStreamHandler(this);
        isolate.controlChannel.setMethodCallHandler(this);
        if (flutterPluginBinding == null) {
            registerWithRegistrant(isolate.view.getPluginRegistry());
            isolate.view.runFromBundle(runArgs);
        } else {
            DartExecutor.DartCallback dartCallback = new DartExecutor.DartCallback(context.getAssets(), runArgs.bundlePath, cbInfo);
            isolate.engine.getDartExecutor().executeDartCallback(dartCallback);
        }
    }
 
Example #3
Source File: MainActivity.java    From streams_channel with Apache License 2.0 5 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
  GeneratedPluginRegistrant.registerWith(flutterEngine);

  // Manually register PluginExample
  flutterEngine.getPlugins().add(new PluginExample());
}
 
Example #4
Source File: MainActivity.java    From FlutterTencentImPlugin with Apache License 2.0 4 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine);
}
 
Example #5
Source File: MainActivity.java    From flutter_flipperkit with MIT License 4 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine);
}
 
Example #6
Source File: MainActivity.java    From FlutterQiniucloudLivePlugin with Apache License 2.0 4 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
  GeneratedPluginRegistrant.registerWith(flutterEngine);
}
 
Example #7
Source File: MainActivity.java    From razorpay-flutter with MIT License 4 votes vote down vote up
@Override
public void configureFlutterEngine(FlutterEngine flutterEngine) {
  flutterEngine.getPlugins().add(new RazorpayFlutterPlugin());
}
 
Example #8
Source File: MainActivity.java    From reader-sdk-flutter-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine);
}
 
Example #9
Source File: MainActivity.java    From flutter_downloader with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
  GeneratedPluginRegistrant.registerWith(flutterEngine);
}
 
Example #10
Source File: GeneratedPluginRegistrant.java    From InjuredAndroid with Apache License 2.0 4 votes vote down vote up
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
  ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
    com.flutter_webview_plugin.FlutterWebviewPlugin.registerWith(shimPluginRegistry.registrarFor("com.flutter_webview_plugin.FlutterWebviewPlugin"));
  flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
}
 
Example #11
Source File: MainActivity.java    From flutter_audio with MIT License 4 votes vote down vote up
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
  GeneratedPluginRegistrant.registerWith(flutterEngine);
}