Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- flutter #상태관리
- 백준 #c++
- 유데미 #udemy #웅진씽크빅 #스나이퍼팩토리 #인사이드아웃 #미래내일일경험 #프로젝트캠프 #부트캠프 #react #리액트프로젝트 #프론트엔드개발자양성과정 #개발자교육과
- unity #2d-game #minigame #vscode
- firebase #파이어베이스
- boj #c++
- #유데미 #udemy #웅진씽크빅 #스나이퍼팩토리 #인사이드아웃 #미래내일일경험 #프로젝트캠프 #부트캠프 #react #리액트프로젝트 #프론트엔드개발자양성과정 #개발자교육과정
- 인턴 #프론트엔드 #개발자 #프론트엔드개발자 #취준
- boj #baekjoon
- flutter #app #취준
- Flutter
- boj #baekjoon #c++
- flutter #firebase #플러터 #파이어베이스 #연동
- 비주얼 스튜디오 #vs #visual studio
- baekjoon #boj #c++
- 백준 #boj #baekjoon
- flutter #todolist
- git #unity #깃허브
- 플러터 #flutter #restful #rest api
- flutter #깃
- 백준 #boj
- 비주얼스튜디오 #코드스니펫
- unity #2d-game
- 로컬저장소 #이름변경
- baekjoon #백준 #boj
- VS #비주얼스튜디오
- flutter #git
- flutter #플러터 #분석
- 백준
- flutter #플러터
Archives
- Today
- Total
cococo-coding
[Flutter] 프로젝트 기본 세팅하기 본문
감정일기 앱을 만들기 위해 파이어베이스와 플러터를 연결했다.
1. analysis_options.yaml 파일에 다음코드를 추가한다. (Lint가 뜨지 않도록 방지)
rules:
prefer_const_constructors: false
avoid_print: false
prefer_typing_uninitialized_variables: false
prefer_const_constructors_in_immutables: false
2. main.dart 파일을 다음 코드로 기본세팅한다.
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Text('hello'),
);
}
}
결과
위 코드를 크롬으로 열어본 화면이다.
왼쪽처럼 hello글자가 잘 나타남을 확인할 수 있다.
TIL
파이어베이스 연결과 기본적인 main 파일 세팅이 적혀있는 글이 없어서 헤맸는데,
파이어베이스 설치를 하고 생성된 파이어베이스 코드를 남겨둔 상태에서 -> class MyApp~ @override~만 남기고 기본 코드를 지우면 된다.
기본적인 main파일세팅은 코딩애플 사이트를 참고했다.
https://codingapple.com/unit/flutter-basic-layout-widget/?id=19933
'[Flutter] 두번째 앱 > TIL' 카테고리의 다른 글
[Flutter] 상태관리(Bloc, GetX)등에 대하여 (0) | 2024.02.26 |
---|---|
[Flutter] restful개발이란? (1) | 2024.02.26 |
[Flutter] 두 번째 만들 앱에 관하여 (1) | 2024.02.25 |
[Firebase] 파이어베이스(Firebase)에 관하여 (0) | 2024.02.16 |