728x90

Flutter 29

[Flutter 앱 개발하기] DateTime 변수 format 변경하기

DateTime 변수의 포맷을 변환 시키려면 DateFormat을 사용하면 된다. import 'package:intl/intl.dart'; final DateTime now = DateTime.now(); final DateFormat formatter = DateFormat('yyyy-MM-dd'); final String formatted = formatter.format(now); print(formatted); 보다 다양한 포맷 옵션을 찾아보려면, DateFormat class - intl library - Dart API DateFormat class Null safety DateFormat is for formatting and parsing dates in a locale-sensitive..

IT 2022.12.30

[Flutter 앱 개발하기] 두 개의 DateTime 변수 차이 구하기

두 Datetime 변수 간의 날짜 차이를 구하고 싶다면 아래와 같이 하면 된다. DateTime now = DateTime.now(); DateTime dt = someTimestampValue.toDate(); if(10 > now.difference(dt).inDays) { print("Difference is less than 10."); } else { print("Difference is more than or equal to 10."); } 현재 시간 구할 때는 now() 사용하기. ​ Timestamp 값을 DateTime 값으로 변환할 때는 toDate() 사용하기. ​ 여기서는 사용 안했지만, 문자열로 DateTime 생성할 때는 아래와 같이 parse() 사용하기. DateTime d..

IT 2022.12.30

[Flutter 앱 개발하기]Firebase 설정

앱을 개발할 때 기본적으로 필요한 인증 관련 기능이나 서버에 데이터를 저장하는 기능 등을 직접 개발하고 운영하기 힘들기 때문에 나와 같이 앱을 만들어 보거나, 소규모로 운영할 때에는 Firebase와 같은 Backend as a Service 를 이용하면 편하다. (일정 규모의 사용량까지는 무료) ​ 기본적인 내용은 홈페이지를 참고한다. (책이 많지 않지만, 역시 홈페이지가 최고다) https://firebase.google.com/ Firebase Firebase는 고품질 앱을 빠르게 개발하고 비즈니스를 성장시키는 데 도움이 되는 Google의 모바일 플랫폼입니다. firebase.google.com ​ ​ ​ 우선 Firebase 프로젝트를 만들어보자. 이를 위해서 자신의 구글 계정으로 아래 링크로 ..

IT 2022.12.30

[Flutter 앱 개발하기] 프로젝트 만들고 개발 환경 세팅하기

플러터 개발 프로젝트를 시작하려면 개발 환경을 준비해 놔야 하는데, 아래 링크를 참고하면 된다. 맥OS에서 설치 flutter-ko.dev 다음 명령어를 이용해서 프로젝트를 생성한다. % flutter create todo​ 나의 경우는 개발도구로 Visual Studio Code를 선호하는데 설치가 필요하다면 다음 링크를 참조한다. https://code.visualstudio.com/download Download Visual Studio Code - Mac, Linux, Windows Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio C..

IT 2022.12.30
728x90