본문 바로가기

Flutter123

[Flutter] 프로젝트 생성(with Github) Github을 remote repository로 쓰고 싶다는 가정하에 프로세스를 정리해보겠습니다. [Github] Remote repository 생성 private으로 설정~ settings에서 collaborators 초대~ git clone 주소 복사~ [Mac] Local repository 생성 로컬에 생성하고자하는 위치로 이동하고 clone // 예시 cd {폴더명} cd git clone {복사한 git clone 주소} clone 폴더에 flutter project 생성 cd {프로젝트명; clone된 폴더명} flutter create --org com.{회사도메인명} . // --org를 설정하지 않으면 나중에 배포할때 프로젝트명을 수정해줘야한다. // .은 현재 위치에 프로젝트를 생성.. 2023. 8. 30.
[Flutter] Animation animations https://api.flutter.dev/flutter/animation/animation-library.html animation library - Dart API The Flutter animation system. To use, import package:flutter/animation.dart. This library provides basic building blocks for implementing animations in Flutter. Other layers of the framework use these building blocks to provide advanced animation support f api.flutter.dev Implicit animations .. 2023. 7. 1.
[Flutter] Clean Architecture / MVVM Architecture가 왜 중요한가 모바일 환경은 자원의 한계, 라이프 사이클 처리의 복잡함 등의 문제, 프리젠테이션 로직 자체의 복잡하고 비동기 처리가 많은 특성이 있다. 좋은 Architecture는 개발속도, 유지보수, 확장성, 코드의 품질, 가독성을 높일 수 있다. Clean Architecture Clean Architecture는 뒤섞인 로직들을 근본적으로 분리시켜준다. 모듈의 변경이 다른 모듈에 영향을 미치지 않고 같은 모듈 내에서는 일관되고 응집력 있는 결합을 제공할 수 있도록 계층을 구분하는 것이다. 계층을 분리함으로 규모가 큰 앱의 소스코드 전반을 쉽게 장악할 수 있다. 특정 계층에 대한 수정이 다른 계층에 거의 영향을 주지 않는다. MVVM(Model-view-viewmodel) M.. 2023. 6. 30.
[Flutter] 함수형 프로그래밍 형 변환을 위한 방법들 .asMap .toList .toSet .fold(0, (previous, next) => ) .reduce((previous, next) => ) .map((e) => ) .where((x) => ) cascading operator : ... 2023. 6. 29.
[Flutter] debounce & Throttle 특정 함수의 실행을 제한하는 목적 Debounce 특정 기간 안의 함수 실행을 모두 취소하고 마지막에만 실행 Throttle 함수 실행 후 특정 기간 동안의 추가 실행을 모두 취소 https://rxmarbles.com/#debounce RxMarbles: Interactive diagrams of Rx Observables rxmarbles.com 2023. 6. 29.
[Flutter] ListView의 마지막 항목의 패딩 ListView에 동일한 패딩을 적용하면 마지막 항목에 도달했을때 불필요한 패딩이 들어가는 경우가 있다. 그럴때는 mapIndexed() 메소드를 응용해볼 수 있다. const List items = []; items.mapIndexed((index, e) => Padding(padding: EdgeInsets.only(bottom : index == items.length -1 ? 0 : 16.0, ) 2023. 6. 28.
[Flutter] (Cache) 캐시 관리 API 에서 요청한 데이터를 다음 화면에서도 사용해야 할 경우, 캐시를 활용하면 앱이 더 빠르게 동작할 수 있어 더 나은 사용자 경험을 제공할 수 있다. 2023. 6. 28.
[Flutter] Pagination *코드팩토리님의 강의 내용 참조 pagination state의 5가지 가능성 1. 정상적으로 데이터가 있는 상태 2. 데이터가 로딩중인 상태 (현재 캐시 없음) 3. 에러가 있는 상태 4. 첫번째 페이지부터 다시 데이터를 가져올때 5. 추가 데이터를 paginate 해오라는 요청을 받았을 때 마지막 데이터에 도달했을때 loading 표시 혹은 마지막임을 알려주기 위해서는 ListView의 itemCount를 data.length +1 로 하고 itemBuilder 내부에서 if (index == data.length) { return Padding( padding : const EdgeInsets.symmetric( horizontal : 16.0, vertical : 8.0, ), child : Ce.. 2023. 6. 28.
[Flutter] constrain box size 위젯의 크기를 제한하고 싶을때는 ConstrainedBox() 위젯을 사용할 수 있다. ConstrainedBox( constraints : const BoxConstraints( maxWidth : _maxWidth, ), child : Widget(), ), // Container를 사용할 수 도 있다. Container( constraints : const BoxConstraints( maxWidth : _maxWidth, ), child : Widget(), ), 2023. 6. 10.