convert<F, T> function Null safety

T? convert<F, T>(
  1. F obj,
  2. {Transformer<F, T>? converter,
  3. Predicate<F>? predicate}
)

Implementation

T? convert<F, T>(F obj,
    {Transformer<F, T>? converter, Predicate<F>? predicate}) {
  final _predicate = predicate ?? (i) => i != null;
  return _predicate(obj) ? converter!(obj) : null;
}