DEV/Flutter(22)
-
Flutter & Firebase - Authentication State 구독 메소드
Authentication State 구독하기 🔗 Check current auth state Authentication State를 구독하기 위한 메소드는 3가지가 있다. authStateChanges() idTokenChanges() userChanges() 각 메소드로 구독 가능한 이벤트를 알아보면 다음과 같다. userChanges ❘ idTokenChanges ❘ authStateChanges 가입 Right after the listener has been registered. 로그인 When a user is signed in. 로그아웃 When the current user is signed out. userChanges ❘ idTokenChanges ❘ - 토큰 변경 When there ..
2022.07.18 -
Flutter - Firebase Authentication 가입/로그인 하기
시작 전 참고 🔗 Flutter 프로젝트에 Firebase 연동하기 🔗 Flutter - Form Validation Firebase Authentication 설정 Firebase Console에 접속 후 프로젝트 페이지로 이동한다. Authentication 시작 Console > Project > Authentication > 시작하기 이메일 사용 설정 Authentication > Sign-in method > 이메일/전화번호 이메일/비밀번호 사용 설정을 활성화시킨 뒤 저장을 누른다. Firebase로 회원 가입하기 일단 이메일로 가입하는 기능을 구현해보자. Flutter에서 기능 구현하기 Firebase Authentication 인스턴스 생성 Firebase Authenticaton을 사용하기..
2022.07.18 -
Flutter & Firebase - iOS 오류
Android 보다 iOS 문제가 쉽게 잡히지 않는다. ㅂㄷㅂㄷ Launching lib/main.dart on iPhone 13 Pro Max in debug mode... lib/main.dart:1 CocoaPods' output: ↳ Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Fetching external sources -> Fetching podspec for `Flutter` from `Flutter` -> Fetching podspec for `cloud_firestore` from `..
2022.07.15 -
Flutter & Firebase - Flutter multidex handling is disabled 오류 해결 방법
Flutter multidex handling is disabled. If you wish to let the tool configure multidex, use the --multidex flag. Firebase 라이브러리 설치 후 Android Emulator에 프로젝트를 실행하면 발생하는 Multidex Exception을 해결해보자. ERROR:D8: Cannot fit requested classes in a single dex file (# methods: 92002 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method reference..
2022.07.15 -
Flutter & Firebase Android SDK Version 오류 해결
Firabase를 사용하기 위한 설치를 끝내고 Android Emulator에 프로젝트를 실행하니 오류가 뜬다. Launching lib/main.dart on Android SDK built for x86 in debug mode... lib/main.dart:1 /Users/MiKy/work/study/flutter/mychat/android/app/src/debug/AndroidManifest.xml Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] /Users/MiKy/work/study/flutter/mychat/build/cloud_firestore/int..
2022.07.15 -
Flutter 프로젝트에 Firebase 연동하기
일단 Firebase 사이트에 접속해서 로그인을 한다. 프로젝트 만들기 콘솔로 이동 > 프로젝트 만들기 버튼을 눌러서 프로젝트를 만든다. 원하는 프로젝트 이름을 지정한 후 기본 설정대로 진행한다. 프로젝트 시작 Apple, Android, Web, Unity, Flutter 앱에 Firebase를 추가하여 시작하기에서 원하는 앱을 선택한다. 물론 나는 Flutter를 선택해서 진행했다. Firebase CLI 설치 Firebase CLI 설치 및 로그인(firebase login 실행) Firebase CLI(GitHub)는 Firebase 프로젝트를 관리, 조회, 배포할 수 있는 다양한 도구를 제공합니다. 나는 자동 설치 스크립트로 설치를 했다. 터미널에서 다음 cURL 명령어를 실행한다. 이 스크립트..
2022.07.13 -
Flutter - Form Validation
사용 위젯 Form TextFormField TextField 위젯을 사용하면 TextEditingController 를 사용해야하는데, 여러 개의 필드 사용 시 관리가 어려워진다. 그래서 TextFormField 를 사용한다. 그럼 바로 시작해보자. 1. Form 생성 Form 위젯을 생성하고 key 값을 지정한다. key : GlobalKey() 지정 child : TextFormField 위젯 추가 예정 class FormScreen extends StatefulWidget { const FormScreen({Key? key}) : super(key: key); @override State createState() => _FormScreenState(); } class _FormScreenState..
2022.07.13 -
What's new in Flutter 2022
Dart enum : enhanced_enumerations Before : extension 사용 필수 enum Water { frozen, boiling } extension Members on Water { int waterToTemp(Water water) { switch (water) { case Water.frozen: return 32; break; default: return 212; break; } } String convertToString() => 'The $name water is ${waterToTemp(this)}F.'; } void main() { print(Water.frozen.convertToString()); } => The frozen water is 32F. Afte..
2022.07.06