This project aims to provide a feedback system for SOS.
Getting Started:
Useful Resources:
Dependency Reference:
Table of Contents:
Git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
MacOS: https://git-scm.com/download/mac
- Git is bundled with Xcode so we will install that now
- Open the App Store
- Search for
Xcode
- Click Install
Windows: https://git-scm.com/download/win
- You may want to change the default text editor (Vim is hard)
- All other default installer settings are fine
Dart: https://dart.dev/tools/sdk/archive
MacOS: Download the x64 zip
- Open Finder
- Click Go > Home
- Create a folder called
Development
- Move the dart zip into the
Development
folder - Double click on the dart zip file
Windows: Download the x64 installer
- Dart is just an archive you need to extract
- Create the directory
C:\src
and extract dart inside of this folder
Flutter: https://flutter.dev/docs/get-started/install
MacOS: https://flutter.dev/docs/get-started/install/macos
- Download flutter, big blue button
- Open Finder
- Click Go > Home
- Move the flutter zip into the
Development
folder from yourDownloads
folder - Double click on the flutter zip file
Windows: https://flutter.dev/docs/get-started/install/windows
- Download flutter, big blue button
- Flutter is just an archive you need to extract
- Extract Flutter into
C:\src
MacOS: The OS manages path variables through a terminal configuration file. From Catalina on Mac uses ZSH as its terminal. Prior to Catalina it uses BASH.
Determine your shell type:
- Click Launchpad
- Type
terminal
- Click on Terminal
- Type
echo $SHELL
- Press Enter
/bin/zsh
– Means you are using ZSH/bin/bash
– Means you are using BASH
If you know your shell type:
- Based on your shell:
- ZSH: Type
nano $HOME/.zshrc
- BASH: Type
nano $HOME/.bashrc
- ZSH: Type
- Press Enter
- Add the lines to the file
export PATH=”$PATH:$HOME/Development/flutter/bin”
export PATH=”$PATH:$HOME/Development/dark-sdk/bin”
- Press control + O to save the file
- Press control + X to exit
- Close your terminal for changes to take effect
Windows:
14. Click Start
15. Type env
16. Click Edit the system environment variables
17. Click Environment Variables…
18. In the upper window click Path
19. Click Edit…
20. Click New
21. Add the following two paths to the end of the list
C:\src\dart-sdk\bin
C:\src\flutter\bin
22. Click OK
23. Click OK
24. Click OK
25. Close command prompt for changes to take effect
MacOS:
- Click Launchpad
- Type
terminal
- Click on Terminal
- Type
which flutter dart
- Press Enter
- If your path is correct you should see the following:
/Users/USERNAME/Development/flutter/bin/flutter
/Users/USERNAME/Development/dark-sdk/bin/dart
Windows:
- Click start
- Type
command
- Click Command Prompt
- Type where dart flutter
- Press Enter
- If your path is correct you should see the following:
C:\src\dart-sdk\bin\dart.exe
C:\src\flutter\bin\flutter
C:\src\flutter\bin\flutter.bat
Android Studio: https://developer.android.com/studio#downloads
MacOS: Download the 64-bit dmg
- Double click the dmg file
- Drag the Android Studio icon to the Applications icon
- Click Launchpad
- Open Android Studio
- You may have to accept a dialog about the app being untrusted
- It is going to download the android SDK (default options are fine)
- When the studio opens to the main menu, click Configure > Plugins
- Click Marketplace (It may take a bit for the plugin list to build)
- Type
flutter
- Click Install
- Click Install
- Click Restart IDE
- Click Restart
Windows: Download the 64-bit exe
- All the default installer settings are fine
- Open the Android Studio
- It is going to download the android SDK (default options are fine)
- When the studio opens to the main menu, click Configure > Plugins
- Click Marketplace (It may take a bit for the plugin list to build)
- Type
flutter
- Click Install
- Click Install
- Click Restart IDE
- Click Restart
- Click Launchpad
- Type
terminal
- Click on Terminal
- Type
sudo gem install cocoapods
- Press Enter
- Enter your password and press Enter
- Type
pod setup
- Press Enter
MacOS:
- Click Launchpad
- Type
terminal
- Click on Terminal
- Type
sudo xcode-select –switch /Applications/Xcode.app/Contents/Developer
- If you are using a beta version of Xcode replace
Xcode.app
withXcode-beta.app
- If you are using a beta version of Xcode replace
- Press Enter
- Enter your password and press Enter
- Type
sudo xcode -runFirstLaunch
- Press Enter
- Enter your password and press Enter
- Type
flutter doctor
- Press Enter
- Your only error should be about connected devices
Windows:
13. Click start
14. Type command
15. Click Command Prompt
16. Type flutter doctor –android-licenses
17. Press Enter
18. You will have to type the letter y
after each prompt and press Enter
19. Type flutter doctor
20. Press Enter
21. Your only error should be about connected devices
MacOS:
- Create a folder on your
Desktop
calledSOS_DEV
- Click Launchpad
- Type
terminal
- Click on Terminal
- Type
cd $HOME/Desktop/SOS_DEV
- Press Enter
- Type
git clone https://github.com/SOScodeteam/sos_app
- In your folder
SOS_DEV
on theDesktop
you should now have a folder calledsos_app
Windows:
- Create a folder on your
Desktop
calledSOS_DEV
- Click start
- Type
command
- Click Command Prompt
- Type
cd %homepath%\Desktop\SOS_DEV
- Press Enter
- Type
git clone https://github.com/SOScodeteam/sos_app
- In your folder
SOS_DEV
on theDesktop
you should now have a folder calledsos_app
MacOS:
- Open Android Studio
- Click Open an existing Android Studio project
- Browse to
Desktop\SOS_DEV
- Highlight
sos_app
- Click Open
- Click Android Studio > Preferences > Language & Frameworks > Flutter
- Set the Flutter SDK path:
/Users/USERNAME/Development/flutter
- Make sure USERNAME is the account name on your mac
- Click OK
- Click Android Studio > Preferences > Language & Frameworks > Dart
- Set the Dart SDK path:
/Users/USERNAME/Development/dart-sdk
- Make sure USERNAME is the account name on your mac
- Click OK
- Click Tools > Flutter > Flutter Pub Get
- Click Tools > Flutter > Flutter Upgrade
Windows:
- Open Android Studio
- Click Open an existing Android Studio project
- Browse to
C:\Users\USERNAME\Desktop\SOS_DEV
- Make sure USERNAME is the account name on your pc
- Click on
sos_app
- Click OK
- Click File > Settings > Language & Frameworks > Flutter
- Set the Flutter SDK path:
C:\src\flutter
- Click OK
- Click File > Settings > Language & Frameworks > Dart
- Set the Dart SDK path:
C:\src\flutter\bin\cache\dart-sdk
- Click OK
- Click Tools > Flutter > Flutter Pub Get
- Click Tools > Flutter > Flutter Upgrade
It is possible to run the android emulator on MacOS. The setup is just like the windows setup below. iOS emulators on Windows are not possible.
MacOS (iOS):
- Click Launchpad
- Type
terminal
- Click on Terminal
- Type
open -a simulator
- Press Enter
- Type
cd $HOME/Desktop/SOS_DEV/sos_app
- Press Enter
- Type
open ios/Runner.xcworkspace
- Press Enter
- In the left pane click on Runner. It has a blue icon near it
- In the middle pane click on Signing & Capabilities
- Next to Team click and select Add an Account
- You now need to sign in with your apple developer account
- Back in the terminal type
flutter run
Windows (android):
- With the project open inside Android Studio
- Click in the top right of the tool bar on the AVD Manager icon
- It's a phone with a small green alien head in the lower right corner of the phone
- Click + Create Virtual Device…
- Click on a device (eg. Pixel 3)
- Click Next
- Click Download next to the highest API Level (eg. 30)
- Click Finish
- Click Next
- Click Finish
- Click the Play button under the Actions column
- Close the AVD Manager
- Click on
<no devices>
and select Open Android Emulator Pixel 3 API 30 - An emulator should open, you will see Android booting up
- Click the green Play button, if you have no coding errors the app will display on the emulator
The way git works is there is a local repository (your computer) that you commit your changes to first and then you push those commits to the remote repository (GitHub).
Local Commit:
- In Android Studio: click VCS > Commit
- Enter a commit message
- Don't be lame and have vague commit messages. Tell others what you are changing.
- Click Commit
- It may ask for your GitHub username and email. Just use the same for your GitHub account
- Click Set and Commit
Remote Push:
- In Android Studio: VCS > Git > Push
- Click Login In with GitHub...
- Input your username, password and authenticator code if asked
- You will need to be added as a contributor to the
SOScodeteam
with write permissions to theSOS_App
- You will need to be added as a contributor to the
- You should see the local commits that have not been pushed to the remote repository
- Click Push
Folders
- lib: Where all the coding for the app is done.
- android: contains the build instructions for the android version of the app.
- ios: contains the build instructions for the iOS version of the app.
- assets: Contains images/fonts to be used in the project
Files
- pubspec.yaml: Controls dependencies. If you want to use an external library, you will add it here. After you add it you will need to do a Flutter Pub Get. You can also add images and fonts to the project via this file.
- readme.md: This file! It's the how to for this app.
- Helpful readme Editor: https://stackedit.io/app#
- Paste the readme into the left and a preview is shown on the right
Firebase
Firebase is the authentication and database back-end for this application.
To manage the database open the Firebase Console and sign in with the SOS Firebase account. The login details to this account are pinned to the general channel of our development Slack.
If you need to make changes to how the App links to our Firebase account use the following: Add Firebase to Flutter
App Performance
If you are running the debug build of the flutter app the performance is going to suffer. To accurately gauge how the app performs please run
flutter run --release
This will build a fully optimized version of the app. Additionally physical devices usually perform better than the simulator.