본문 바로가기
기타/프로젝트 관련

How to connect Firebase to Flutter ( Visual Basic )?

by 세계 최고의 AI Engineer_naknak 2023. 3. 1.

This poster is about how to connect Firebase to Flutter.

The reason I use English is for practicing and getting used to using English.

So I don't know this is correct, I mean my words. And It could be wrong or there might be something is weired when you read this poster.

But, please correct my words and let me know what is wrong.

Thanks, Let go to the main topic.

 

In my project, I'm not sure that I can show the whole code of my project, but I can show you the process that how it goes.

Cool, briefly my project is for anyone who wants to learn Korea. Later I'll show it.

I chose Flutter for it, that's why I post this poster.

 

First, get the website https://firebase.google.com/

 

Firebase

Firebase는 고품질 앱을 빠르게 개발하고 비즈니스를 성장시키는 데 도움이 되는 Google의 모바일 플랫폼입니다.

firebase.google.com

then create a new Firebase project or open an existing one.

 

In the Firebase Console, select the "Add Firebase to your Flutter app" option and follow the instructions to add Firebase to your app.

there is Flutter logo, if you click this

As you can see, You can use Firebase CLI.

What is CLI? 

Firebase CLI(GitHub)는 Firebase 프로젝트를 관리, 조회, 배포할 수 있는 다양한 도구를 제공합니다.

 

GitHub - firebase/firebase-tools: The Firebase Command Line Tools

The Firebase Command Line Tools. Contribute to firebase/firebase-tools development by creating an account on GitHub.

github.com

Yes, if you use CLI then, it helps to mange and view, deploy the projects.

So, I'm going to use CLI.

When you get the developer doc. , u can see how to install it.

In my case,

Visual Basic, on terminal run the following code to install the Firebase CLI

npm install -g firebase-tools

 Then, we need authenticate, if you run the following code, you will get the message about something. 

firebase login

참고: firebase login 명령어는 머신에서 localhost에 연결되는 웹페이지를 엽니다. 원격 머신을 사용 중이며 localhost에 액세스할 수 없는 경우 --no-localhost 플래그를 사용하여 명령어를 실행합니다.

Yes.

 

If you finish those steps,

firebase projects:list

Run this code, then you can watch the projects in the Firebase.

 

After this, we need to install FlutterFire CLI.

oh... you know I got a problem.

When I run flutterfire, there is "bash: flutterfire: command not found"

So I search how to fix it. But no matter how much do something for it, it doesn't work...

But finally I found the solution from https://www.appsloveworld.com/flutter/100/25/flutterfire-configure-command-not-working-i-need-to-set-firebase-in-my-flutter

 

[Solved]-'flutterfire configure' command not working, I need to set firebase in my flutter project-Flutter

Coding example for the question 'flutterfire configure' command not working, I need to set firebase in my flutter project-Flutter

www.appsloveworld.com

flutterfire.bat configure

This is that. If you run this, you can choose the project which is connecting to flutter project from Firebase.

And you can see these file is added.

Then you can initialize Firebase on main.dart like this.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

  runApp(const App());
}​

 

Then you can any plug-in what you need.

https://firebase.google.com/docs/flutter/setup?hl=ko&platform=android#available-plugins 

 

Flutter 앱에 Firebase 추가

Google은 흑인 공동체를 위한 인종적 평등을 추구하기 위해 노력하고 있습니다. 자세히 알아보기 의견 보내기 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.

firebase.google.com

flutter pub add PLUGIN_NAME

There are so many useful plug-ins! 

Then

flutterfire.bat configure

In my case flutterfire configure doesn't work...

I try to use GA but it's kind of hard to apply to flutter... so I try it again later!

댓글