array_playground 0.0.2+2 copy "array_playground: ^0.0.2+2" to clipboard
array_playground: ^0.0.2+2 copied to clipboard

outdated

Useful extensions for Lists

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);

Multi threaded remove where #

List<int> dataArray = [15,18,11,25,63];
dataArray = (await dataArray.multiThreadRemoveWhere((item){
  if(item == 11){
    return true;
  }else{
    return false;
  }
})).cast<int>();

Chunkify array #

List<int> dataArray = [15,18,11,25,63];
List<List> chunkifiedArray = dataArray.chunkify(2);
print(chunkifiedArray);//Output [[15, 18], [11, 25], [63]]

Contribute/donate by tapping on the Pay Pal logo/image #


0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Useful extensions for Lists

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on array_playground