简体   繁体   中英

How do I use multiple main activities in flutter?

I am building a flutter app which has these two plugins 1) local_auth 2) flutter_bar_code and they both use different main activities, for local auth the MainActivity.kt is like

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
      
  }

and for flutter bar code scanner the MainActivity.tk is like

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

Flutter has a single MainActivity file. if you want to add more screen then please read doc and blogs here is one for you: Add Multiple screen

What do you want to know? Please make sure to ask that you need...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM