array_playground
Useful extensions for Lists
Hecho en 🇵🇷 por Radamés J. Valentín Reyes
Import
import 'package:array_playground/array_playground.dart';
AsyncRemoveWhere
An async function to remove all items where the function's criteria isn't met.
List<int> dataArray = [15,18,11,25,63];
print("Original array:");
print(dataArray);
await dataArray.asyncRemoveWhere((a)async{
return (15 < a && a <= 25);
});
print("Resulting array:");
print(dataArray);
Chunkify array
List<int> dataArray = [15,18,11,25,63];
List<List> chunkifiedArray = dataArray.chunkify(2);
print(chunkifiedArray);//Output [[15, 18], [11, 25], [63]]