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 |
Tags
- Notification
- github
- Realm
- SwiftUI
- window
- UIButton
- Archive
- Code
- FLUTTER
- Swift
- appstore
- rxswift
- iOS16
- Session
- Xcode
- 개발자
- error
- MacOS
- mac
- 한글
- JPA
- Git
- 웹뷰
- geofencing
- IOS
- Firebase
- darkmode
- 이미지
- Apple
- view
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