add method Null safety

DateTime add(
  1. Duration duration
)

Returns a new DateTime instance with duration added to this.

final today = DateTime.now();
final fiftyDaysFromNow = today.add(const Duration(days: 50));

Implementation

DateTime add(Duration duration) => _value.add(duration);