diff --git a/packages/stac_cli/pubspec.lock b/packages/stac_cli/pubspec.lock index 7dd8bdbc5..fc7505afc 100644 --- a/packages/stac_cli/pubspec.lock +++ b/packages/stac_cli/pubspec.lock @@ -241,11 +241,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - flutter: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" frontend_server_client: dependency: transitive description: @@ -358,14 +353,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.19" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" - url: "https://pub.dev" - source: hosted - version: "0.13.0" meta: dependency: transitive description: @@ -462,11 +449,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" source_gen: dependency: transitive description: @@ -601,14 +583,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b - url: "https://pub.dev" - source: hosted - version: "2.2.0" vm_service: dependency: transitive description: diff --git a/packages/stac_logger/lib/src/log_web.dart b/packages/stac_logger/lib/src/log_web.dart index bd2057b27..19bff30d5 100644 --- a/packages/stac_logger/lib/src/log_web.dart +++ b/packages/stac_logger/lib/src/log_web.dart @@ -1,8 +1,21 @@ -import 'package:flutter/foundation.dart'; import 'package:stac_logger/src/log_interface.dart'; LogInterface createLogger() => LogWeb.instance; +/// Whether the app is running in debug mode. +/// +/// This is a pure Dart equivalent of Flutter's `kDebugMode`. +/// It evaluates to `true` when assertions are enabled (debug mode) +/// and `false` in release/profile mode. +final bool _kDebugMode = () { + var isDebug = false; + assert(() { + isDebug = true; + return true; + }()); + return isDebug; +}(); + /// Web/WASM-compatible implementation of LogInterface class LogWeb implements LogInterface { LogWeb._(); @@ -12,29 +25,29 @@ class LogWeb implements LogInterface { @override void d(dynamic message) { - if (kDebugMode) { - debugPrint('[DEBUG] $message'); + if (_kDebugMode) { + print('[DEBUG] $message'); } } @override void i(dynamic message) { - if (kDebugMode) { - debugPrint('[INFO] $message'); + if (_kDebugMode) { + print('[INFO] $message'); } } @override void w(dynamic message) { - if (kDebugMode) { - debugPrint('[WARNING] $message'); + if (_kDebugMode) { + print('[WARNING] $message'); } } @override void e(dynamic message) { - if (kDebugMode) { - debugPrint('[ERROR] $message'); + if (_kDebugMode) { + print('[ERROR] $message'); } } } diff --git a/packages/stac_logger/pubspec.yaml b/packages/stac_logger/pubspec.yaml index 22f994116..abd3de983 100644 --- a/packages/stac_logger/pubspec.yaml +++ b/packages/stac_logger/pubspec.yaml @@ -6,51 +6,10 @@ repository: https://github.com/StacDev/stac/tree/dev/packages/stac_logger environment: sdk: ^3.8.1 - flutter: ">=1.17.0" dependencies: - flutter: - sdk: flutter logger: ^2.5.0 dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^5.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/to/asset-from-package - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/to/font-from-package + test: ^1.24.0 + lints: ^6.0.0