Have you ever wondered how to go from an idea to an app with Flutter? In our new Flutter From Scratch video series, Lewis Cianci shows the whole process.

The Flutter From Scratch series covers everything from how to make an attractive looking app on Android Studio and architect it correctly all the way to getting the configuration right on Codemagic CI/CD to ship your app to app stores.

Episode 4: Testing with Flutter

Welcome back for the fourth episode of Flutter From Scratch! In this episode, we take a look at how to effectively test our Flutter application. We start to learn what we should unit test and how to mock our dependencies, and we also take a look at Widget and Integration testing. High-quality tests mean high-quality apps!

Prerequisites:

Please make sure you watch the third episode of Flutter From Scratch before watching this episode.

Clone the Sonder project.

0:39 - What should we unit test?

1:54 - What we will test in Sonder

2:51 - Our first simple unit test

5:11 - Running the unit test

5:26 - Mocking dependencies for our second unit test

5:42 - Using abstract classes to help mocking

7:29 - Unit test using a mocked service

8:12 - Overview of other types of testing

💥Try the following challenge after watching💥 Can you make the app show ‘Evening Sonder’ in addition to its two current ‘Morning’ and ‘Afternoon’ cases? And better still, can you write a test that passes after doing so?

If you have any questions or something you definitely want to be covered in the upcoming episodes, let us know on the Codemagic Slack channel.

Be sure to subscribe to Codemagic Youtube channel to see our next episodes!

Lewis Cianci is a software developer in Brisbane, Australia. His first computer had a tape drive. He’s been developing software for at least ten years and has used quite a few mobile development frameworks (like Ionic and Xamarin Forms) in his time. After converting to Flutter, though, he’s never going back. You can reach him at his blog, read about other non-fluttery things at Medium, or maybe catch a glimpse of him at your nearest and fanciest coffee shop with his dear wife.

More videos by Lewis: