6

I was trying to implement local_auth package into my Flutter app.

in the documentation, it was mentioned that it will have to use FlutterFragmentActivity instead of FlutterActivity in my MainActivity class.

So I wanted to know the what is main differences between FlutterFragmentActivity and FlutterActivity and how both impact app's performance?

:) as I don't want to make a change and break the app in production.

Ruchit
  • 2,137
  • 1
  • 9
  • 24
atulvinod1911
  • 99
  • 1
  • 5
  • 4
    FlutterFragmentActivity exists because there are some Android APIs in the ecosystem that only accept a FragmentActivity. If a FragmentActivity is not required, you should consider using a regular FlutterActivity instead, because FlutterActivity is considered to be the standard, canonical implementation of a Flutter Activity. – Priyaank Feb 02 '22 at 08:10

1 Answers1

3

A FragmentActivity is a subclass of Activity that was built for the Android Support Package.

The FragmentActivity class adds a couple of new methods to ensure compatibility with older versions of Android, but other than that, there really isn't much of a difference between the two.

https://developer.android.com/topic/libraries/support-library

Info from this thread https://stackoverflow.com/a/10478048/7198006

So, it doesn't impact performance.

awaik
  • 10,143
  • 2
  • 44
  • 50