Skip to content

Commit

Permalink
TF-2893 Write unit test for getUserAgent method
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Jun 3, 2024
1 parent aa58436 commit b83ff97
Show file tree
Hide file tree
Showing 20 changed files with 458 additions and 28 deletions.
2 changes: 1 addition & 1 deletion core/lib/presentation/utils/icon_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
import 'package:core/utils/platform_info.dart';

class IconUtils {
static const double defaultIconSize = PlatformInfo.isWeb ? 20.0 : 24.0;
static double defaultIconSize = PlatformInfo.isWeb ? 20.0 : 24.0;
}
19 changes: 10 additions & 9 deletions core/lib/utils/platform_info.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
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 {
static const bool isWeb = kIsWeb;
static bool get isLinux => !kIsWeb && Platform.isLinux;
static bool get isWindows => !kIsWeb && Platform.isWindows;
static bool get isMacOS => !kIsWeb && Platform.isMacOS;
static bool get isFuchsia => !kIsWeb && Platform.isFuchsia;
static bool get isIOS => !kIsWeb && Platform.isIOS;
static bool get isAndroid => !kIsWeb && Platform.isAndroid;
@visibleForTesting
static bool isTestingForWeb = false;

static bool get isWeb => kIsWeb || isTestingForWeb;
static bool get isLinux => !kIsWeb && defaultTargetPlatform == TargetPlatform.linux;
static bool get isWindows => !kIsWeb && defaultTargetPlatform == TargetPlatform.windows;
static bool get isMacOS => !kIsWeb && defaultTargetPlatform == TargetPlatform.macOS;
static bool get isFuchsia => !kIsWeb && defaultTargetPlatform == TargetPlatform.fuchsia;
static bool get isIOS => !kIsWeb && defaultTargetPlatform == TargetPlatform.iOS;
static bool get isAndroid => !kIsWeb && defaultTargetPlatform == TargetPlatform.android;
static bool get isMobile => isAndroid || isIOS;
static bool get isDesktop => isLinux || isWindows || isMacOS;
static bool get isCanvasKit => isRendererCanvasKit;
Expand Down
Loading

0 comments on commit b83ff97

Please sign in to comment.