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

2024 FlutterMTL January Meetup - Build Customization by Nicolas Cuillery

2024 FlutterMTL January Meetup - Build Customization by Nicolas Cuillery

GDG Montreal

January 18, 2024
Tweet

More Decks by GDG Montreal

Other Decks in Programming

Transcript

  1. Nicolas Cuillery Software developer Has worked with: - Flutter -

    React Native - React - Angular.js - Flex - jQuery - JSP
  2. Cloud9 application - Project started in February 2021 - Android

    and iOS - Single codebase, multiple apps - Currently in production in 10 countries - 1M daily users
  3. Multiple markets - Phase 1: Japan and Australia - Phase

    2: Mexico, UK and New Zealand - Phase 3: Korea and Taiwan - Quarterly releases: France, Spain, Sweden, Iceland
  4. Multiple applications com.cloud9.uat com.cloud9.qa com.cloud9.preprod com.cloud9.japan com.cloud9.uk com.cloud9.mexico com.cloud9.australia Cloud9

    code base cloud9-prod-australia cloud9-prod-mexico cloud9-prod-japan cloud9-prod-uk etc… cloud9-dev-shared cloud9-dev-uat cloud9-dev-qa cloud9-dev-preprod
  5. Non-prod applications Country selector screen on startup - Ease dev

    and QA workflow - Faster CI build = faster feedback loop - Cheaper CI
  6. New requirements - Different dependencies for China - Alternatives for

    the Firebase products: - Remote Config - Cloud Messaging - Analytics - …
  7. Nice-to-have goals - The unused deps are not compiled nor

    packaged in the app. - no Firebase deps in the app for China - no WeChat Pay in the UK build - Dev and tester experience preserved - “China” available in the country selector - Minimal impact in the dev workflow
  8. Arsenal: Layered Architecture 🚀 Separation between: - Data - Business

    Logic - UI More about that on: https://www.reddit.com/r/FlutterDev/comments/192h8l0/comment/kh3sm2w/
  9. - Centralize all the Firebase usage in one place (per

    Firebase Product) - Abstraction layer between the Firebase SDK and its usages - Specific main file for China, loading the non-Firebase implementation Draft of a solution
  10. Dev and tester experience preserved Previously (non-prod) Entry point initGlobalSingletons()

    {} InitializationHelper main() {} in main.dart Country Selector initCountrySingletons() {} Home Page InitializationHelper Splash screen setCountry() {} SettingsService
  11. Now (non-prod) Entry point initGlobalSingletons() {} InitializationHelperImpl main() {} in

    main.dart Country Selector initCountrySingletons() {} Home Page InitializationHelper Splash screen setCountry() {} SettingsService initCountrySingletons() {} initCountrySingletons() {} InitializationHelperChinaImpl InitializationHelperProdImpl
  12. Strip Flutter plugins - Native changes abstracted by Flutter -

    Manual changes in the native files kept as minimal as possible - pubspec.yaml is the main source of truth Non-prod Include all plugins (Firebase + the alternatives) China Strip the Firebase plugins Other countries Strip the chinese dependencies
  13. Native changes Less hack-y because we are in the native

    world Access to the flavor/configuration 🎉