Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- JPA
- view
- Archive
- iOS16
- 한글
- Session
- github
- window
- Python
- appstore
- Apple
- SwiftUI
- IOS
- 개발자
- FLUTTER
- stack
- Firebase
- error
- UIButton
- Notification
- Realm
- Git
- darkmode
- Xcode
- Swift
- mac
- rxswift
- MacOS
- Code
- 웹뷰
Archives
- Today
- Total
EEYatHo 앱 깎는 이야기
Flutter ) OS 구분 - EEYatHo Flutter 본문
반응형
1. package:flutter/foundation.dart 사용
import 'package:flutter/foundation.dart';
if (defaultTargetPlatform == TargetPlatform.iOS) {
// ios
} else if (defaultTargetPlatform == TargetPlatform.android) {
// android
}
... /// fuchsia, linux, macOS, windows
2. dart:io 사용
import 'dart:io';
if (Platform.isIOS) {
// iOS
} else if (Platform.isAndroid) {
// android
}
... /// isLinux, isMacOS, isWindows, isFuchsia
'Flutter > Tip' 카테고리의 다른 글
Flutter ) 탭바 돌아와도 initState 안하기 - EEYatHo Flutter (0) | 2022.10.28 |
---|
Comments