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

Matthias Friedrich - Production Flutter'ing

Matthias Friedrich - Production Flutter'ing

droidcon Berlin

July 10, 2018
Tweet

More Decks by droidcon Berlin

Other Decks in Programming

Transcript

  1. @mtthsfrdrch About me • Doing Android dev since 2009 ◦

    Native & hybrid ◦ Full custom software, as well as featured in Play • Never convinced by any cross-platform/hybrid app solution … so far ...
  2. @mtthsfrdrch When people hear Cross-Platform ... Hard to integrate system-features

    Bad performance Bad developer experience Non native UI Feature/Update gap
  3. @mtthsfrdrch Mobile @ Creator LiveChat Booking Analytics • Several native

    apps • 2 developers per platform • Mobile apps for brand awareness, upselling & user engagement • Progressive culture, encouraged to take risks
  4. @mtthsfrdrch BOOST • A new companion app for website owners

    • Purely Jimdo backend driven -> no deep hardware integration • Brand design instead of high platform familiarity
  5. @mtthsfrdrch • Modern, reactive & flexible UI framework • Fast

    development • Powered by Dart • Native performance • Platform independence
  6. @mtthsfrdrch • Mature core libraries • New focus on client

    dev • Dart 2.0 ◦ Statically typed • Just In Time - compilation • Ahead Of Time - compilation
  7. “I wish it had a little more razzle dazzle but

    I can’t deny that literally on my first day of writing Dart code, I was productive in it.” A Google software engineer https://www.dartlang.org/faq#q-why-isnt-dart-syntax-more-excitin g
  8. @mtthsfrdrch Using REST Apis • Jaguar ◦ Dev time tool

    to generate mapping code ◦ pub.dartlang.org/packages/jaguar_serializer ◦ pub.dartlang.org/packages/jaguar_http • No reflection (dart: mirrors) with Flutter
  9. @mtthsfrdrch Using REST Apis ◦ Existing Dart support ◦ Was

    based on dart:mirrors (reflection) ◦ Reworked the Dart code generator ◦ swagger.io • Swagger-API
  10. @mtthsfrdrch Crash Reporting • Only SDK we found: Sentry.io ◦

    Sends logs to Sentry ◦ No “catch logic” • No Crashlytics support yet :(
  11. @mtthsfrdrch Crash Reporting // catches Errors outside the Flutter framework

    !!! runZoned(() { runApp(new FlipperApp()); }, onError: (error, stack) { errorHandler.onError(error, stack); });
  12. @mtthsfrdrch Crash Reporting onError(Object error, StackTrace stack) async { if

    (isReleaseBuild()) { await sentry.captureException( exception: error, stackTrace: stack,); if (!(error is BackgroundException)) exit(255); } }
  13. @mtthsfrdrch Background execution • No Dart execution without a screen!

    • Push-Notifications? ◦ Yes, but purely backend driven • Solution is on the way: github.com/flutter/issues/3671 • For now -> Keep user data on native side ◦ Platform channels
  14. @mtthsfrdrch More ... • Testing ◦ Unit tests ◦ Widget

    tests ◦ Integration tests • CI: using TravisCI with Fastlane • Localisation ◦ Create your own based on JSON
  15. @mtthsfrdrch Mobile apps with Non native UI Hard to integrate

    with system-features Bad developer experience Material Design Bad performance Feature/Update gap Compiled to NATIVE Platform Channels Maintained by HO L A
  16. @mtthsfrdrch • Native SDK work is not going away anytime

    soon ◦ Apps become modular (f.e. Slices, Actions, rich Notifications, Instant Apps) • Still early: you will face (small) problems … … but get rid off 10 years old UI frameworks! … but on full fledged in app UI, Flutter is already ahead!
  17. @mtthsfrdrch After using Flutter, coming back to AndroidDev felt like

    working with your hands bound behind your back!