parent
c54424d393
commit
6b9c85f7cc
4 changed files with 15 additions and 11 deletions
@ -1,3 +1,12 @@ |
||||
import 'dart:io'; |
||||
import 'package:flutter/foundation.dart'; |
||||
|
||||
bool isMobile() => Platform.isAndroid || Platform.isIOS; |
||||
bool isMobile([TargetPlatform? targetPlatform]) { |
||||
targetPlatform ??= defaultTargetPlatform; |
||||
return {TargetPlatform.iOS, TargetPlatform.android}.contains(targetPlatform); |
||||
} |
||||
|
||||
bool get isDesktop => { |
||||
TargetPlatform.macOS, |
||||
TargetPlatform.linux, |
||||
TargetPlatform.windows |
||||
}.contains(defaultTargetPlatform); |
||||
|
Loading…
Reference in new issue