Skip to content

fedorajuandy/money_tracker

Repository files navigation

PPB UAS - Money Tracker

2019130032 - Fedora Yoshe Juandy

NOTE! Ignore master branch

Long story short:

  • committed at campus using Wi-Fi
  • tried to sync at campus using said Wi-Fi
  • Wi-Fi error
  • everything got messed up
  • my fever-addled brain decided just to move the branch
  • present time:

Explanation notes and issues (for now and future)

  1. Cannot get parent key id1

Firebase realtime database cannot get parent id from its child. For plan's operations, every operation has a parentKey for reference.

  1. Cannot getChildren at snapshot2

For FirebaseAnimatedList, there is supposed to be a method getChildren() in android; unfortunately there is no such thing in Flutter and has already been an issue for quite awhile. So the 'Report' part of application cannot simply just itterate the whole thing and return the very last one.

  1. Problems with changing states

The date has to be clicked twice to update "Total" in daily "Transactions". Must have been a problem with updating the state and cannot found "onChildChanged" or similar in FirebaseAnimatedList to update it each time adding a new transaction (plus cannot get the index to manually update it at the last one).

Firebase Realtime Database Setup3

CLI setup

  1. npm install -g firebase-tools
  2. Firebase login
  3. dart pub global activate flutterfire_cli
  4. Add the path to env

App setup

  1. Make Firebase account
  2. Create new app in Firebase

For Android:

  1. Choose Android after setup (the middle green Android icon)
  2. Enter app package name from android/app/build.gradle (com.example.something) + nickname. While there, change the minSdkVersion to 21 and target to 28
  3. Download google-services.json to android/app
  4. In android/build.gradle (NOTE: DIFF FROM BEFORE), add classpath in dependencies
  5. In build.gradle (android/app/build.gradle), add apply together with the rest (change into the same format) [THE REST LATER IN yaml]
  6. flutter-packages-get

For iOS:

  1. Choose iOS (most left one)
  2. Enter name from ios/Runner.xcodeproj/project.pbxproj (PRODUCT_BUNDLE_IDENTIFIER)
  3. Download plist to ios/Runner

Project setup

  1. flutterfire configure
  2. flutter pub add firebase_core [CAN ADD MANUALY TO yaml by Add Firebase to your Flutter app
  3. flutter pub add firebase_database
  4. flutterfire configure
  5. In main.dart add import 'package:firebase_core/firebase_core.dart'; and import 'firebase_options.dart';
  6. add final Future<FirebaseApp> _fbApp = Firebase.initializeApp(); to MyApp and change the app not to const
  7. flutterfire configure

References

Codes

Designs

Green for choices, quantity, quality, and growth. Also money, of course.

Images

Footnotes

  1. How to find parent key using child key in firebase realtime-database?

  2. [firebase_database] Get children count without downloading all the children #1069

  3. How to Add Firebase to Flutter

About

Android app for tracking expenses using Flutter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published