728x90 전체 글565 if (contain('')) 은 true이다. 이걸 생각 못하고 있었는데,, 그래서 if(searchTextEditController.text.isEmpty){ searchCurrencyList.value = currencyList; } else{ searchCurrencyList.value = currencyList.where((e) => e.countryName.contains(searchTextEditController.text)).toList(); } 이 코드를 아래와 같이 간단하게 변경할 수 있었다. 어차피 contain(searchTextEditController.text)는 전체를 반환하기 때문에 굳이 if로 나눌 필요가 없었던 것이었다. searchCurrencyList.value = currencyList .where((e) => e.. 2022. 8. 10. getX로 debounce 쉽게 쓰는 방법 이렇게 하면 매우 편하게 debounce를 쓸 수 있다. searchTextEditController.addListener(() { logger.d('작동할까 ${searchTextEditController.text}'); searchText.value = searchTextEditController.text; }); debounce(searchText, (_) { print("debouce$_"); }, time: Duration(milliseconds: 100)); obs 객채를 debounce에 넣어주고 duration만 넣어주면 끝! 아.. debounce해주려고 Timer 쓰지 않아도 된다. 행복!ㅠㅠ 2022. 8. 10. GetX로 이동 시 parameter 전달해주기 일반적인 Widget에다가 parameter 넣어주는 것과 달리 GetPage로 이동할 때는 인터넷 홈페이지 query 넘겨주듯이 Get.parameters로 보낼 수 있었다. https://velog.io/@chjo0330/Flutter-GetX를-이용한-Navigation페이지-이동 [Flutter] GetX를 이용한 Navigation(페이지 이동) 플러터에서 GetX를 이용한 Navigation (페이지 이동) velog.io 2022. 8. 9. social Textfield -> 소셜앱에서 사용하면 좋은 textfield library https://pub.dev/packages/flutter_social_textfield/versions/0.0.6 2022. 8. 8. 이전 1 ··· 91 92 93 94 95 96 97 ··· 142 다음 728x90