firstWhereLogTypeOrNull method

TalkerLogType? firstWhereLogTypeOrNull(
  1. bool test(
    1. TalkerLogType element
    )
)

The method allows you to get the first element that satisfies the condition or null if no element satisfies the condition.

Implementation

TalkerLogType? firstWhereLogTypeOrNull(
        bool Function(TalkerLogType element) test) =>
    cast<TalkerLogType?>()
        .firstWhere((v) => v != null && test(v), orElse: () => null);