728x90
    
    
  나는 freezed Model에 해당과 같이 넣고 싶다.
String toNotiString() {
  List result = [];
  if (xp != null) {
    result.add('xp:$xp');
  }
  if (gold != null) {
    result.add('gold:$gold');
  }
  if (diamond != null) {
    result.add('diamond:$diamond');
  }
  return result.join(', ');
}그런데 오류가 나지..
해결책은 doc에 있었다.
https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models
GitHub - rrousselGit/freezed: Code generation for immutable classes that has a simple syntax/API without compromising on the fea
Code generation for immutable classes that has a simple syntax/API without compromising on the features. - GitHub - rrousselGit/freezed: Code generation for immutable classes that has a simple synt...
github.com


Wow..
728x90
    
    
  '개발 > Flutter' 카테고리의 다른 글
| flutter library 업데이트 -> PR 적용하기 (0) | 2022.11.22 | 
|---|---|
| flutter super initializer (0) | 2022.11.22 | 
| flutter debug 문구 안 나올 때 .. (0) | 2022.11.19 | 
| android studio multi click (0) | 2022.11.17 | 
| 실시간으로 가져오려면 변수 저장하지 말고 함수로 가져오기 (0) | 2022.11.16 | 
