-
-
Save ansarizafar/90fb8c7113d938da6b53e57fd798adbc to your computer and use it in GitHub Desktop.
Flutter Device Utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
import 'dart:io'; | |
bool get isWeb => kIsWeb; | |
bool get isMobile => !isWeb && (Platform.isIOS || Platform.isAndroid); | |
bool get isDesktop => | |
!isWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux); | |
bool get isApple => !isWeb && (Platform.isIOS || Platform.isMacOS); | |
bool get isGoogle => !isWeb && (Platform.isAndroid || Platform.isFuchsia); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment