The Flutter-based app for the DOLFIN Project. Note, there is a dev version of the code in a seperate repo that bipasses the verification with NPEU's databases so that we can create users and have access to the app through a dev version. Currently this is only available for Android. It's a hastle, but development is probably best done in the dev app first to test before transferring updates to this one.
Babies who are born very early, or who suffer poor blood supply or lack of oxygen to the brain before or around birth, are more likely to have problems with their brain development and child neurological development. This may affect how children think and learn, communicate, play, and interact with the world around them.
DOLFIN aims to answer the research question:
In babies who are born very early or who suffer poor blood supply or lack of oxygen to the brain before or around birth, does giving a nutritional supplement daily for a year improve long-term cognitive development?
PI: Jeremy Parr
RSEs:
This repository contains both 'DOLFIN App' & 'DOLFIN App Admin'.
The apps are identical with a key exception: Admin app is built with the .env
file pointing to the test API, while the DOLFIN App is the production ready version.
The production ready version is not accessible to anyone besides the trial participants. This also excludes both DOLFIN and RSE teams.
The application uses Flutter, which is written in Dart; both developed and maintained by Google.
Install the following to get started on the project:
$ dart fix
pubspec.yaml
file! Unless you are keen on predicate logicIf you have an instalation of Flutter already, and installed this using homebrew, you may not be able to downgrade Flutter. If this is the case, remove your Flutter installation and install only the required version using these instructions for installation and selecting the correct installation from here.
Determine whether you need Ruby (version manager) on a Mac
Developing on Mac requires you to install additional Ruby versions, which is not interfering with the system built-in one.
Recommended to check out rbenv. A Ruby version manager. chruby
is also a good alternative.
To determine if you need to install a Ruby Version manager, run:
$ which ruby
If it returns
$ /usr/bin/ruby
You need to install a ruby version manager for MacOS to develop iOS apps.
Refer to rbenv repo regarding installation.
Install Android Emulator
You want to set up an Android emulator with API 34 or above running Android 14 or above. Do this within Android Studio (Step 1)
The project is 80:20 split focused in favour of Android, recommended to use Android Studio throughout the development in general.
Install iOS Simulators
XCode 15 (or newer) will come pre-installed with the relevant up-to-date iOS simulators. No need to do anything else.
Run the following command to confirm you installed everything above correctly:
$ flutter doctor
If you see the following output, you are good to go:
.env
file on RSE Team OneDrive..env
file at root level of dolfin-flutter/
directoryYou need to configure the application on Android as well as on iOS with Firebase.
If you skip this step, you will have a hard time debugging what is going on with no errors showing.
google-services.json
file from Firebase.uk.ac.ncl.rse.dolfin
under package-name
.dolfin-flutter/android/app/
directoryRun the Android App for the first time
$ flutter pub get
$ flutter run
GoogleService-Info.plist
file from Firebasedolfin-flutter/ios/
directorydolfin-flutter/ios/Runner.xcodeproj
GoogleService-Info.plist
If it doesn't work, follow these steps.
Run the iOS App for the first time
$ flutter pub get
Pods
$ cd ios
$ pod install
$ flutter run
flutter build ipa
Following a successful build, ask Imre to sort the rest out.
# fastlane match development
# fastlane match appstore
# pod install
# bundle install
flutter build ipa
# bundle exec fastlane beta
The base icon image is specified in pubspec.yaml
and the relevant dependencies should be installed automatically.
To regenerate the icons (for Android and iOS), edit the master image file and then use the following commands:
flutter pub get
flutter pub run flutter_launcher_icons:main
This work was funded by a grant from the UK Research Councils, EPSRC grant ref. EP/L012345/1, “Example project title, please update”.