전체 글
[Flutter] BottomNavBar Icon에 알림 뱃지(Notification Badge) 달기
BottomNavigationBar(CupertinoTabBar)에서 아이콘에 알림 뱃지 달아야 되는데, 은근 그냥 간단한 작업은 아니였어서 기록. BottomNavigationBar 아니여도, 알림 뱃지(Notification Badge)를 달 때 따라해도 될 것 같고, BottomNavigationBarItem 이용하는거니까 Material Style의 BottomNavigationBar든, Cupertino Style의 CupertinoTabBar든 상관 없이 참고해도 괜찮을 것 같다. 시작(기본 코드) 우선 기본적으로 이렇게 생긴 Navigation Bar에서 시작해 보겠다. 코드는 아래 참고. class Homescreen extends StatefulWidget { @override _Home..
Mac에서 MySQL dump(sql)파일 import / export하기
로컬에서 서버 개발을 하다가, 서버 배포를 위해 db를 그대로 옮겨야 해서 찾아보고 정리. 개발환경 M1 Mac pro 14 zsh, homebrew 1. mysql-client 설치 Homebrew로 설치했습니다. 그런데 $ brew install mysql-client 로 설치하려니, M1 아키텍처인 arm64로 설치하라는 오류가 떠서 다시 실행. $ arch -arm64 brew install mysql-client 2. Export $ mysqldump -u(사용자이름) -p(비밀번호) (DB명) > (생성할DB명).sql 로 생성. $ mysqldump -uroot -p0000 testDB > testDBExport.sql 와 같은 방식으로 실행해주면 된다. 생성된 파일은 /Users/(유저명)..
배포 없이 localhost 접속 가능하게 만들기 - ngrok
개발환경 M1 Mac pro 14 Apache Tomcat 8.5.82 배포 없이 로컬에서 실행한 서버를 외부로 공유할 수 있는 도구. 로컬에서만 실행해서는 테스트할 수 없거나, 간단히 테스트용으로 사용하기에는 매우 유용한 것 같다. 1. 설치 $ brew install --cask ngrok Homebrew를 이용하여 설치. https://ngrok.com/download 링크에서 zip파일을 다운로드 받아 설치 파일을 실행시켜도 된다. 2. 인증 토큰 설정 ngrok 홈페이지 (https://ngrok.com/) 에서 회원가입(Sign Up)을 한 이후, 지급된 auth token을 아래 명령어로 추가. $ ngrok config add-authtoken [토큰] 3. 실행 원하는 포트 번호를 뒤에 ..
[Java(JSP), MySQL] JDBC Connector로 JSP(Java)와 MySQL 연동하기
M1 Mac Pro 14. IntelliJ IDEA Ultimate 2020.3.4 Tomcat 8.5.82 JDK 1.8.0_333 1. Connector 다운로드 MySQL 홈페이지에서 Developer Zone에 들어가 MySQL DownLoads로. Connector/J 선택. Platform Independent 선택, zip 파일로 다운로드. 2. 적용 다운받은 Zip 파일 압축을 해제하고, mysql-connector-j-(버전) 파일을 "Tomcat 설치폴더\lib”, “자바설치위치\jre\lib\ext” 에 복사-붙여넣기. 나의 경우는 아래였음. /Users/(Username)/Desktop/Java/apache-tomcat-8.5.82/lib /Library/Java/JavaVirtua..
[JavaScript] Uncaught SyntaxError: "[object Object]" is not valid JSON 오류
Error Message Uncaught SyntaxError: "[object Object]" is not valid JSON at JSON.parse () at Object.success ((index):19:40) at j (jquery-1.11.2.min.js:2:27295) at Object.fireWith [as resolveWith] (jquery-1.11.2.min.js:2:28108) at x (jquery-1.11.2.min.js:4:22061) at XMLHttpRequest.b (jquery-1.11.2.min.js:4:25980) 문제 상황 setInterval(() => { fetchCheatingHistory(); }, 1000); var fetchCheatingHistory ..
[Flutter] Warning: CocoaPods not installed. Skipping pod install. 오류
Error Message Warning: CocoaPods not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation f..
[Google Maps API, Flutter] Google Maps(Places) API에서 response 언어 한국어로 설정하기
http (REST API) 관련이기 때문에 다른 프로젝트에서도 동일하게 적용 가능합니다. Flutter 프로젝트를 진행하다, Google Places API를 이용해 텍스트로 장소를 검색하는 기능을 만드는데 response JSON에서 장소 이름이 영어로 나와서 화면에 띄워주기엔 좀 불편했다. 그래서 한국어로 response를 받을 수 있는 방법이 있는 지 찾아보았다. 우선, 기존에는 검색어 텍스트를 이용해 get요청으로 장소 정보를 받아오고 있었다. String url = "https://maps.googleapis.com/maps/api/place/textsearch/json?query="; String key = dotenv.env['GOOGLE_PLACES_API_2'] ?? ""..
[Flutter] Container 안에서 이미지 사이즈 원하는대로 조정하기
Container 안에 이미지를 넣어서 흰 배경에, 이미지가 작게 들어가도록 하고 싶었다. 그런데 자꾸 Container의 child인 이미지가 Container의 width, height를 따라가는 것이.. 문제였음(container를 꽉 채움) Container( width: 130, height: 130, decoration: BoxDecoration( color: Colors.blue,// 시각적으로 잘 보이도록 파란색으로 바꿈 borderRadius: BorderRadius.circular(10), ), child: Image( image: AssetImage("assets/img/dummyPikachu.png"), width: 100, height: 100, ), ), 이런 식으로 나온다. 이..