본문 바로가기

분류 전체보기

(21)
[Flutter] TextField 특정 문자열만 입력 가능하게 하기 처음에는 아래 코드처럼 특수문자만 입력을 막아보려 했으나.. TextField( inputFormatters: [ FilteringTextInputFormatter.deny(RegExp('[!@#\$%^&*(),.?":{}|]')), ], ), 언어의 구조상 모두 막을 수 없다는 것을 알게었습니다. 그리하여 허용되는 값만 입력받도록 변경했습니다. [한글만 입력] 만약 공백 까지 포함하려면 '힣' 뒤에 스페이스바로 한번 띄어주기(이하 동일) TextField( inputFormatters: [ FilteringTextInputFormatter.allow(RegExp(r'[ㄱ-ㅎ가-힣]')), ], ), [영문만 입력] TextField( inputFormatters: [ FilteringTextInputF..
[Flutter] 데이터 타입 double 소수점 제거하는 방법 Flutter에서 double의 소수점을 제거하는 방법은 몇 가지가 있습니다. 아래는 그 중 일부 예시입니다. 1. toInt() 메서드 사용 double myDouble = 3.14159; int myInt = myDouble.toInt(); print(myInt); // 출력: 3 2. toString() 및 double.parse() 조합 double myDouble = 3.14159; String myString = myDouble.toString(); int myInt = double.parse(myString).toInt(); print(myInt); // 출력: 3 3. truncate() 메서드 사용 double myDouble = 3.14159; int myInt = myDouble.tr..
[Flutter] SVG 파일 검정색(검은색)으로 나올 때 요즘 플러터(Flutter) 공부하면서 SVG 파일을 자주 사용한다. 아무래도 JPG, PNG 보다는 활용성이 용이한 SVG 파일을 사용하는게 당연지사이다. 문제는 일러스트레이터 에서 SVG 내보내기 후 플러터에서 불러왔더니.. 아이고 참.. 뭔 이런일이.. 구글링해보니 문제는 일러스트레이터에서 내보내기 시 설정을 바꿔줘야 했던 것! 보통 File ▶ Export ▶ Export As... 이 메뉴로 들어가 내보낼 확장자명을 SVG 로 선택하면 이런 옵션 창이 나온다. 다른 옵션은 처음그대로 두고, 가장 첫번째 Styling 항목에서 기본 설정인 Intemal CSS 를 Presentation Attributes 로 변경해주고 OK 버튼 눌러준다. 그리하면.. 짜잔~ 이쁘게 SVG 파일이 출력되는 걸 볼..
원본에 그림자를 살리며 배경 색상 바꾸기 (누끼, 상세이미지) 원본에 그림자를 살리며 배경 색상을 바꾸는 방법입니다. 제품을 촬영하고 단순하게 배경색 또는 패턴을 변경할 때 손쉽게 이용할 수 있는 기능입니다. 물론 더 좋은 퀄리티를 위해서는 배경을 꾸미고 한번에 촬영하는 방법이 좋지만 시간이 많이 걸리죠. 제품이 많을 경우 이 방법으로 하시면 빠르게 작업하실 수 있습니다. #1 우선 원하시는 해상도에 신규 도큐먼트를 생성하시고 촬영한 이미지를 불러온 후 Select ▶ Subject 해주세요. 디테일한 영역 설정은 셀렉트 도구로 다듬어 줍니다. #2 선택작업이 끝난 후 Layer Mask 로 마스크 영역으로 설정해줍니다. #3 Solid Color 로 원하시는 색상을 선택해주세요. 색상이 아닌 패턴 이미지 또는 배경 이미지를 삽입해 주셔도 무방합니다. #4 배경으로..
Android Studio (version 2022.2) / Unable to find bundled Java version. 간만에 집에서 플러터 공부나 해볼까 했는데.. 플러터 프로젝트를 신규 생성했더니 플러터 의사 불러오랍니다.. 왜??? 몇주 전 까지는 닥터에 아무런 문제가 없었는데? 갑자기??? 그래서 돌려보니.. PS E:\coding\*****> flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [Version 10.0.22621.2134], locale ko-KR) [X] Windows Version (Unable to confirm if installed Windows version is 10 or greater) [√] Andr..
iOS 디바이스 시뮬레이터 갑자기 안될 때 (error: Failed to halt process: Halt timed out. State = running Error launching application...) [환경] - Mac OS - 안드로이드스튜디오 error: Failed to halt process: Halt timed out. State = running Error launching application 기기명... 뭐 이런 에러가 시뮬레이터를 빌드할 때 갑자기 출력되더라고요.. 이럴 때는.. Project Files > Flutter > Open iOS module in Xcode 실행하면 Xcode 가 실행됩니다. 그리고 Runner 왼쪽에 ► 버튼 눌러주면 시뮬레이터가 Xcode 에서 정상적으로 빌드 됩니다. 실행을 다시 종료하고 안드로이드스튜디오에서 다시 시뮬레이터 실행하면 정상으로 실행 됩니다. [출처] iOS Observatory not discovered after 30 seconds...
Error: Unable to find git in your PATH. 윈도우 포멧 후 플러터와 안드로이드 스튜디오 설치하고 환경설정에서 PATH 설정을 하고나서 flutter doctor 로 검사한번 했더니.. Error: Unable to find git in your PATH. 구글링 해보니.. 파워셀 실행 후 git config --global --add safe.directory '*' 입력. 해결.
[Flutter] StateNotifierProvider ▶︎ NotifierProvider 벼환하여 상태관리 StateNotifierProvider | Riverpod StateNotifierProvider is a provider that is used to listen to and expose a riverpod.dev StateNotifierProvider 보다는 NotifierProvider 사용을 권장한다고 한다. *Example Code final ***Provider = NotifierProvider(() { return ***Notifier(); }); class ***Notifier extends Notifier { @override ***Entity build() { return ***Entity(); } 아.. 이거 언제 다 바꾸냐.. ( ㅡ^ㅡ);;;
[Flutter] Flutter Doctor 에러 처리 모음 (안드로이드스튜디오) [Windows] - #1 ---------------------------------------------------------------------------------------------------- [!] Android Studio (version 2022.2) X Unable to find bundled Java version. [!] Android Studio X android-studio-dir = c:\Program Files\Android\Android Studio X Unable to find bundled Java version. --------------------------------------------------------------------------------------..
[Flutter] 드롭다운 버튼(DropdownButton) 기존 몇 안되는 아이템(항목)은 이렇게 코드를 작성 했다. SizedBox( width: 205, height: 40, child: DropdownButtonHideUnderline( child: Container( padding: const EdgeInsets.only( top: 4, bottom: 4, left: 14, ), decoration: BoxDecoration( color: Colors.white, border: Border.all( width: 1, color: Colors.black, ), borderRadius: const BorderRadius.all( Radius.circular(5), ), ), child: DropdownButton( isExpanded: true, //화살표 ..