also method

T? also(
  1. void block(
    1. T it
    )
)

Executes block if value is not null, returns the original value Usage: user?.also((it) => print(it.name))

Implementation

T? also(void Function(T it) block) {
  final self = this;
  if (self != null) {
    block(self);
    return self;
  }
  return null;
}