1

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?

1 Answers1

0

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.

Alexander Belokon
  • 1,452
  • 2
  • 17
  • 37