dart List Filters

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Dart filters lists through the List.where and List.retainWhere methods. The where function takes one argument: a boolean function that is applied to each element of the list. If the function evaluates to true then the list element is retained; if the function evaluates to false, the element is removed.

Calling theList.retainWhere(foo) is practically equivalent to setting theList = theList.where(foo).



Got any dart Question?