Skip to content

lhartvik/On

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

on_app

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).

Features Preview

Logg Vis Stats
Login Dashboard Settings

Prerequisites

Install VS Code

Install Android Studio

Install Flutter

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.

Getting Started

  1. Generate a project
flutter create onlight
  1. Clone the code into the lib-folder
cd onlight
rm -rf lib
git clone git@github.com:lhartvik/On.git lib
  1. Open the onlight folder (above the lib folder) in Visual Studio Code

  2. 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

Various tips

Flutter doctor

flutter doctor sometimes tell you about issues with different tools.

Keep Android SDKs upgraded

Use Android Studio for upgrading and installing Android SDKs. Mark all "-" boxes so they turn into ticked checkboxes. Always check command line tools.

Difference between deploying to phone through usb and via Play Store

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.

Deploying a new version

IPhone

  <key>ITSAppUsesNonExemptEncryption</key>
  <false/>

into ios/Runner/Info.plist

  1. Update version number in pubspec.yaml. example "1.0.4+2" -> "1.0.5+3"
  2. go to flutter-build-folder, run flutter build ios
  3. Open ios-folder in xcode
  4. Test run the app in the Ios simulator
  5. Product - Archive
  6. A window should pop up with archives and versions. Choose the wanted version and click Distribute
  7. https://appstoreconnect.apple.com/login

Android

  1. 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
  2. flutter build android
  3. Open the android folder in Android Studio.
  4. Sign and create a aab(TODO: Add more details here)
  5. https://play.google.com/console

Code structure

main.dart

This is the starting point of all Flutter apps.

main()

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.

builder

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.

Screens

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

Widgets

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

Various helper classes

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

About

The new Parkinsontracker app

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages