Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only create NetworkPlugin if needed #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 29
namespace 'org.leanflutter.plugins.flutter_flipperkit'

defaultConfig {
minSdkVersion 16
Expand Down
1 change: 1 addition & 0 deletions android/flipper-no-op/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.library'

android {
namespace 'com.facebook'
compileSdkVersion 28

defaultConfig {
Expand Down
4 changes: 1 addition & 3 deletions android/flipper-no-op/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook">
</manifest>
<manifest />
4 changes: 1 addition & 3 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.leanflutter.plugins.flutter_flipperkit">
</manifest>
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ private void setupChannel(BinaryMessenger messenger, Context context) {
SoLoader.init(context.getApplicationContext(), false);
if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(context)) {
flipperClient = AndroidFlipperClient.getInstance(context);
networkFlipperPlugin = new NetworkFlipperPlugin();
networkFlipperPlugin = flipperClient.getPlugin(NetworkFlipperPlugin.ID);
if (networkFlipperPlugin == null) {
networkFlipperPlugin = new NetworkFlipperPlugin();
}
sharedPreferencesFlipperPlugin = new SharedPreferencesFlipperPlugin(context, "FlutterSharedPreferences");

flipperDatabaseBrowserPlugin = new FlipperDatabaseBrowserPlugin();
Expand Down