본문 바로가기
728x90

Flutter80

flutter future 병렬처리 future를 실행하다보면 병렬처리를 해줘야할 때가 있다. 예를 들어 //await getFollowers(); //await getFollowings(); progressing= false; setState(() {}); 해당구문처럼 실행하게 되면 getfollower를 모두 실행 후 getfollowing를 모두 실행 후 setstate를 하게 되어 시간이 낭비 된다. 다음과 같이 해결해보면 좋을 것 같다. void loadData() async{ progressing= true; setState(() {}); await Future.wait([getFollowings(), getFollowers()]); //await getFollowers(); //await getFollowings(); prog.. 2022. 5. 19.
Animation Container overflow 방지 Fittedbox를 사용한다-> fittedbox는 내부 overflow를 방지할 수 있는 역할을 함 https://codinghub.tistory.com/225 FittedBox FittedBox [Ko] * FittedBox : 차일드 또는 내용물의 양에 따라 크기가 확장되는 위젯에 의해 오버플로우가 발생되는 경우 FittedBox로 감싸면 디바이스 사이즈를 넘지않게되며 오버플로우가 방지됨. 내용 codinghub.tistory.com 애니메이션 컨테이너 사이즈 변경할 때는 이런방식으로 하고,, 추가적으로 ScaleTransition 위젯을 쓰는 방법도 있다! ScaleTransition( // animation 구현할땐 Animation 객체가 필요 scale: _animation, child: C.. 2022. 4. 6.
flutter debouncing - 재호출 https://zionh.tistory.com/155 [flutter] TextField 타이밍 : Debouncing 검색기능 등에서 텍스트가 바뀔때마다 통신을 하게 구현을 했을 때 현실과 이상의 괴리가 발생한다. 이상: 원하는 텍스트를 '모두' 입력했을 때, 그 텍스트에 대해서 검색을 시도한다. 현실: 텍 zionh.tistory.com search를 할 때 단어를 칠 때마다 검색하게 되면 너무나 서버 낭비가 심하다. 적절하게 시간 봐가면서 실행해주는 것이 바로 이 deboucing 이다. 오늘은 이 debouncing을 간단하게 처리해주도록 코드를 정리해놓으신 블로그가 있어서 소개하고자 한다. 다른 library(Google map location picker - 구글에서 만든건지는 잘 모르겠음)에.. 2022. 4. 1.
unfocus, keyboard down, focus 해제하고 싶을 때, 키보드 내리고 싶을 때 FocusManager.instance.primaryFocus?.unfocus(); 2022. 3. 14.
728x90