UserDoNotDisturbSetRequest constructor Null safety

UserDoNotDisturbSetRequest(
  1. {required bool enable,
  2. int startHour = 0,
  3. int startMin = 0,
  4. int endHour = 23,
  5. int endMin = 59,
  6. String timezone = 'UTC',
  7. String? userId}
)

Implementation

UserDoNotDisturbSetRequest({
  required bool enable,
  int startHour = 0,
  int startMin = 0,
  int endHour = 23,
  int endMin = 59,
  String timezone = 'UTC',
  String? userId,
}) : super(userId: userId) {
  url = 'users/${userId ?? state.userId}/push_preference';
  body = {
    'do_not_disturb': enable,
    'start_hour': startHour,
    'start_min': startMin,
    'end_hour': endHour,
    'end_min': endMin,
    'timezone': timezone
  };
}