common.dart 685 B

12345678910111213141516171819202122
  1. import 'dart:js' as js;
  2. import 'dart:html' as html;
  3. // cycle imports, maybe we can improve this
  4. import 'package:flutter_hbb/consts.dart';
  5. final isAndroid_ = false;
  6. final isIOS_ = false;
  7. final isWindows_ = false;
  8. final isMacOS_ = false;
  9. final isLinux_ = false;
  10. final isWeb_ = true;
  11. final isWebDesktop_ = !js.context.callMethod('isMobile');
  12. final isDesktop_ = false;
  13. String get screenInfo_ => js.context.callMethod('getByName', ['screen_info']);
  14. final _localOs = js.context.callMethod('getByName', ['local_os', '']);
  15. final isWebOnWindows_ = _localOs == kPeerPlatformWindows;
  16. final isWebOnLinux_ = _localOs == kPeerPlatformLinux;
  17. final isWebOnMacOS_ = _localOs == kPeerPlatformMacOS;