firstOrCompute method

T firstOrCompute(
  1. T compute()
)

First element, or result of compute if empty. Audited: 2026-06-12 11:26 EDT

Implementation

T firstOrCompute(T Function() compute) => isEmpty ? compute() : first;