async_filter 1.0.0 copy "async_filter: ^1.0.0" to clipboard
async_filter: ^1.0.0 copied to clipboard

A library for filtering lists, sets, and maps asynchronously.

A library that provides methods to filter lists, sets, and maps asynchronously.

Getting started #

Add the package to your pubspec.yaml file:

dependencies:
  async_filter: ^1.0.0
copied to clipboard

Afterward, import the package:

import 'package:async_filter/async_filter.dart';
copied to clipboard

Usage #

This package provides an asyncFilter method for lists, sets, and maps. The method takes a predicate function that returns a Future<bool> and filters the collection asynchronously.

The predicate is executed for all elements in parallel.

Example:

final numbers = <int>[1, 2, 3, 5, 6, 7];
var result = await numbers.asyncFilter((x) async => x < 5); // (1, 2, 3)
result = await numbers.asyncFilter((x) async => x > 5); // (6, 7)
result = await numbers.asyncFilter((x) async => x.isEven); // (2, 6)
copied to clipboard
0
likes
160
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

2024.10.02 - 2025.04.16

A library for filtering lists, sets, and maps asynchronously.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on async_filter