플러터팁

Flutter/Tip

[Flutter] 이번 달의 일수를 얻는 법. 28일,29일,30일,31일 확인법 (How to determine the number of days in the current month.)

생년월일을 찾는다거나 캘린더 가지고 무언가를 할 때 임의로 validator를 만들어야할 때가 있다. 입력한 숫자가 해당월을 넘는지 확인하고 싶다면 다음과 코드를 사용해라 ENG Sometimes, when you need to retrieve a person's birthdate or perform tasks involving a calendar, you may need to create a custom validator. If you want to check if a given number exceeds the number of days in a specific month, you can use the following code: DateTime(YYYY, month + 1, 0).day // 조건문..

Flutter/Tip

[Flutter] 전화걸기 / 링크이동 하기 (Making a phone call / navigating to a link)

유저들에게 어떠한 브랜드나 장소에 대한 상세정보를 제공하려고 하다보면 꼭 해야되는 것들이 있으니, 전화번호 연결과 링크이동이다. 아래처럼 하면 된다. ENG When providing detailed information to users about a brand or a location, there are certain essential actions that need to be included: connecting via phone call and navigating through a link. Here's how you can do it: launchUrl(Uri( scheme: 'tel', path: 'phone number',)); // 전화 걸기 launchUrl(Uri.parse('url'))..

Flutter/Tip

[Flutter] 스트링에서 숫자만 빼오는 방법 (How to extract numbers from a string)

아래처럼 하면 스트링에서 숫자만 빼올 수 있다. 코드를 깨끗하게 유지하기 위해서 왠만하면 공용함수로 만들어서 쓰는게 더 좋다. ENG The following approach allows you to extract only numbers from a string. It is advisable to create a reusable function whenever possible for better code organization and maintainability originalString = '123oct7'; // 과정 코드 numberString = originalString.replaceAll(new RegExp(r'[^0-9]'),''); // -> '1237' number = int.parse(..

OCT7
'플러터팁' 태그의 글 목록