First thing, integrate your app with firebase.The covid tracker app uses the device id, location, Great circle distance plugin and realtime database to do the following.
- Get the current location of your device.
- Update your device current location to a real time database.
- Compare other device location using the app which is being updated to the realtime database with yours.
- The app uses vincenty formula to caluclate distance between you and other device using the app & within the hour.
- if the distance falls within the accepatble contact distance(in my case i set at 6m in the constant.dart file), the app records the user device as a contact.
- These contacts are stored for tracing purposes.
- After 14 days(required qurantine period) of making contact, the contacts are auto deleted.
! All these happens when the app is up or in the background. !Always make sure your location is turned on for realtime tracking of contacts.