~/talk

Exploring Records and Patterns

Talkat Droidcon London 2023 · 2023-10-26..10-27· [java]
slides:none on file

Dart 3 adds records and pattern matching that create positional/named tuple types, auto-generate equals/hashCode, and are immutable but lack a built-in copyWith; records compile to hidden Record classes and cannot override equality, so list and function contents can break equals semantics. Destructuring works for records, lists, maps and objects (not unordered sets), single-element records require a trailing comma, and future.wait returns typed record for up to nine futures. Switch expressions are exhaustive with sealed classes but differ from switch statements in eight syntax/behavior ways and single-element record needs trailing comma; be cautious changing public APIs because adding record fields is breaking and records are immutable and auto-generate equals/hashCode.

AI-written summary · about

  1. 0:00Introduction and context
  2. 2:12Records in Dart
  3. 8:53Records pitfalls and immutability
  4. 12:49Records and code sharing
  5. 13:09Destructuring records
  6. 16:42Records in public APIs
  7. 17:26Single-element records
  8. 18:08Future.wait with records
  9. 19:13Destructuring lists and maps
  10. 21:43Destructuring objects
  11. 22:04Destructuring state objects
  12. 23:10Pattern matching introduction
  13. 25:15Switch expressions vs cases
  14. 28:49Switch expression features
  15. 30:15Sealed classes and exhaustiveness
  16. 31:42If-case pattern matching
  17. 32:27Matrix matching with records
  18. 33:29Future of Dart features
  19. 34:30Call to action and best practices
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.