From 8d77c85aa07754be0bf49b3894fd4b7f4dbf9bd8 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Sun, 15 Dec 2024 17:01:45 +1100 Subject: [PATCH] Fix deprecated Color.value --- audio_service_platform_interface/CHANGELOG.md | 4 ++++ .../lib/audio_service_platform_interface.dart | 21 ++++++++++--------- audio_service_platform_interface/pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/audio_service_platform_interface/CHANGELOG.md b/audio_service_platform_interface/CHANGELOG.md index 8df42811..ec31b52f 100644 --- a/audio_service_platform_interface/CHANGELOG.md +++ b/audio_service_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.3 + +* Fix deprecated Color.value. + ## 0.1.2 * Support MPNowPlayingInfoPropertyIsLiveStream on IOS (@MuradSh, @celsoft). diff --git a/audio_service_platform_interface/lib/audio_service_platform_interface.dart b/audio_service_platform_interface/lib/audio_service_platform_interface.dart index d5af801b..61fc0609 100644 --- a/audio_service_platform_interface/lib/audio_service_platform_interface.dart +++ b/audio_service_platform_interface/lib/audio_service_platform_interface.dart @@ -1421,7 +1421,8 @@ class AudioServiceConfigMessage { 'androidNotificationChannelName': androidNotificationChannelName, 'androidNotificationChannelDescription': androidNotificationChannelDescription, - 'notificationColor': notificationColor?._colorValue, + // ignore: deprecated_member_use + 'notificationColor': notificationColor?.value, //_colorValue, 'androidNotificationIcon': androidNotificationIcon, 'androidShowNotificationBadge': androidShowNotificationBadge, 'androidNotificationClickStartsActivity': @@ -1446,12 +1447,12 @@ Map? _castMap(Map? map) => map?.cast(); /// Reimplements deprecated Color.value. -extension _ColorExtension on Color { - int get _colorValue => - _floatToInt8(a) << 24 | - _floatToInt8(r) << 16 | - _floatToInt8(g) << 8 | - _floatToInt8(b) << 0; - - int _floatToInt8(double x) => (x * 255.0).round() & 0xff; -} +// extension _ColorExtension on Color { +// int get _colorValue => +// _floatToInt8(a) << 24 | +// _floatToInt8(r) << 16 | +// _floatToInt8(g) << 8 | +// _floatToInt8(b) << 0; +// +// int _floatToInt8(double x) => (x * 255.0).round() & 0xff; +// } diff --git a/audio_service_platform_interface/pubspec.yaml b/audio_service_platform_interface/pubspec.yaml index fdcc738b..ab06542e 100644 --- a/audio_service_platform_interface/pubspec.yaml +++ b/audio_service_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the audio_service plugin. Different homepage: https://github.com/ryanheise/audio_service/tree/master/audio_service_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 0.1.2 +version: 0.1.3 dependencies: flutter: