remove_null_from_list 0.1.0 remove_null_from_list: ^0.1.0 copied to clipboard
An extension method for the List class that removes all null values from the list.
remove_null_from_list #
An extension method for the List class that removes all null values from the list.
Usage #
import 'package:remove_null_from_list/remove_null_from_list.dart';
Importing remove_null_from_list adds a single extension method to the [List] class
called [removeNull], which removes all null
values from the calling list.
final List<String> myList = <String>['a', 'b', null, 'd', null, 'f', 'g'];
myList.removeNull();
print(myList); // ['a', 'b', 'd', 'f', 'g']