Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Adopting Flutter in Native Mobile Applications

Adopting Flutter in Native Mobile Applications

Flutter in Existing Mobile Apps: - Discuss the challenges in adopting Flutter in existing mobile applications based on real code examples. Challenge the idea of why "Multiple Flutter screens or views" is wrong.
Case Study: - Adopting Flutter and doing A/B Tests between native and Flutter in a published application with more than two million monthly users.

Alexandru Terente

August 21, 2024
Tweet

More Decks by Alexandru Terente

Other Decks in Technology

Transcript

  1. Run the iOS App Run in fl utter folder: Run

    in iOS folder: Open application .xcodeproj and hit Run
  2. Flutter MethodChannel • Communication between native and Dart/Flutter code •

    Write platform speci fi c code • Use native apis and 3rd party frameworks
  3. Multiple Flutters • https://docs. fl utter.dev/add-to-app/multiple- fl utters • Flutter

    documentation has solution for multiple fl utters • Uses multiple fl utter engines • Multiple Modules • The fl utter common code can be shared between modules via Flutter Packages
  4. Problems with Multiple Flutters • Loads the system memory and

    CPU with multiple running engines • Multiple calls via MethodChannels to share the same data with different fl utter engines • Share state data between Flutter engines has to be done via the native platform
  5. New Problem • The Flutter Engine can have only one

    Activity or ViewController attached at a speci fi c time. • If you have nested native and fl utter navigation the FlutterActivity and FlutterViewController will remain stuck when navigating back to it.
  6. A/B Tests We have in place all the pieces of

    the puzzle to do A/B test with a remote con fi g to display either a fl utter or a native screen.
  7. Resources • https://docs. fl utter.dev/add-to-app • https://docs. fl utter.dev/platform-integration/platform-channels •

    https://docs. fl utter.dev/add-to-app/multiple- fl utters • https://github.com/ fl utter/put- fl utter-to-work • https://github.com/ fl utter/samples/tree/main/add_to_app