Hello everyone, imagine that you have developed an enterprise-level Flutter application(client app) using firebase as the backend, and you are responsible for adding, updating and deleting users.
You will quickly realized that doing these from the client app has its limitations.
In this post, I will present to you with my solution for fixing these issue using the Firebase Admin SDK.
We’ll be writing some JavaScript, well Typescript, and deploying to Firebase. Don’t worry if you don’t know JavaScript/Typescript it’s quite similar to Dart and I will explain the code as we go along.
This project uses firebase streams and the provider package to manage state; the moment a document is updated in Firestore it will be reflected on the client/Flutter app once the user has internet connection.
Also, the app has options for dark and light themes; 😀 see the post Flutter Light and Dark Theme to implement in your app.
We won’t dive into the Flutter/Dart code in-depth because the focus is the firebase aspect, however, below are images of the folder structure and the final UI. You can get the full source code at Github Link
Dark Theme
Light Theme
Ensure you have Node.js installed. Login to firebase using your credentials with the commands below:
npm install -g firebase-tools
npm install -g firebase-tools
firebase login
Run the command, firebase init from that folder select functions at the prompt then select the corresponding project. Lastly, choose TypeScript as the language.
Flutter and Firebase are the perfect duo for rapid mobile development; using both helps you the bring more value to your users while reducing lengthy configurations.
JavaScript/TypeScript is easy to learn/understand if you already know Dart.
Maybe in the future, Google will give us the ability to write cloud functions using dart. 😀
⭐ Source Code Flutter: GitHub Link
⭐ Source Code Firebase/JavaScript: GitHub Link
#Flutter #Firebase