From 5287eed213a5f4abf9ff54f5d2cb12cac08413d1 Mon Sep 17 00:00:00 2001 From: Ilesh Thiada Date: Sat, 4 Feb 2023 23:56:44 +0530 Subject: [PATCH] Swap systolic and diastolic values to be more standard --- README.md | 2 +- docs/index.html | 1384 -------------------------------------------- docs/support.md | 2 +- lib/home_page.dart | 26 +- lib/main.dart | 2 +- 5 files changed, 16 insertions(+), 1400 deletions(-) delete mode 100644 docs/index.html diff --git a/README.md b/README.md index 1cd28fa..5dc0358 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ BP Logger is a Flutter app that allows you to keep track of your BP by logging it in a file in Google Drive. To use BP Logger, you must first sign in with Google. Then BP Logger will use your Google account to access your Google Drive (with your permission). -After that, BP Logger can add the date, time, diastolic, and systolic values to a GSheets file called log. +After that, BP Logger can add the date, time, systolic, and diastolic values to a GSheets file called log. ## Installing diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 2ff6cba..0000000 --- a/docs/index.html +++ /dev/null @@ -1,1384 +0,0 @@ - - - - - -support - -
-

BP Logger support

Want to see how BP Logger works? Want to modify or create your own customised version

Head over to BP Logger's open source repository

Installation

BP Logger is hopefully coming to the Play store soon!

Android

  1. Go to the releases page
  2. Under assets, download the APK file on the device you want to install the app on
  3. If your browser prompts you that APKs are dangerous, press OK. Don't worry, my app is malware free and you can verify that because it is open source
  4. Once the download is complete, package installer should prompt you to install the app. Click 'Install'

iOS

  1. Since the App Store sucks for developers, you have to sideload BP Logger using Altstore (Open this link for installation instructions)
  2. Go to the releases page
  3. Under assets, download the IPA file on your iPhone or iPad
  4. After you install Altstore, open it and go to the Apps tab and press the plus button in the top left
  5. Find and open the IPA file you downloaded
  6. The app will install but will be inaccessible after 7 days if you uninstall Altstore or Altserver

Usage

Sign in

When you open the app for the first time, the app will ask for a Google account. This account's Google Drive will be used to store your BP values. The BP values will be located in a folder called BP Logger and a file called log. The values are stored in a Google Sheets file so you can edit them, or import previous values.

When opening the app for the first time

  • The app prompts you to select a Google account
  • Choose the account that you want the BP values to be stored in
  • When asked, give permission for the app to use Google Drive, BP Logger can only edit and delete files created by itself
  • The next time you login, the app should automatically do so without you having to interact

Log values

You need to be connected to the internet to log your BP values!

  1. Enter your diastolic and systolic values in the respective fields
  2. If you would like to log values to other dates, press the edit button beside the date to change the date
  3. You can change the date to anything from today to 2 weeks before
  4. Once you are done entering the values, press the 'Add to logs' button in the bottom right
  5. The app should show a tick once the values have been successfully logged
  6. If the app shows a cross, then something went wrong. You can try again

Access log file

Instead of going to Google Drive everytime, you can use the app to acces the log file

  1. Open the drawer by either swiping from the left, or tapping the button in the top left
  2. You can also use this drawer to check which account is currenty signed in
  3. Click the second option, which says 'Access file'
  4. If you have Google Sheets or Google Drive, the file should open up in there, otherwise the Google Sheets website opens up

Switch accounts

You can use multiple accounts with BP Logger if you wish to log 2 seperate sets of BP values

To switch user:

  1. Open the drawer by either swiping from the left, or tapping the button in the top left
  2. Tap the first option, which says 'Log out'
  3. The app should reload itself and prompt you to select a Google account again
  4. If your account is not there, then you can add it

Help

If you keep getting an error, contact ileshkt@gmail.com for assistance

- - \ No newline at end of file diff --git a/docs/support.md b/docs/support.md index 4025701..40ccd05 100644 --- a/docs/support.md +++ b/docs/support.md @@ -43,7 +43,7 @@ When opening the app for the first time You need to be connected to the internet to log your BP values! -1. Enter your diastolic and systolic values in the respective fields +1. Enter your systolic and diastolic values in the respective fields 2. If you would like to log values to other dates, press the edit button beside the date to change the date 3. You can change the date to anything from today to 2 weeks before 4. Once you are done entering the values, press the 'Add to logs' button in the bottom right diff --git a/lib/home_page.dart b/lib/home_page.dart index 450f285..7c8e6d7 100644 --- a/lib/home_page.dart +++ b/lib/home_page.dart @@ -25,8 +25,8 @@ class HomePage extends StatefulWidget { class HomePageState extends State { DateTime date = DateTime.now(); - TextEditingController diastolicTEC = TextEditingController(); // Diastolic TextEditingController systolicTEC = TextEditingController(); // Systolic + TextEditingController diastolicTEC = TextEditingController(); // Diastolic late DriveHelper driveHelper = widget.driveHelper; // "Backend" interface final formKey = GlobalKey(); @@ -245,18 +245,18 @@ class HomePageState extends State { } else { return "Enter a value"; } - if (val > 120) { + if (val > 200) { return "Too high"; - } else if (val < 60) { + } else if (val < 100) { return "Too low"; } else { return null; } }, - controller: diastolicTEC, + controller: systolicTEC, decoration: const InputDecoration( border: OutlineInputBorder(borderSide: BorderSide()), - labelText: "Diastolic", + labelText: "Systolic", ), // Only digits, everything else gets rejected even if typed in inputFormatters: [FilteringTextInputFormatter.digitsOnly], @@ -276,20 +276,20 @@ class HomePageState extends State { } else { return "Enter a value"; } - if (val > 200) { + if (val > 120) { return "Too high"; - } else if (val < 100) { + } else if (val < 60) { return "Too low"; } else { return null; } }, - controller: systolicTEC, + controller: diastolicTEC, decoration: const InputDecoration( border: OutlineInputBorder(borderSide: BorderSide()), - labelText: "Systolic", + labelText: "Diastolic", ), - // Only digits everything else is rejected even of typed in + // Only digits, everything else gets rejected even if typed in inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, // Number only keyboard ), @@ -305,8 +305,8 @@ class HomePageState extends State { // Don"t run if values are not correct if (formKey.currentState!.validate()) { // Get values from TextFieldControllers - String diastolic = diastolicTEC.text; String systolic = systolicTEC.text; + String diastolic = diastolicTEC.text; // Dismiss keyboard once button is pressed FocusManager.instance.primaryFocus?.unfocus(); @@ -316,7 +316,7 @@ class HomePageState extends State { builder: (BuildContext context) { return FileAppendDialog( text: - "${DateFormat("d/M/y").format(date)}, ${DateFormat.Hm().format(DateTime.now())}, $diastolic, $systolic", + "${DateFormat("d/M/y").format(date)}, ${DateFormat.Hm().format(DateTime.now())}, $systolic, $diastolic", driveHelper: driveHelper, logFileID: widget.logFileID, ); @@ -324,8 +324,8 @@ class HomePageState extends State { barrierDismissible: false, ); - diastolicTEC.clear(); systolicTEC.clear(); + diastolicTEC.clear(); } }, ), diff --git a/lib/main.dart b/lib/main.dart index 92cfe72..4df9699 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -38,7 +38,7 @@ class MyAppState extends State { .catchError((error) async => await driveHelper.createFile( "log.csv", FileMIMETypes.file, - text: "Date, Time, Diastolic, Systolic", + text: "Date, Time, Systolic, Diastolic", parents: [appFolderID], ));