Skip to content

Latest commit

History

History
20 lines (12 loc) 路 647 Bytes

File metadata and controls

20 lines (12 loc) 路 647 Bytes

Get a single item from a list

When working with lists in Dart, you can use single to:

  • check if a list has only one element, and return that element
  • throw an error if the list is empty or has more than one element

Useful when you run a function that returns a list with only one item. 馃憤


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


Previous Next
The Accessibility Tools package Using serverTimestamp() in Firestore