Open gdelataillade opened 11 months ago
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days
Any update on this ?
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days
Internally, the plugin will convert the params sent from JSONObject
to a serialized String to schedule the alarm.
It is during this serialization, when the params get added to the Android Intent
extras that the type gets lost.
e.g. scheduling an alarm with:
params: {
'a': 0.toDouble(),
'b': 1.3,
},
inspecting the extras using a debugger:
The deserialize action doesn't know if 0
is a double, so it defaults to int
, which is what gets sent back to the Flutter layer.
I am not sure if an easy fix is possible here, as the conversion from 0.0
to 0
happens in the JSONObject
serialization and we cannot control.
My recommendation would be to either do the recast/parsing back on the Flutter layer, or send all numbers as Strings, to avoid losing the type information due to the serialization/deseralization that happens internally.
If anyone has a better solution, feel free to submit a PR.
Platform
Android 11
Plugin
android_alarm_manager_plus
Version
3.0.2
Flutter SDK
3.13.5
Steps to reproduce
AndroidAlarmManager.oneShotAt
with asparams
a map with a value of type double.params
map in my isolate method but my value of type double became an integer.Code Sample
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean