Testing Everything in Flutter
summary
A small GIF Review app is used to show three concrete test layers: fast pure Dart unit tests (example: an average-of-ratings function), widget tests that require wrapping widgets with Directionality and can pump/pumpAndSettle for animations, and slow device-level driver tests that require enableFlutterDriverExtension and running flutter_driver on app.dart. Dependency injection via constructor/provider/get_it makes fakes or Mockito mocks usable; network images fail with HTTP 400 in tests so add mock_network_image_for to return an empty image. Aim for ~70% coverage.
AI-written summary · about
chapters (12)
- 0:00Introduction to testing in Flutter
- 1:16Types of Flutter tests overview
- 3:45Writing pure Dart tests
- 6:37Introduction to widget tests
- 10:54Running driver tests on devices
- 15:28Comparing test types in Flutter
- 16:51Making code easier to test
- 21:07Fakes vs mocks for dependencies
- 25:23Test pyramid and coverage in Flutter
- 31:09Edge cases in Flutter testing
- 35:47Recap and new testing features
- 36:55Q&A on native code testing
related talks
27mFast Prototypes with Flutter + Kotlin/Native
51mAndroid TDD with Kotlin
01h 00mFuture-Proof Mobile Cross-Platform Apps with Flutter
40mEffective TDD on Android with Kotlin
51mDeveloper Keynote
01h 11mWorkshop. Cross-platform ² — Befriending Flutter and Kotlin Multiplatform
54mKotlin all the... tests!
34mAndroid with a side of Flutter, please
