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

Flutter: a journey of productivity and happiness

Flutter: a journey of productivity and happiness

Flutter is an open-source user interface toolkit developed by Google that allows you to create beautiful applications in record time without sacrificing code quality nor developer productivity.

With such an ambitious premise, I was very skeptical back at the beginning of 2018 when I tried Flutter for the first time that Flutter could check all the boxes; after all, there were already plenty of cross-platform solutions for mobile that promised all the gold in the world but ended up not quite meeting the expectations. However, this time, Flutter brought a big simile to my face immediately! Flutter is fun to learn, easy to test, highly performant, completely open-source, and has an incredibly community that is warm, welcoming, supportive, and incredibly active!

In this talk, I’d like to share with you my experience working with Flutter for more than two years: from big projects with hundreds of developers contributing daily to the codebase to small and fast-paced startups that need to validate their product as soon as possible.

C887ad592770a197f114d0a1d3e3a5a7?s=128

Jorge Coca

October 20, 2020
Tweet

Transcript

  1. Flutter - A journey of productivity and happiness -

  2. Once upon a time...

  3. In 2016

  4. What were we doing?

  5. What were we doing? → Company iOS first (more resources,

    earlier releases)
  6. What were we doing? → Company iOS first (more resources,

    earlier releases) → Client Java (and Kotlin later...)
  7. What were we doing? → Company iOS first (more resources,

    earlier releases) → Client Java (and Kotlin later...) → Patterns MVVM (custom), Dagger 2...
  8. What were we doing? → Company iOS first (more resources,

    earlier releases) → Client Java (and Kotlin later...) → Patterns MVVM (custom), Dagger 2... → Testing only unit tests
  9. What were we doing? → Company iOS first (more resources,

    earlier releases) → Client Java (and Kotlin later...) → Patterns MVVM (custom), Dagger 2... → Testing only unit tests → Backend no access/influence over APIs
  10. How it was supposed to be...

  11. None
  12. How it really was...

  13. None
  14. None
  15. None
  16. → No collaboration between teams

  17. → No collaboration between teams → Completely different release schedules

  18. → No collaboration between teams → Completely different release schedules

    → No Android internal dogfood
  19. → No collaboration between teams → Completely different release schedules

    → No Android internal dogfood → 100% oriented APIs towards iOS
  20. → No collaboration between teams → Completely different release schedules

    → No Android internal dogfood → 100% oriented APIs towards iOS → Zero confidence in success
  21. We needed a change

  22. A big change

  23. A new opportunity was presented to us: A redesign was

    coming that would allow us to challenge business processes and technology choices
  24. Doing the same thing would only lead to failure...

  25. We had a very ambitious goal

  26. We want to be able to regularly release our products

    across all brands, all platforms and all regions simultaneously, with the same feature capabilities.
  27. What can we do better?

  28. What can we do better? → Robust and predictable APIs

  29. What can we do better? → Robust and predictable APIs

    → Never say no to designers
  30. What can we do better? → Robust and predictable APIs

    → Never say no to designers → Be full stack and open to collaboration
  31. What can we do better? → Robust and predictable APIs

    → Never say no to designers → Be full stack and open to collaboration → Better understanding of business goals
  32. What can we do better? → Robust and predictable APIs

    → Never say no to designers → Be full stack and open to collaboration → Better understanding of business goals → Shorter feature cycle times
  33. What can we do better? → Robust and predictable APIs

    → Never say no to designers → Be full stack and open to collaboration → Better understanding of business goals → Shorter feature cycle times → Improve our developer experience
  34. Our mantra Create a platform that is developer friendly, scalable

    and performant, which provides safe experimentation and continuos deployment.
  35. After a 6 month long research...

  36. ...our conclusion was clear

  37. None
  38. What is Flutter? Flutter is Google's UI toolkit for building

    beautiful, natively compiled applications for mobile, web and desktop from a single codebase.
  39. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override

    Widget build(BuildContext context) { return MaterialApp(home: MyHomePage()); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Counter')), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('You have pushed the button this many times:'), Text('$_counter'), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), ); } }
  40. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override

    Widget build(BuildContext context) { return MaterialApp(home: MyHomePage()); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Counter')), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('You have pushed the button this many times:'), Text('$_counter'), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), ); } }
  41. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override

    Widget build(BuildContext context) { return MaterialApp(home: MyHomePage()); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Counter')), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('You have pushed the button this many times:'), Text('$_counter'), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), ); } }
  42. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override

    Widget build(BuildContext context) { return MaterialApp(home: MyHomePage()); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Counter')), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('You have pushed the button this many times:'), Text('$_counter'), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), ); } }
  43. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override

    Widget build(BuildContext context) { return MaterialApp(home: MyHomePage()); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Counter')), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text('You have pushed the button this many times:'), Text('$_counter'), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), ); } }
  44. ...but why Flutter? Flutter was chosen not only because we

    thought it was going to meet the needs, but because it was a risk mitigation strategy. We were considerably more likely to be successful and deliver the product we were asked to deliver by using Flutter. — Larry McKenzie, Tech Lead @ eBay Motors
  45. What does Flutter have to offer?

  46. None
  47. None
  48. None
  49. When we tried Flutter in 2018

  50. When we tried Flutter in 2018 → Fast development: Hot

    Reload
  51. When we tried Flutter in 2018 → Fast development: Hot

    Reload → Expressive UIs: Highly composable widgets
  52. When we tried Flutter in 2018 → Fast development: Hot

    Reload → Expressive UIs: Highly composable widgets → Native performance: 60fps
  53. When we tried Flutter in 2018 → Fast development: Hot

    Reload → Expressive UIs: Highly composable widgets → Native performance: 60fps → Testing: incredible tooling out of the box
  54. When we tried Flutter in 2018 → Fast development: Hot

    Reload → Expressive UIs: Highly composable widgets → Native performance: 60fps → Testing: incredible tooling out of the box → Works on any UI environment
  55. Flutter is like Picasso you can ask it to paint

    anything, anywhere, and it will deliver outstanding results
  56. What about Dart?

  57. What about Dart? → Client-optmized language for fast apps on

    any platform
  58. What about Dart? → Client-optmized language for fast apps on

    any platform → Feels natural and familiar
  59. What about Dart? → Client-optmized language for fast apps on

    any platform → Feels natural and familiar → Future API (async-await)
  60. What about Dart? → Client-optmized language for fast apps on

    any platform → Feels natural and familiar → Future API (async-await) → Isolate-based concurrency
  61. Future<void> fetchTemperate() async { final response = await http.get('weather.com'); if

    (response.statusCode == 200) { print('Temperature: ${response.body}'); } else { throw Exception('Failed fetching temperature'); } }
  62. What about the Dart & Flutter community?

  63. What about the Dart & Flutter community? → Vibrant and

    welcoming community
  64. What about the Dart & Flutter community? → Vibrant and

    welcoming community → Started Chicago Flutter
  65. What about the Dart & Flutter community? → Vibrant and

    welcoming community → Started Chicago Flutter → Incredible documentation and tutorials
  66. What about the Dart & Flutter community? → Vibrant and

    welcoming community → Started Chicago Flutter → Incredible documentation and tutorials → Amazing conferences
  67. ... and many other benefits

  68. ... and many other benefits → UI described as a

    tree (widget tree)
  69. ... and many other benefits → UI described as a

    tree (widget tree) → Multiple state management solutions
  70. ... and many other benefits → UI described as a

    tree (widget tree) → Multiple state management solutions → 3 levels of testing without 3rd party dependencies
  71. In 2020...

  72. None
  73. Very Good Ventures is...

  74. Very Good Ventures is... → 100% focused on Flutter

  75. Very Good Ventures is... → 100% focused on Flutter →

    First in Flutter: Hamilton. The Musical
  76. Very Good Ventures is... → 100% focused on Flutter →

    First in Flutter: Hamilton. The Musical → Experts in Flutter: Google, The New York Times, Betterment, Policygenius, Good Money...
  77. How do we use Flutter?

  78. How do we use Flutter? → 3-tier architecture (data, domain,

    UI)
  79. How do we use Flutter? → 3-tier architecture (data, domain,

    UI) → flutter_bloc
  80. How do we use Flutter? → 3-tier architecture (data, domain,

    UI) → flutter_bloc → 100% test coverage
  81. How do we use Flutter? → 3-tier architecture (data, domain,

    UI) → flutter_bloc → 100% test coverage → Strong focus on automation
  82. I have worked with Ruby on Rails, Angular, iOS (Objective-C

    & Swift), Android (Java & Kotlin)... and nothing has brought more happiness to me than Flutter
  83. Flutter has made me a better person... and a better

    developer
  84. It has been a pleasure!

  85. It has been a pleasure! → Very Good Ventures (jorge@verygood.ventures)

  86. It has been a pleasure! → Very Good Ventures (jorge@verygood.ventures)

    → Google Developer Expert (GDE) for Flutter
  87. It has been a pleasure! → Very Good Ventures (jorge@verygood.ventures)

    → Google Developer Expert (GDE) for Flutter → Instructor @ Caster.IO (Testing Fundamentals of Flutter)
  88. It has been a pleasure! → Very Good Ventures (jorge@verygood.ventures)

    → Google Developer Expert (GDE) for Flutter → Instructor @ Caster.IO (Testing Fundamentals of Flutter) → Chicago Flutter Meetup
  89. The End Happy Coding! !"