Flutter IntegrationWith Firebase’s Firestore And Running Any Linux Command Using API

Step 1: For this task, we have first created an app with the project and organization name using the command prompt.

Go to your flutter folder using the command line and use the command

flutter create yourappname

2. For integrating flutter with the firebase.

  • Go to https://firebase.google.com/
  • Click on the “Go to console” & then you will be landed on the Firebase homepage. Click on the button given below to add one project.
  • After that enter your project name as and follow the further steps to set up the project.
  • After the project creation, you will be landed on a page as shown below.
  • Now click on the Android Icon shown on the above page and follow the complete process, it will guide you to set up or connect your Flutter App to Firestore.

3. Creating API

The API creation code is shown below. (This code will create one API which will help to run the Linux Commands using a webserver).

4. Creating the database in firebase using cloud firestore.

Click on create database icon.

5. For creating the Linux command app.

The packages that have been installed for this app are

  • After saving these files restart the ide.
  • Now to connect our app with the firebase we need to go to the WebUI first and then click on the android icon there.
  • Give the organization name which you used to connect to the firebase. You can go to the your_appfolder->android folder->app-> build.gradle.
  • Download the JSON file and put it in the folder as instructed.
  • Make changes in both the Gradle files as instructed.
  • After completing the above-mentioned steps we can now run our app.
  • You can refer to my GitHub repository for code.
  • Following the code the app will be looking like this:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store