일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
- androidx
- recyclerview
- DART
- bash
- Linux
- Streaming
- 파이썬
- 넷플릭스
- 좋은글필사하기
- 공부집중
- 이모지
- 이모지메모
- jetpack compose
- Coroutine
- 장자명언
- 코틀린
- Flutter
- 소울칼리버6
- ASMR
- Android
- 명언모음
- 오픈소스
- 명심보감
- kotlin
- 벤자민플랭클린
- FSM
- 1인개발자
- 공자명언
- Firebase
- Freesound
- Today
- Total
목록전체 글 (521)
Vintage appMaker의 Tech Blog
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/lH5vS/btrJ5NXZn2q/uj5lz2pmlO9PICiUoVquok/img.png)
dart에서는 kotlin과 같이 null safety를 위한 내장된 확장함수인 let(), apply() 같은 함수가 존재하지 않는다. 그렇다고 null safety를 채크하는 방법이 없는 것은 아니다. 코틀린의 ?:(엘비스플레슬리 연산자)와 같은 기능으로 ??와 같은 연산자가 제공된다. 그러나 코틀린에 익숙한 개발자라면 apply()와 let()의 편리함을 dart에서 느끼지 못해 스트레스를 받을 떄가 있다. 그럴 경우, let(), apply()를 확장함수를 통해 만들어 사용하면 된다. 의외로 간단하게 처리 가능하다. extension ObjectExt on T { R let(R Function(T that) fn) => fn(this); // let으로도 apply 기능이 되지만, kotlin과 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bIGOT5/btrJFOPTK3A/D5EHehQrW2ZhVKQMJbM8KK/img.png)
reified 를 사용하는 이유는 크게 2가지가 있다. 함수의 리턴값과 변수 파라메터를 제너릭으로 사용하면서 1. 다양한 형의 리턴값을 넘겨주고자 할 때 2. 함수에 넘겨진 제너릭변수의 형을 비교해야 할 때 이다. import java.time.LocalDate // 0. 사용법 // inline fun 함수명: T // 1. // 대입받는 변수의 데이터 형에 따라 // 결과값을 선택가능하다. inline fun getToDay(): T? { val nowDay: LocalDate = LocalDate.now() return when (T::class) { String::class -> "now is : $nowDay" as T Int::class -> nowDay.dayOfMonth as T else ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bGoYYX/btrJMA3GzYn/QSIDxccDpcGMMzSHHb4oKK/img.gif)
LayoutBuilder class - widgets library - Dart API Builds a widget tree that can depend on the parent widget's size. Similar to the Builder widget except that the framework calls the builder function at layout time and provides the parent widget's constraints. This is useful when the parent constrains the api.flutter.dev Flutter에서는 반응형 UI를 처리하기 위해 LayouBuilder 위젯을 제공한다. 이 위젯을 사용화면 App의 전체크기를 변경이 있..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/Na0ZR/btrJBUhzBeP/bsU0BOIHI2JTE0K3qAed91/img.gif)
CustomScrollView class - widgets library - Dart API A ScrollView that creates custom scroll effects using slivers. A CustomScrollView lets you supply slivers directly to create various scrolling effects, such as lists, grids, and expanding headers. For example, to create a scroll view that contains an expan api.flutter.dev 아래로 스크롤 시, 특정 아이템이 상단에 픽스되기를 원한다면 Flutter에서는 CustomScrollVIew를 이용하여 slive..