전체 글 607

[Flutter] Firebase에 데이터 저장 & 조회 & 삭제 & 수정

FireStore에 데이터 저장 & 조회 & 삭제 & 수정 Firebase를 사용하면 2개의 데이터베이스가 있다 Realtime DataBase Cloud Firestore 해당 강의에서는 비교적 최근에 나온 Cloud Firestore를 사용할 예정 Cloud Firestore는 MongoDB 처럼 NoSQL로 비정형 데이터를 저장할 수 있다. 사용하기 Firebase에서 만든 프로젝트 클릭 빌드 → Firestore Database → 데이터베이스 만들기 → 프로덕션 모드에서 시작 → asia-northeast3 (Seoul) 컬렉션 시작으로 Collection 생성 여기서 잠시 Collection과 Document 에 대해 알아보자! Collection 안에 document 형태로 데이터 저장 Co..

Flutter 2023.08.15

[Flutter] Firebase 셋팅 (다수 에러 해결 과정)

Firebase 셋팅 (다수 에러 해결 과정) 설치하기 pubspec.yaml dependencies: flutter: sdk: flutter http: ^0.13.4 image_picker: ^0.8.4+4 shared_preferences: ^2.0.11 provider: ^6.0.1 flutter_local_notifications: ^9.1.5 # firebase firebase_core: ^1.10.6 firebase_auth: ^3.3.4 cloud_firestore: ^3.1.5 firebase console 검색 → 프로젝트 생성 IOS 앱 추가 앱 등록 Apple 번들: android → app → build.gradle 파일의 하단에 defaultConfig 부분에 application..

Flutter 2023.08.15

[Flutter] 특정 시간 알림 & 주기적인 알림 띄우기

특정 시간 알림 & 주기적인 알림 띄우기 우선 설치해야하는 패키지가 있다. 만약 이전에 local_notification을 설치했다면 패키지 설치는 생략 가능하며 아래의 코드만 가져와주기 (현재는 notification.dart에서 알림을 보내기에 여기서 작성) import 'package:timezone/data/latest_all.dart' as tz; import 'package:timezone/timezone.dart' as tz; 그리고 아래의 코드를 작성해주기 갑자기 뭐가 에러가 잔뜩 생기면서 알람도 안켜지고, 앱이 꺼지면서 뭐라뭐라 하는데 첫 번째 이유 기존에 저장해둔 아이콘이 사라져있었던게 . (사라진 이유는 모르겠음…) 두 번째 이유 아이콘이 사라지면서 기존에 셋팅했던 아이콘 이름을 변경..

Flutter 2023.08.15

[백준, 11724번] 연결 요소의 개수

풀이 방식 방향이 없는 그래프기에 노드간 연결을 서로 해주는 형식으로 했고 노드 수 만큼 반복문을 돌려서 방문하지 않았다면 해당 값에 대한 _dic의 값을 q에 넣고 돌리기 이후 방문하지 않은 노드들은 i의 값을 visit에 넣어 방문 표시하기 이후 visit의 중복을 줄이고 0번째 노드는 없으니 -1 해서 푼 풀이 조금 시간이 상대적으로 나오긴하지만.. ㅎ import sys from collections import deque input = sys.stdin.readline n,m = map(int,input().split()) _dic = {i:[] for i in range(1,n+1)} visit = [0]*(n+1) for _ in range(m): u,v = map(int,input().sp..

알고리즘 2023.08.15

[Flutter] Local notification 알림 주는 법

Local notification 알림 주는 법 모바일로 알림 보내기 우선 notification에는 2가지의 알림이 있다. 서버에서 보내는 push notification 앱 자체에서 실행하는 local notification 이번 강의는 local notification을 배울 예정 local notification 설치 방법 pubspec.yaml에서 아래의 코드 추가 후 pub get 실행해서 설치 dependencies: flutter: sdk: flutter http: ^0.13.4 image_picker: ^0.8.4+4 shared_preferences: ^2.0.11 provider: ^6.0.1 flutter_local_notifications: ^9.1.5 // Text('새로운 페이..

Flutter 2023.08.14

[Flutter] GridView, CustomScrollView 프로필 페이지 만들기

GridView, CustomScrollView 프로필 페이지 만들기 GridView 그리드를 구현하고 싶을 때 사용하면 편리한 위젯으로 몇 개를 보일지 확실하지 않은 상태라면 GridView.builder() 위젯을 사용하기 gridDelegate: 가로로 몇 개가 보일지를 체크 itemBuilder: return할 위젯 itemCount: 총 몇 개의 요소를 보일지 GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), itemBuilder: (c,i){return Container(color: Colors.grey);}, itemCount: 5, ) 다만 GridView에서 return ..

Flutter 2023.08.14

[Flutter] Store 여러개 & GET 요청 (Provider)

Store 여러개 & GET 요청 (Provider) 우선 CircleAvatar() 위젯을 사용하면 이미지를 동그랗게 생긴 형태로 넣을 수 있다. CircleAvatar( radius: 30, backgroundImage: AssetImage("경로") ) Store 여러 개 사용하는 방법 현재까지는 1개의 Store만 사용했기에 ChangeNotifierProvider() 를 사용했는데 이제는 여러 개의 Store를 사용해야 하기에 MultiProvider() 를 사용해야 한다. void main() { runApp( MultiProvider( providers: [ ChangeNotifierProvider(create: (c)=>Store1()), ChangeNotifierProvider(creat..

Flutter 2023.08.14

[백준, 7576번] 토마토

import sys from collections import deque input = sys.stdin.readline m,n = map(int,input().split()) arr = [list(map(int,input().strip('\n').split())) for _ in range(n)] visit = [[0]*m for _ in range(n)] q = deque([]) result = 0 # --------- bfs로 탐색하며 함께 나아가야 양측에서 방문하고 # --------- 같은 곳을 방문하지 않을 수 있기에 미리 1을 찾기 for i in range(n): for j in range(m): if arr[i][j] == 1: visit[i][j] = 1 q.append([i,j,0])..

알고리즘 2023.08.14

[백준, 2667번] 단지번호붙이기

해당 문제는 일반적인 그래프 문제로 방문 여부에 대한 체크를 하며 카운팅을 해 푼 풀이법 import sys from collections import deque input = sys.stdin.readline n = int(input()) arr = [list(map(int,input().strip('\n'))) for _ in range(n)] visit = [[0]*n for _ in range(n)] stack = deque([]) result = [] r_cnt = 0 for i in range(n): for j in range(n): if arr[i][j] and not visit[i][j]: cnt, r_cnt = 1, r_cnt + 1 visit[i][j] = 1 stack.append([..

알고리즘 2023.08.14