티스토리 뷰
IOS X모델 이후로, 아이폰에서 bottom notch가 생겨버렸다. 아래쪽은 버튼은 없어지고 notch가 생겼고 위쪽은 M자로 생긴 모델이다.
이러한 모델에서는 OS단 자체에 top and bottom padding이 들어간다.
그래서 앱 UI Design을 설계할 때 bottom notch가 있는 것들과 없는 것들을 구분 시켜줘야 하는데 플러터 자체에서는 그 기능이 없다.
그래서 자체적으로 코드를 추가해줘야 한다.
아래와 같이 bool 코드를 짜준 다음에,
bool isNeedSafeArea = MediaQuery.of(context).viewPadding.bottom > 0;
디자인과 패딩을 적용시킬 부분에 삼항연산자를 이용하여서 구분시켜 주면 된다.
그리고 또한 SafeArea를 지정해줘야지 notch 부분을 살릴 수가 있다.
How do I check if device needs SafeArea? (needs bottom/top padding)
Is there a way that I can check if the device that is running the app needs a SafeArea. I need to run code based on this true or false value. I do NOT need to use the SafeArea widget. All I need is...
stackoverflow.com
참고링크: https://velog.io/@adbr/flutter-Check-if-current-device-has-notch-check-top-and-bottom-padding
[flutter] Check if current device has notch (check top and bottom padding)
Whether to avoid system intrusions on the bottom side of the screen.topbottomhttps://stackoverflow.com/questions/58848681/how-do-i-check-if-devic
velog.io
참고링크: https://medium.com/macoclock/solving-iphone-bottom-notch-problem-in-flutter-5785a0fc22e4
Solving iPhone bottom notch problem in Flutter
How to find an ugly solution to iPhone bottom notches problem for Flutter floating action buttons in the days of Corona?
medium.com
'개발 > Flutter' 카테고리의 다른 글
- Total
- Today
- Yesterday
- 조종사 #조종사되는법 #
- 정부정책 #청년정책 #정부청년지원 #경기도청년지원
- 드론 #시마x5 #symax5
- 드론구술시험 #초경량비행장치1종 구술시험
- 실업급여
- flutter #fluttererror #flutterioserror
- 조종사 #국토부 조종사 #조종사 수급상황 #항공기 조종사 #항공기 당 조종사 비율 #국적항공사 조종사 수
- 영어공부 #TED #TED 영어공부 #3분영어 #영어회화 #영어
- flutter #flutter background service
- 쿠팡이츠 배달파트너 #배민컨넥트 #자전거배달 #로드자전거배달 #직장인 부수입 #부업 #알바
- dart
- flutter #localization #flutterlocalization
- 대한항공 조종사 #대한항공 조종사 채용 #신입조종사 채용 #조종사 채용
- 공공데이터 청년인턴 #공공데이터 #알바 #공공데이터 청년인턴 후기
- flutter listviews #flutter
- flutter #udp #flutterudp
- #저작권보호원 #저작권보호원 면접 #저작권보호원 2차 #디지털 알바 #디지털 부업 #저작권 보호원 모니터링 #모니터링알바 #저작권 보호원 청년 #저작권 보호원 청년 모니터링
- Ted #영어공부 #3분영어 #영어회화 #영어
- 매빅미니2 #촬여용 드론 #드론 #mavic mini2
- flutter #firebase #개발
- ㅂ
- flutter #ios #android #smsautofill
- 대한항공 신입조종사 모집 #대한항공 조종사 모집
- 시력 #시력 개선 #눈운동 #조종사 눈건강 #시력회복 #눈 영양제
- 드론 #초경량비행장치 #비행 #항공 #드론자격증 #드론1종
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |