How can i connect firebase to flutter app? - android-studio

please help me connect firebase to my flutter application. When I asked this question, I found information on the internet https://firebase.flutter.dev/docs/overview/.
But I didn't understand anything since the second step, help me please.
Install the plugin by running the following command from your project root directory:
$ flutter pub get.

Create Firebase project
Firebase console
You will have to enter project name, account, choose the coutry etc.
After you create your project, choose the desired platform that you want to use firebase on (Android in this case)
Register App on firebase
Then you register your application, by writing your applicationId in the required form
This is where your apllicationId is located --> AplicationId location
Download google-services.json and put it in the App folder (Nicely shown on the firebase webpage)
Then you will have to make some changes to gradle files I think (it's nicely shown on
firebase page, nothing exceptionally hard)
You add firebase to your pubspec.yaml file ( firebase_core: "Version that you want")
run $ flutter pub get
Last thing before using firebase, you must initialize App,
final Future _initialization = Firebase.initializeApp();
put this line somewhere, I suggest in MaterialApp before the application is built.

$ flutter pub get
simply means It will install the package for you. In vs code you don't need to do anything just add the package in pubspec.yaml and save it. Automatically flutter pub get will run for you. and if it is not run automatically just type flutter pub get in terminal and it will install the package for you.

Related

Google Fit API login stuck at loading

I'm trying to add login to my android studio app in Kotlin with OAuth2 Google, and it's keep loading and not login, what I have to do?
I found a solution, it is strange but anyway it works for me:
Delete your Cloud project
Instead of the following instructions from http://developers.google.com/fit/android/get-started create a new project with firebase.
Add an android app in firebase project settings
Add both the SHA1 and SHA256 to it.
Download google-services.json to android/app in your project folder.
Make sure to have my "support email" set on general Project settings.
Now it should work.
If this not help, please also check Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
Guys have a similar problem with GoogleSignIn

Cloud Firestore for android apps built in Kivymd not working with buildozer

Me and a friend are creating android app in Kivymd. We did create a database using firebase.
But we used the firestore option than the realtime database. We really like the feature and want to keep it. Everything works fine when we compile the app on our Ubuntu environment. But when we add firebase-admin in our requirements in the buildozer.spec file we get alot of errors related to google-cloud, google-protobuf and the list goes on. We have been looking everywhere on the internet but we cant find a solution. And all of these packages are installed with pip and we have verified this.
When using our original requirements string such as:
requirements = python3,kivy==2.0.0rc3,kivymd,sdl2_ttf==2.0.15,android,plyer,requests,urllib3,chardet,idna,hostpython3
Everything works fine, but when we add firebase_admin to the requirements we get No module errors that makes the requirements string getting very long. And we have installed everything u can possibly think related to the google packages with pip.
We have been exploring on maybe creating our own recipe, but we would be very happy if anyone could just lead us in the right direction. Our current requirements string is so long that i wont post it here. We have made realtime database work because it only uses requests so maybe we need to skip using firestore. Below are the packages we use to use and are the root cause of why the app does not work in the android app with buildozer.
import firebase_admin
from firebase_admin import credentials, firestore, exceptions
I have a feeling we must create a recipe or that its not even possible to use with kivymd and android. But any help would be very appreciated.

Template Flutter Project

I am using AndroidStudio whenever I create projects, I always have to add dependencies, create BaseClass,etc... Very boring process. So, how can I make a template Flutter Project in AndroidStudio
You can create a template for Dart files doing the following:
File -> New -> Edit File Templates... -> Dart File
Though I think that's not exactly what you want, the easiest way I know would be having a base project and just replacing the files with a copy of that when you create a new project.
EDIT: Just found this article, maybe it can be helpful: https://medium.com/flutter-community/flutter-changing-the-default-app-template-f3448386139f
If you want to create a flutter app template then, you can run flutter create command in
'./{your-flutter-install}/packages/flutter-tools/templates/app/' location.
Or if you want a full-fledged template with numerous modern and intuitive UI screens and functionalities, you can check out lots of flutter templates out there in the market.

Dart Angular2 on Nodejs debugging

The tutorial of angular2 with dart never actually uses a real server, always pub serve.
How can I debug my dart code when using a real server like NodeJS? Atm I'm just getting errors like a.b.Y is not defined(in the browser), which is completely useless.
Is there some kind of source mapping for dart2js?
Ok after building with pub build --mode=debug. The dart source is available in chrome dev tools (it shows "source mapped from main.dart.js" for all my dart files. Breakpoints are not stopping tho.
Sounds like the problem I had with another Dart library when I tried running in another server via NGINX. Is your pubspec.yaml properly set up?
My issue was that I wasn't using the transformers or entry_points section of the pubspec.yaml which generates definitions of start up classes.
https://stackoverflow.com/a/38284430/174368
Is your pubspec.yaml similar to the Dart Angular2 example below?
https://angular.io/docs/dart/latest/quickstart.html#!#add-config-files
Also make sure you serve the build directory via nodejs because it'll edit your index.html put it in the build directory and add automatically other link/script lines to include other files.
This might also be part of the reason you can't see your breakpoints. That happened to me too.

project creation error in super sonic framework

I am new to work on super sonic framework. I have to create API for the android app on it. So I install the Git and nodejs in my system. Now I am trying to create project so I have used the command on Git command prompt
C:\Program Files\Git>steroids create Project1
but I am getting error when I run that command. I have attached error's Image. How can I remove that error and create the project. I am new on it so I want to know that can I create API for app without creating own app and installing the framework. If yes, then How? Actually I need to create API for the android app.
I don't think Run should be capitalized. Try using run.

Resources