MOBILES RECOVERY
MOBILES RECOVERY

Reputation: 25

How do I use local auth and bar code scanner in the same flutter project?

I building a flutter app that scans bar codes and also uses biometric auth in it. The problem is for package local_auth

MainActivity.kt should be like

import io.flutter.embedding.android.FlutterFragmentActivity;

  public class MainActivity extends FlutterFragmentActivity {
      // ...
  }

but for scaning bar codes MainActivity.kt should be like

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

else it don't work. How do I use them both in the same project?

Upvotes: 1

Views: 908

Answers (1)

Alexander Belokon
Alexander Belokon

Reputation: 1522

Currently you have to replace FlutterActivity with FlutterFragmentActivity yourself in FlutterBarcodeScannerPlugin.java (like this).

So you would want to use a fork of the flutter_barcode_scanner plugin where FlutterFragmentActivity is used or you use some other barcode scanner plugin.

Upvotes: 0

Related Questions