TF-2537 Fix app crash when user trying attach file to composer in web app
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/utils/web_renderer/canvas_kit.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
abstract class PlatformInfo {
|
||||
@@ -13,7 +14,7 @@ abstract class PlatformInfo {
|
||||
static bool get isAndroid => !kIsWeb && Platform.isAndroid;
|
||||
static bool get isMobile => isAndroid || isIOS;
|
||||
static bool get isDesktop => isLinux || isWindows || isMacOS;
|
||||
static bool get isWebMobile => kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.android);
|
||||
static bool get isCanvasKit => isRendererCanvasKit;
|
||||
|
||||
static String get platformNameOS {
|
||||
var platformName = '';
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export 'canvas_kit_stub.dart' if (dart.library.html) 'canvas_kit_web.dart';
|
||||
@@ -0,0 +1,4 @@
|
||||
/// Whether the CanvasKit renderer is being used on web.
|
||||
///
|
||||
/// Always returns `false` on non-web.
|
||||
bool get isRendererCanvasKit => false;
|
||||
@@ -0,0 +1,6 @@
|
||||
import 'dart:js' as js;
|
||||
|
||||
/// Whether the CanvasKit renderer is being used on web.
|
||||
///
|
||||
/// Always returns `false` on non-web.
|
||||
bool get isRendererCanvasKit => js.context['flutterCanvasKit'] != null;
|
||||
Reference in New Issue
Block a user