firestore 썸네일형 리스트형 Firestore에 데이터 저장하는 방법 1. add를 이용한 방식 add를 이용하면 doc id는 자동으로 생성이 된다. add에 넣을 값은 map 형식으로 제공해야 한다. 이때 path로 지정한 collection이나 doc이 없으면 생성해 준다. class _MessageSendBarState extends State { final _authentication = FirebaseAuth.instance; final _firestore = FirebaseFirestore.instance; final _textFieldController = TextEditingController(); var _sendedMessage = ''; Future _sendMessage() async { FocusScope.of(context).unfocus(); .. 더보기 Firestore db 권한 설정 1. Firestore에 규칙 추가 규칙 택 선택 규칙 추가 match /user/{uid} { allow read, write: if request.auth != null && request.auth.uid == uid; } match /user/{uid} { allow read: if request.auth != null; } match /chats/{document=**} { allow read, create: if request.auth != null; } request.auth는 로그인 인증정보가 있어야 한다는 뜻 document=** 의 뜻은 하위 모든 문서를 포함 더보기 Flutter Firestore 연동 1. flutter에 firestore 플러그인 추가 1-1. 플러그인 추가 firestore 관련 플러그인 추가 flutter pub add cloud_firestore flutterfire configure 2-2. flutter 프로젝트 코드 수정 후 빌드 import 'package:cloud_firestore/cloud_firestore.dart'; 1-2. 빌드 에러 핸들링 이때 빌드 시 에러 발생 에러 내용대로 android/app/build.gradle 파일에 minSdkVersion을 19로 수정 후 다시 빌드 defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studi.. 더보기 이전 1 다음