Firebase Restful Api Proof of Concept
Getting Started
this is just a proof of concept that we can use Firebase as RestfulApi in Flutter.
Packages/Plugins and why?
- http for network requests (Get/Post/Patch...etc)
- firebase_storage for image uploading to firebase (no restful api for this op.)
- image_picker to select image from phone storage, used for comp. logos.
- uuid to generate random IDs (specially v4 ones).
what does this app do?
- it manages the CRUD operations for two types of data:
-
- users
-
- companies
Users:
- Fields: Name, Email and Phone.
Companies:
- Fields: Name, Logo, Location on Map.
Operations for Users:
- User is so simple. using the Restful Api Code located In ApiProvider.
Operations for Compaines:
- This is a little headache.
-
- For Location Map & Name it's easy just a CRUD Operation like Users see : ApiProvider.
-
- For Logo. after searching awhile in Firebase Docs, there is not Restful api for storage. so here we used firebase_storage for image uploading to firebase (no restful api for this op.)
-
- TODO: (in Future) we could use Google Maps to select a location from the map instead of link.
Screenshots
Screenshot | Screenshot | Screenshot |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Want to try it ?
Just Testing the app ?
head to : Output Folder. Note: this only have APK, no IPA (might upload it in future).
Want to run and generate your own APK/IPA?
head to : Flutter installing guide and follow all steps then
flutter clean
flutter run
Testing
flutter test --machine test\unit_test.dart
in testing we covered the following topics
- Email Validators Tests
- name Validators Tests
- phone Validators Tests
- location Validators Tests