본문 바로가기

개발/Flutter22

[Flutter] container background gradient flutter 그라데이션 주기(gradient)자주는 아니지만 가끔 쓰는경우가있어서 정리해본다LinearGradientContainer( decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [ Colors.yellow, Colors.pink, ], ), ),),Container( decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: .. 2022. 12. 19.
[Flutter] dio 사용중 에러 Connection refused (OS Error: Connection refused, errno = 111), address = 10.0.2.2, port = 52314 문제 지금 API 서버로 Nest.JS를 로컬에서 실행하고있다. port는 3000이다 앱 테스트를 위해 안드로이드 실기기를 맥북에 연결후 빌드해서 api를 사용하려는데 아래 에러가 발생했다 [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioError [DioErrorType.other]: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 10.0.2.2, port = 52314 나는 지금 현재 기기가 ios인지 아닌지 판단해서 http://$ip/auth/login 이런 api를 호출하려고했다. $ip는 io.. 2022. 12. 15.
[Flutter] checkbox 크기 조절하기 문제 사이드 프로젝트를 하던중, 체크박스의 크기를 바꾸고싶었는데 아무리 찾아봐도 checkbox 속성에 크기를 바꿀수있는게 없었다.. checkbox 코드로 들어가보면 기본크기는 18.0 으로 설정되어있는거같다. 저 부분을 직접 수정하면 크기가 커지긴하는데, 그렇게 하고싶진않아서 다른방법을 찾아봤다. 해결 Transform.scale 을 사용하면된다 Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Transform.scale( scale: 0.6, child: Checkbox(value: true, onChanged: (value) {}), ), Checkbo.. 2022. 12. 13.
ios 시뮬레이터 다른 버전 실행하기 문제 ios 15.x 버전의 시뮬레이터를 실행해야되는 일이 생김 현재는 16.x 버전만 시뮬레이터가 생성되어있는 상태 해결 Xcode 실행 Xcode > Settings > Platforms > 왼쪽아래 + 버튼 > ios 원하는 버전 선택 > Download & Install 시뮬레이터 실행후 File > Open Simulator > 원하는 OS버전 + Device 실행 2022. 12. 7.
ios 16 천지인 키보드(10 key) 입력 이상하게되는 문제 (해결X) 문제 얼마전 어떤 유저가 한글 입력이 이상하게 된다고 문의를했다. 파악결과 아이폰 + 천지인 키보드를 쓰시는 분이었다. 대형 이라고 입력하면 대ㅎㅎ형 이런식으로 나오는 버그였다. 해결못함 찾아보니 flutter 깃헙 이슈에 완전히 동일한 증상의 글이 있었다. 쭉 읽어보니 ios 15.x 버전에서는 문제없었는데 16 이상에서 발생한다고한다. ios 실기기가없어서 시뮬레이터로 15.5버전과 16.1버전을 비교해봤는데 실제로 15.5 에서는 이런 문제가 발생하지않는다. 일단 당장 내수준에서는 어떻게 해결해야될지 감이안와서 기다리는수밖에 없을거같다.. 올해 9월26일 글인데 3개월이 다돼가는 지금까지 해결이 안된거보면 뒷전으로 밀린듯..? 8일전에 올라온 댓글을 보면 조만간 업데이트로 해결될거같기도하다.. 2022. 12. 7.
Could not build the application for the simulator 해결하기 문제 Swift Compiler Error (Xcode): Cannot find 'FlutterErrorNotImplemented' in scope ~~~ 파일 경로들 ~~~~ Could not build the application for the simulator Error launching application on iPhone 14 Pro Max. 손놓은지 반년은 훨씬 넘은 Flutter 앱을 다시 유지보수해야되는 상황이생겼다. 안드로이드는 어떻게든 됐는데, ios는 자꾸 위 에러가 발생하면서 빌드가안됐다. 해결 프로젝트 루트 폴더에서 차례대로 실행 rm ios/Podfile flutter pub upgrade flutter pub get cd ios pod update cd .. flutter c.. 2022. 12. 6.
PlatformException (PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)) 문제 PlatformException (PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)) firebase auth를 이용해서 로그인을 구현하는도중 발생한 에러 해결 대부분은 SHA 인증서 지문을 추가하면 해결된다 flutter 프로젝트 루트폴더에서 아래 명령어로 생성할수있다 맥북기준 keytool -list -v \ -alias androiddebugkey -keystore ~/.android/debug.keystore 비밀번호는 android 윈도우용 명령어나 자세한 내용은 아래링크에서 볼수있다 https://developers.google.com/android/guides.. 2022. 8. 4.
Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds 문제 Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds flutter 앱 개발중 ios Simulator로 앱을 실행하려고했는데 에러가 떴다. 해결 시뮬레이터 우클릭 > 종료 > 재실행 하면 된다 2022. 7. 17.
[Flutter] checkbox radius 기본 체크박스 코드 Checkbox( value: true, onChanged: (value) {}, }, 아래 shape 부분 코드를 추가하면 Border Radius 적용 가능 Checkbox( value: true, onChanged: (value) {}, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), ), ), 2022. 5. 19.
앱 개발할때 좋은 안드로이드 미러링 scrcpy [macOS] Flutter 개발할때 ios는 시뮬레이터로 하는데, android는 실기기로 하는편이다. (아이폰없음) 실기기로 테스트할때 편하게 하기위해 스마트폰 거치대도 보유하고있는데, scrcpy를 알게된뒤로는 쓴적이없다 아주 편한 scrcpy를 설치해보자 자세한것은 공식문서를 읽어보면 된다 //설치하기 brew install scrcpy 설치는 길면 몇분까지도 걸리는듯. 설치후 터미널에 scrcpy 를 입력하면 현재 연결된 스마트폰 화면이 바로 뜨는데 아주 편하다 더이상 스마트폰을 쳐다보지 않아도된다. 그냥 모니터에 vscode랑 같이 띄워놓으면 개꿀 만약 adb 어쩌고 하는 오류가 뜬다면 brew install android-platform-tools 입력후 설치하면 된다. 2022. 5. 7.