Filter Lists in Dart

Use .where:

var elements = ['one', 'two', 'three', 'four'];

elements.where((f) => f.startsWith('t')).toList();

Subscribe to My Newsletter

The latest programming-related news, articles and resources - sent to your inbox monthly. Unsubscribe anytime.