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

Lightning talk about adding Flutter to an exist...

Lightning talk about adding Flutter to an existent Android App

Talk prepared for the Frontend ADL meetup in Adelaide/Australia. Showcasing the feature to add a Flutter module to an existing Android app.
This leads to a lot of doubts on how to add Flutter to an app that is in production, the lightning talk (10 min) just cover that happy path from the documentation https://flutter.dev/docs/development/add-to-app. Feel free to reach out for more thoughts on how that can be achieved in real life :) And also if you would like to share some thoughts on that as well.
Twitter: thaisandrade_s

Thais Aquino

February 06, 2020
Tweet

More Decks by Thais Aquino

Other Decks in Programming

Transcript

  1. Flutter Flutter is Google’s UI toolkit for building beautiful, natively

    compiled applications for mobile, web, and desktop from a single codebase.
  2. Why add Flutter to existing project? Share code logic between

    Android and iOS (or other platforms) Don’t have time to rewrite everything Serve a feature in Flutter using A/B or feature flag You already have an app in production
  3. Add to App feature Released in version 1.12 Limitations: •

    Running multiple Flutter instances or running in partial screen views may have undefined behavior • Using Flutter in background mode is still a WIP
  4. Add Flutter module to Android project 1. Open existing project

    2. New Flutter module wizard 3. Use Flutter Android APIs (to start an activity with Flutter screen for example) 4. Build & Run 5. Attach & Hot Reload https://flutter.dev/docs/development/add-to-app#add-to-android-applications
  5. Starting an Activity Every FlutterActivity creates its own FlutterEngine Delay

    to warm up the engine You can use a cached engine instead and optimize
  6. What about sharing logic? You can use Platform Channels to

    communicate between the existing app and the Flutter module. In order to write Dart code for logic and use it in the host app.