본문 바로가기
반응형

Development Solutions/Flutter & Dart65

[Flutter][iOS] 데이터를 클라우드 말고 기기에만 저장하는 방법 [Flutter][iOS] 데이터를 클라우드 말고 기기에만 저장하는 방법 flutter_secure_storage 패키지 문제 상황 앱을 삭제했다가 다시 깔아도 이전에 설치했을 때 사용한 데이터를 받아온다. 원인 iOS는 데이터를 클라우드(iCloud)에도 저장하기 때문에 발생하는 문제 해결 방법 아래의 코드를 메인 함수에서 호출한다. clearSecureStorageOnReinstall() async { String key = 'hasRunBefore'; SharedPreferences prefs = await SharedPreferences.getInstance(); if(!prefs.getBool(key)) { FlutterSecureStorage storage = FlutterSecureStora.. 2023. 1. 10.
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.
[Solved] How to add configuration of flutter in Android Studio (안드로이드스튜디오에서 flutter의 configuration add하는 방법) How to add configuration of flutter in Android Studio 안드로이드스튜디오에서 flutter의 configuration add하는 방법 1. Android Studio에서 Preferences... 진입 (1. Enter Preferences... in Android Studio) 2. Plugins 탭에서 Flutter 다운로드 (2. Download Flutter from the Plugins tab) 2022. 9. 12.
반응형