roundUp method

DateTime roundUp({
  1. Duration delta = const Duration(minutes: 15),
})

Implementation

DateTime roundUp({Duration delta = const Duration(minutes: 15)}) {
  return DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch +
      (delta.inMilliseconds - millisecondsSinceEpoch % delta.inMilliseconds));
}