Sync all use PlatformInfo to check platform while runtime
(cherry picked from commit 514fec1f2f4f1ff8a584bf8db7bf3a5537a3e9f8)
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/data/network/dio_client.dart';
|
||||
import 'package:core/data/utils/compress_file_utils.dart';
|
||||
import 'package:core/presentation/extensions/html_extension.dart';
|
||||
import 'package:core/presentation/utils/html_transformer/base/dom_transformer.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:html/dom.dart';
|
||||
@@ -59,7 +63,7 @@ class ImageTransformer extends DomTransformer {
|
||||
options: Options(responseType: ResponseType.bytes));
|
||||
|
||||
if (responseData != null) {
|
||||
if (BuildUtils.isWeb) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
return encodeToBase64Uri(responseData);
|
||||
} else {
|
||||
final bytesCompressed = await compressFileUtils.compressBytesDataImage(responseData);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import 'package:core/utils/build_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
|
||||
class IconUtils {
|
||||
static const double defaultIconSize = BuildUtils.isWeb ? 20.0 : 24.0;
|
||||
static const double defaultIconSize = PlatformInfo.isWeb ? 20.0 : 24.0;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:core/utils/build_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -82,7 +82,7 @@ class ResponsiveUtils {
|
||||
}
|
||||
|
||||
bool hasLeftMenuDrawerActive(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
return isMobile(context) ||
|
||||
isTablet(context) ||
|
||||
isTabletLarge(context);
|
||||
@@ -92,13 +92,13 @@ class ResponsiveUtils {
|
||||
}
|
||||
|
||||
bool isWebDesktop(BuildContext context) =>
|
||||
BuildUtils.isWeb && isDesktop(context);
|
||||
PlatformInfo.isWeb && isDesktop(context);
|
||||
|
||||
bool isWebNotDesktop(BuildContext context) =>
|
||||
BuildUtils.isWeb && !isDesktop(context);
|
||||
PlatformInfo.isWeb && !isDesktop(context);
|
||||
|
||||
bool mailboxDashboardOnlyHasEmailView(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
return isMobile(context) || isTablet(context);
|
||||
} else {
|
||||
return isPortraitMobile(context) ||
|
||||
@@ -108,7 +108,7 @@ class ResponsiveUtils {
|
||||
}
|
||||
|
||||
bool landscapeTabletSupported(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
return isTabletLarge(context);
|
||||
} else {
|
||||
return !isLandscapeMobile(context) && (isLandscapeTablet(context) ||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CommonTextStyle {
|
||||
@@ -9,9 +10,9 @@ class CommonTextStyle {
|
||||
fontWeight: FontWeight.normal,
|
||||
);
|
||||
|
||||
static const defaultTextOverFlow = BuildUtils.isWeb
|
||||
static const defaultTextOverFlow = PlatformInfo.isWeb
|
||||
? TextOverflow.fade
|
||||
: TextOverflow.ellipsis;
|
||||
|
||||
static const defaultSoftWrap = BuildUtils.isWeb ? false : true;
|
||||
static const defaultSoftWrap = PlatformInfo.isWeb ? false : true;
|
||||
}
|
||||
Reference in New Issue
Block a user