style: Update for team lint (#297)
* Update for team lint * fix tests * remove pedantic and sort deps * remove jiffy from system message Co-authored-by: Salvatore Giordano <[email protected]>
This commit is contained in:
co-authored by
Salvatore Giordano
parent
e13ce930a6
commit
c5252ab4d4
@@ -1,29 +1,29 @@
|
||||
import 'platform_detector_stub.dart'
|
||||
import 'package:stream_chat/src/platform_detector/platform_detector_stub.dart'
|
||||
if (dart.library.html) 'platform_detector_web.dart'
|
||||
if (dart.library.io) 'platform_detector_io.dart';
|
||||
|
||||
/// Possible platforms
|
||||
enum PlatformType {
|
||||
///
|
||||
Android,
|
||||
android,
|
||||
|
||||
///
|
||||
Ios,
|
||||
ios,
|
||||
|
||||
///
|
||||
Web,
|
||||
web,
|
||||
|
||||
///
|
||||
MacOS,
|
||||
macOS,
|
||||
|
||||
///
|
||||
Windows,
|
||||
windows,
|
||||
|
||||
///
|
||||
Linux,
|
||||
linux,
|
||||
|
||||
///
|
||||
Fuchsia,
|
||||
fuchsia,
|
||||
}
|
||||
|
||||
/// Utility class that provides information on the current platform
|
||||
@@ -31,42 +31,42 @@ class CurrentPlatform {
|
||||
CurrentPlatform._();
|
||||
|
||||
/// True if the app is running on android
|
||||
static bool get isAndroid => type == PlatformType.Android;
|
||||
static bool get isAndroid => type == PlatformType.android;
|
||||
|
||||
/// True if the app is running on ios
|
||||
static bool get isIos => type == PlatformType.Ios;
|
||||
static bool get isIos => type == PlatformType.ios;
|
||||
|
||||
/// True if the app is running on web
|
||||
static bool get isWeb => type == PlatformType.Web;
|
||||
static bool get isWeb => type == PlatformType.web;
|
||||
|
||||
/// True if the app is running on macos
|
||||
static bool get isMacOS => type == PlatformType.MacOS;
|
||||
static bool get isMacOS => type == PlatformType.macOS;
|
||||
|
||||
/// True if the app is running on windows
|
||||
static bool get isWindows => type == PlatformType.Windows;
|
||||
static bool get isWindows => type == PlatformType.windows;
|
||||
|
||||
/// True if the app is running on linux
|
||||
static bool get isLinux => type == PlatformType.Linux;
|
||||
static bool get isLinux => type == PlatformType.linux;
|
||||
|
||||
/// True if the app is running on fuchsia
|
||||
static bool get isFuchsia => type == PlatformType.Fuchsia;
|
||||
static bool get isFuchsia => type == PlatformType.fuchsia;
|
||||
|
||||
/// Returns a string version of the platform
|
||||
static String get name {
|
||||
switch (type) {
|
||||
case PlatformType.Android:
|
||||
case PlatformType.android:
|
||||
return 'android';
|
||||
case PlatformType.Ios:
|
||||
case PlatformType.ios:
|
||||
return 'ios';
|
||||
case PlatformType.Web:
|
||||
case PlatformType.web:
|
||||
return 'web';
|
||||
case PlatformType.MacOS:
|
||||
case PlatformType.macOS:
|
||||
return 'macos';
|
||||
case PlatformType.Windows:
|
||||
case PlatformType.windows:
|
||||
return 'windows';
|
||||
case PlatformType.Linux:
|
||||
case PlatformType.linux:
|
||||
return 'linux';
|
||||
case PlatformType.Fuchsia:
|
||||
case PlatformType.fuchsia:
|
||||
return 'fuchsia';
|
||||
default:
|
||||
return '';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'dart:io';
|
||||
import 'platform_detector.dart';
|
||||
import 'package:stream_chat/src/platform_detector/platform_detector.dart';
|
||||
|
||||
/// Version running on native systems
|
||||
PlatformType get currentPlatform {
|
||||
if (Platform.isWindows) return PlatformType.Windows;
|
||||
if (Platform.isFuchsia) return PlatformType.Fuchsia;
|
||||
if (Platform.isMacOS) return PlatformType.MacOS;
|
||||
if (Platform.isLinux) return PlatformType.Linux;
|
||||
if (Platform.isIOS) return PlatformType.Ios;
|
||||
return PlatformType.Android;
|
||||
if (Platform.isWindows) return PlatformType.windows;
|
||||
if (Platform.isFuchsia) return PlatformType.fuchsia;
|
||||
if (Platform.isMacOS) return PlatformType.macOS;
|
||||
if (Platform.isLinux) return PlatformType.linux;
|
||||
if (Platform.isIOS) return PlatformType.ios;
|
||||
return PlatformType.android;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'platform_detector.dart';
|
||||
import 'package:stream_chat/src/platform_detector/platform_detector.dart';
|
||||
|
||||
/// Stub implementation
|
||||
PlatformType get currentPlatform {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'platform_detector.dart';
|
||||
import 'package:stream_chat/src/platform_detector/platform_detector.dart';
|
||||
|
||||
/// Version running on web
|
||||
PlatformType get currentPlatform => PlatformType.Web;
|
||||
PlatformType get currentPlatform => PlatformType.web;
|
||||
|
||||
Reference in New Issue
Block a user