add<T> method

T add<T>({
  1. required String? key,
  2. required T? value,
})

Add value to map if value is not null

Implementation

T add<T>({required String? key, required T? value}) =>
    putIfAbsent(key, () => value);