countWithoutNull method

int countWithoutNull()
  • return the length without null elements

Implementation

int countWithoutNull() {
  /// create a new list
  final holder = List.from(this);

  /// remove null elements
  holder.removeWhere((element) => element == null);

  /// return the holder elements count
  return holder.length;
}