UserSnoozePeriodSetRequest constructor Null safety

UserSnoozePeriodSetRequest(
  1. {required bool enable,
  2. DateTime? startDate,
  3. DateTime? endDate,
  4. String? userId}
)

Implementation

UserSnoozePeriodSetRequest({
  required bool enable,
  DateTime? startDate,
  DateTime? endDate,
  String? userId,
}) : super(userId: userId) {
  url = 'users/${userId ?? state.userId}/push_preference';
  body = {
    'snooze_enabled': enable,
    if (startDate != null)
      'snooze_start_ts': startDate.millisecondsSinceEpoch,
    if (endDate != null) 'snooze_end_ts': endDate.millisecondsSinceEpoch
  };
}