Dart 3.0 introduces a long-awaited feature called Pattern Matching. This feature allows us to remove a lot of verbose and boilerplate code when matching values based on constants, conditional operators, records, lists, maps, casts and objects.
In this coffee break codelab, you'll explore:
-
What is Pattern matching and how does it work?
-
Using Pattern Matching with Constant Value
-
Using Pattern Matching with Conditional Operators
-
Using Pattern Matching with Records
-
Using Pattern Matching for Destructuring Values
-
Using Pattern Matching for Sealed Classes
-
Using Pattern Matching to extract items from a List
-
Using Pattern Matching for Maps in for-loops