I'm trying to get GPS time in my flutter application, I'm able to get the device current time but as it can be changed in phone's setting and can't use Network provided time NTP because I'm using my application offline. Is there any flutter library from which I can get GPS date and Time (Not device time, satellite date and time) or any other solution to my problem?
Asked
Active
Viewed 721 times
1 Answers
0
I haven't tested this yet, but the location
package appears to provide the time in the LocationData
object: https://github.com/Lyokone/flutterlocation
Here's the time field: https://github.com/Lyokone/flutterlocation/blob/ab79cba664284ee44ed3f7076c1c2b3038187afc/packages/location_platform_interface/lib/src/types.dart#L81
Note that it is nullable and I've read that time data isn't available in all locations. You may want to combine this with an NTP offset solution that you can calculate while online for use offline.

Grahambo
- 467
- 5
- 11
-
I have tested it. I am using location 4.3.0. Unfortunately, it does not return time from satellite. Someone already created an issue https://github.com/Lyokone/flutterlocation/issues/351 – Haizad Annuar Oct 04 '22 at 04:00