-
-
Save samuelematias/a35992e0c46837261410478dbd484459 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