-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
It would be convinient to have variation of first property as method that would allow something to get first element, or produce default value insteaf of throwing wrong state exception..
Right now I am doing something like this (to avoid extra var)
var val=myList.where((i)=>i.x>5).map((i)=>i.y).firstWhere((v)=>true), orElse:()=>someDefaultValue
while I would like to terminate like this:
var val=myList.where((i)=>i.x>5).map((i)=>i.y).firstOrElse(()=>defaultValue);
ThinkDigitalSoftware
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug