본문 바로가기
반응형

플러터48

Flutter 성능 개선 방법 (앱 개발) 플러터 성능 개선 방법 요약 build 메소드 부하(load)를 최소화앱에서 UI변경이 있을 때마다 build 메소드이 호출됨큰 위젯보다는 작은 위젯으로 쪼개자위젯을 const로 선언하자위젯 트리의 변경을 최소화위젯 트리(논리적 구조) -> 엘리먼트 트리(위젯트리와 렌더트리 매핑) -> 렌더 트리(실제 렌더링되는 구조)위젯트리 변경이 없으면 rebuild할 때 렌더 트리를 변경하지 않는다가급적 ListView 보다는 ListView.builder 사용ListView는 모든 위젯을 빌드하여 성능 저하 (메모리에 저장 유지 o)ListView.builder는 화면에 표시되는 위젯만 동적 빌드 (메모리 저장 유지 x)성능이 많이 필요한 작업은 IsolateDart는 단일 스레드 언어. 단 하나의 Isolate.. 2023. 1. 8.
How to solve error "unhandled exception: user denied permissions to access the device's location." 해결방법 How to solve error "unhandled exception: user denied permissions to access the device's location." 해결방법 아래와 같이 오류 메시지 발생 (Error message as below) unhandled exception: user denied permissions to access the device's location. 해결 방법 : 아래 코드와 같이 permission을 추가하는 코드 작성 (Solution: Write code to add permission like below code) LocationPermission permission = await Geolocator.requestPermission(); // 추가!.. 2022. 10. 19.
[Flutter] Change flutter version (downgrade, upgrade) (플러터 버전 바꾸기 (다운그레이드, 업그레이드)) [Flutter] Change flutter version (downgrade, upgrade) 플러터 버전 바꾸기 (다운그레이드, 업그레이드) 플러터를 사용하다가 실수로 업그레이드 하거나 하는 이유로, 잘 빌드되던 기존 코드가 빌드에 실패하는 불상사가 발생하곤 한다. 이 때는 당황하지 말고 플러터 버전을 다운그레이드하면 된다! (For reasons such as accidentally upgrading while using Flutter, Existing code that was built well often fails to build. In this case, don't panic and just downgrade the Flutter version!) 1. 아래 링크를 타고 들어가면, flutte.. 2022. 9. 6.
[Flutter] apk build command (debug, release available) (apk 빌드 명령(debug, release 가능)) [Flutter] apk build command (debug, release available) apk 빌드 명령(debug, release 가능) - build for debug flutter build apk --debug --target-platform=android-arm64 - build for release flutter build apk --release --target-platform=android-arm64 2022. 8. 31.
반응형