Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 909 Bytes

File metadata and controls

27 lines (15 loc) · 909 Bytes

Switch Matrix in Dart 3

Did you know?

Since Dart 3, you can combine multiple variables into a record and replace if-else chains with a switch expression. ✅

This is known as a switch matrix and lets you apply pattern matching to multiple values at once. 👌


This tip was inspired by Pascal Welsch's talk about Records and patterns at FlutterCon.

Slides here:


Found this useful? Show some love and share the original tweet 🙏


Previous Next
Destructuring Lists in Dart Conditional JSON parsing in Dart 3