Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- dart
- flutter android 폴더
- flutter bloc
- 롤토체스 api dart
- lol api dart
- dart new
- leetcode dart
- flutter ios 폴더
- com.google.GIDSignIn
- valorant api dart
- 롤 api dart
- AnimationController
- 발로란트 api dart
- generate parentheses dart
- 파이썬
- swift concurrency
- PlatformException(sign_in_failed
- flutter statefulwidget
- flutter widget
- keychain error
- Architectural overview
- riot api dart
- widget
- dart new 키워드
- swift 동시성
- docker overview
- dart.dev
- tft api dart
- 파이썬 부동소수점
- flutter
Archives
- Today
- Total
Coaspe
Flutter - Bloc에서 Equatable이 필요한 이유 본문
Bloc에서 state를 정의 할 때 Equatable을 사용하게 됩니다.
왜 사용해야 할까요? 정답은 emit 함수를 사용하는 과정에 있습니다.
98 line을 보시면 기존의 state(_state)와 새로 들어온 state(argument)를 비교하여, 일치한다면 return 시킵니다.
그리고 Equtable 라이브러리에서는 다음과 같이 props를 사용하여 이전과 동일한 state인지 구분합니다.
가끔 State를 변화시킨 것 같은데, 예상되는 UI의 변경이 발생하지 않는다면, Equtable의 props를 다시 설정해주세요!
'Flutter > 근본' 카테고리의 다른 글
Flutter - Architecture overview #Rendering and layout (0) | 2023.05.28 |
---|---|
Flutter - Architectural overview #Architectural layers #Anatomy of an app #Reactive user interfaces (1) | 2023.05.28 |
Flutter - Inside Flutter (0) | 2023.02.17 |
Flutter - Architectural overview #Widgets (0) | 2023.02.17 |
Flutter - AnimationController와 Ticker의 관계 (0) | 2023.02.17 |
Comments