On is an app for Android and Ios mobile devices for helping people with Parkinsons track periods when the medicine takes effect(you are On) and stops working(you are Off).
| Logg | Vis | Stats |
|---|---|---|
![]() |
![]() |
![]() |
It is possible that you need a Mac to deploy the app to an Iphone or test the app on an Ios Simulator, but it should look and work the same on Android.
- Generate a project
flutter create onlight
- Clone the code into the lib-folder
cd onlight
rm -rf lib
git clone git@github.com:lhartvik/On.git lib
-
Open the onlight folder (above the lib folder) in Visual Studio Code
-
Open each dart file, select the missing dependencies and press Command or Ctrl . to have VS Code add the missing dependencies to pubspec.yaml. These will change over time but at the time of writing this, these are the dependencies used.
collection: ^1.19.1
intl: ^0.20.2
path: ^1.9.1
provider: ^6.1.2
sqflite: ^2.4.2
uuid: ^4.5.1
flutter doctor sometimes tell you about issues with different tools.
Use Android Studio for upgrading and installing Android SDKs. Mark all "-" boxes so they turn into ticked checkboxes. Always check command line tools.
Permissions seems to be unneccessary when directly connected to PC. Keep track of what device features you introduce(Using the Internet, Location, Camera, etc) and add those to the Android manifest before creating an apk. You will sometimes get warnings in the app store that tells you about missing permissions, but don't lean on this.
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
into ios/Runner/Info.plist
- Update version number in pubspec.yaml. example "1.0.4+2" -> "1.0.5+3"
- go to flutter-build-folder, run
flutter build ios - Open ios-folder in xcode
- Test run the app in the Ios simulator
- Product - Archive
- A window should pop up with archives and versions. Choose the wanted version and click Distribute
- https://appstoreconnect.apple.com/login
- Update version number in pubspec.yaml. Example "1.0.4+2" -> "1.0.5+3". The "Version code" behind the + is more important on Play Store
flutter build android- Open the android folder in Android Studio.
- Sign and create a aab(TODO: Add more details here)
- https://play.google.com/console
This is the starting point of all Flutter apps.
Two things happen here.
- Date formatting is initialized since we live in a sivilized country and don't want to show dates in the weird US format.
- The change notifier is initialized on top of the tree so any sub widgets are able to listen to it.
Initialization in the main method depends on the app bindings being fully initialized, so WidgetsFlutterBinding.ensureInitialized must be run first.
The app is also wrapped in a mediaquery to make sure the 24h time format is always used.
The Theme colors are generated by Flutter's awesome color generator. All I have to supply is a seed color.
OnScreen: The screen for registering events
ViewScreen: A screen for viewing raw events and making some modifications
StatsScreen: A screen for getting helpful data, hopefully
Day stats: Presents stats for one day
Log button: The buttons that log an event
Med dilution graph: The concentration of medicine in the body
Med on-off log: The timeline of ons and offs between doses
LocalDBHelper: Communicates with the SQLite database
MedOnOffLog: Holds the information for on and off between one dose and the next dose
Statistics: Holds the values for time since last dose and time since last log


