Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LOG-TAG/04dc8672e1b40f8815c09d9668a32b59 to your computer and use it in GitHub Desktop.
Save LOG-TAG/04dc8672e1b40f8815c09d9668a32b59 to your computer and use it in GitHub Desktop.
Flutter Device Utils
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