DynamicExt extension

Extension on dynamic providing conditional mapping operations.

This extension adds utility methods for transforming nullable dynamic values.

on
  • dynamic

Methods

mapIfNotNull<I, R>(R mapper(I input), {R? defaultValue}) → R?

Available on dynamic, provided by the DynamicExt extension

Maps this value using mapper if it's not null, otherwise returns defaultValue.