diff --git a/lib/screens/subtitle_styling_screen.dart b/lib/screens/subtitle_styling_screen.dart index b38379b6..10b9a2ae 100644 --- a/lib/screens/subtitle_styling_screen.dart +++ b/lib/screens/subtitle_styling_screen.dart @@ -52,13 +52,13 @@ class _SubtitleStylingScreenState extends State { } String _colorToHex(Color color) { - return '#${color.red.toRadixString(16).padLeft(2, '0')}${color.green.toRadixString(16).padLeft(2, '0')}${color.blue.toRadixString(16).padLeft(2, '0')}'.toUpperCase(); + return '#${((color.r * 255.0).round() & 0xff).toRadixString(16).padLeft(2, '0')}${((color.g * 255.0).round() & 0xff).toRadixString(16).padLeft(2, '0')}${((color.b * 255.0).round() & 0xff).toRadixString(16).padLeft(2, '0')}'.toUpperCase(); } Future _showColorPicker(String title, String currentColor, Function(String) onColorSelected) async { Color initialColor = _hexToColor(currentColor); - final Color? selectedColor = await showColorPickerDialog( + final Color selectedColor = await showColorPickerDialog( context, initialColor, title: Text(title), @@ -86,10 +86,8 @@ class _SubtitleStylingScreenState extends State { ), ); - if (selectedColor != null) { - final hexColor = _colorToHex(selectedColor); - onColorSelected(hexColor); - } + final hexColor = _colorToHex(selectedColor); + onColorSelected(hexColor); } @override diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index a425f19f..13443a48 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -10,7 +10,6 @@ import 'package:provider/provider.dart'; import '../models/plex_media_version.dart'; import '../models/plex_metadata.dart'; import '../models/plex_user_profile.dart'; -import '../models/plex_video_playback_data.dart'; import '../providers/playback_state_provider.dart'; import '../providers/plex_client_provider.dart'; import '../providers/settings_provider.dart';