본문 바로가기

Dart & Flutter4

try-catch만 쓰면 안되는 이유 개발을 하다보면 try-catch를 이용해 에러를 잡곤 한다.그러나 try-catch만으로는 부족하다.try { int result = await DatabaseHelper.instance.insertItem(newItem); if (result > 0) { _showSuccessDialog(); } else { _showFailDialog(); }} catch (e) { print("에러 발생: $e"); _showFailDialog();} 데이터베이스에 newItem을 넣는 과정을 챗GPT 시켜서 짜게 했는데 이런 코드를 주었다.어차피 try-catch에서 에러를 잡을텐데 왜 굳이 result > 0을 확인하는지 궁금해졌다.이유를 물어보니 다음과 같이 답을 주었다.✅ if (re.. 2025. 3. 21.
flutter로 캘린더 만들기 보호되어 있는 글 입니다. 2021. 12. 25.
플러터 apk로 만드는 법 1. 터미널 혹은 커맨드창에서 '빌드하고 싶은 플러터 프로젝트 디렉토리로 이동' ex) cd /Users/lee/flutter/myproject 2. 명령어 flutter build apk --release --target-platform=android-arm64 입력 3. 빌드 경로는 [Project Forder]/build/app/outputs/apk/release/app-release.apk 입니다. 해당 파일을 안드로이드 폰에 옮겨서 설치하면 완료! 출처: https://gamestory2.tistory.com/215 [베베의 개발일지] 2021. 7. 14.
Flutter? -A tool kit that makes it easy for developers to design beautiful interfaces for all sorts of screen sizes and devices -Has a whole bunch of pre-built widgets that make it easy to lay out apps. -native가 아니지만 native인 것 처럼 보일 수 있음 -하나의 코드로 안드로이드, 애플 앱 개발 됨 -객체 지향 언어들과 매우 비슷한 Dart라는 언어를 사용 -웹디자인의 아이디어를 많이 채용한 개발 방식 -오픈소스라서 뭐가 어떻게 작용하는지 언제든 볼 수 있다 -레고마냥 위젯 위에 위젯을 쌓는 방식이다 2021. 7. 12.