gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

Alarm id issue #146

Closed rajnishsharma1 closed 9 months ago

rajnishsharma1 commented 9 months ago

Alarm plugin version alarm: ^3.0.7

Describe the bug

E/flutter (23387): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Alarm id cannot be set smaller than Int min value (-2147483648). Provided: 42
E/flutter (23387): #0      Alarm.alarmSettingsValidation (package:alarm/alarm.dart:104:7)

To Reproduce Steps to reproduce the behavior:

  1. Try setting up an alarm
  2. Code:

    final alarmSettings = AlarmSettings(
      id: 42,
      dateTime: dateTime,
      assetAudioPath: 'assets/alarm.mp3',
      loopAudio: true,
      vibrate: true,
      volume: 0.8,
      fadeDuration: 3.0,
      notificationTitle: 'This is the title',
      notificationBody: 'This is the body',
      enableNotificationOnKill: true,
    );
    
    await Alarm.set(alarmSettings: alarmSettings);

Device info Vivo, Android 12

tattuu commented 9 months ago

same issue here.

It is also occurring on iOS.

rajnishsharma1 commented 9 months ago

@tattuu It seems this issue is introduced in newer version alarm: ^1.2.1 is not having this issue.

pyjserv commented 9 months ago

I encountered the same issue. It was fine in version 3.0.6.

JosipDomazetDev commented 9 months ago

This pull request should resolve this issue, a "-" was missing. https://github.com/gdelataillade/alarm/pull/148

gdelataillade commented 9 months ago

Hi @rajnishsharma1 @tattuu @pyjserv @JosipDomazetDev

Really sorry about that, it was a silly issue. Thanks @JosipDomazetDev for your PR.

I just released version 3.0.8 with the fix.

JosipDomazetDev commented 9 months ago

Thanks for the merge, i just wanna mention it was the PR of @Rest00rer not mine, I just commented on both threads to make sure you see it as soon as possible ^^

gdelataillade commented 9 months ago

Alright, then thank you @Rest00rer then !