From e607a6d19b753441cf99291b25a6c3fe48e51827 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sat, 4 Jan 2025 22:33:20 +0100 Subject: [PATCH 01/12] chore: Updated fvp to 0.29.0 --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 632d3e9..e011959 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -750,10 +750,10 @@ packages: dependency: "direct main" description: name: fvp - sha256: "3dd245cac5dfba36311cbf5834d8f275ba1f3e49a5cdcb4a98e01cb41e9a21d8" + sha256: ad134b93f6400edd93e674ee15b9d365d0227b7fb1f013ac60f0dc601d387c78 url: "https://pub.dev" source: hosted - version: "0.28.0" + version: "0.29.0" fwfh_cached_network_image: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e362bab..86eb184 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,7 +69,7 @@ dependencies: media_kit_video: ^1.2.4 # For video rendering. media_kit_libs_video: ^1.0.4 # Native video dependencies. audio_service: ^0.18.12 - fvp: ^0.28.0 + fvp: ^0.29.0 video_player: ^2.9.2 # UI Components From a817d404632de654fe6a096ae2c19c727173fede Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sat, 4 Jan 2025 23:12:32 +0100 Subject: [PATCH 02/12] chore: Update flutter to 3.27 and updated packages --- .fvmrc | 2 +- .vscode/settings.json | 34 +- lib/jellyfin/jellyfin_open_api.swagger.dart | 3 +- lib/jellyfin/jellyfin_open_api.swagger.g.dart | 8082 +++++++---------- lib/providers/api_provider.dart | 30 +- lib/providers/api_provider.g.dart | 2 +- lib/providers/book_viewer_provider.dart | 11 +- lib/providers/discovery_provider.g.dart | 2 +- .../items/movies_details_provider.g.dart | 4 +- lib/providers/library_filters_provider.g.dart | 4 +- lib/providers/session_info_provider.g.dart | 2 +- .../sync/background_download_provider.g.dart | 4 +- .../sync/sync_provider_helpers.g.dart | 10 +- lib/providers/user_provider.g.dart | 4 +- .../book_viewer/book_viewer_reader.dart | 7 +- lib/screens/shared/media/external_urls.dart | 28 +- lib/wrappers/media_control_wrapper.dart | 6 +- linux/flutter/generated_plugin_registrant.cc | 8 +- linux/flutter/generated_plugins.cmake | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 4 +- pubspec.lock | 612 +- pubspec.yaml | 30 +- .../flutter/generated_plugin_registrant.cc | 6 +- windows/flutter/generated_plugins.cmake | 2 +- 24 files changed, 3848 insertions(+), 5051 deletions(-) diff --git a/.fvmrc b/.fvmrc index 906bbb3..5b5166d 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.24.3" + "flutter": "3.27.0" } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 3559d7e..c3c67ff 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,19 +1,19 @@ { - "cSpell.words": [ - "ficonsax", - "jellyfin", - "Jellyfin", - "LTRB", - "LTWH", - "outro" - ], - "dart.flutterSdkPath": ".fvm/versions/3.24.3", - "search.exclude": { - "**/.fvm": true - }, - "files.watcherExclude": { - "**/.fvm": true - }, - "editor.detectIndentation": true, - "dart.lineLength": 120 + "cSpell.words": [ + "ficonsax", + "jellyfin", + "Jellyfin", + "LTRB", + "LTWH", + "outro" + ], + "dart.flutterSdkPath": ".fvm/versions/3.27.0", + "search.exclude": { + "**/.fvm": true + }, + "files.watcherExclude": { + "**/.fvm": true + }, + "editor.detectIndentation": true, + "dart.lineLength": 120 } \ No newline at end of file diff --git a/lib/jellyfin/jellyfin_open_api.swagger.dart b/lib/jellyfin/jellyfin_open_api.swagger.dart index 1265503..2940a90 100644 --- a/lib/jellyfin/jellyfin_open_api.swagger.dart +++ b/lib/jellyfin/jellyfin_open_api.swagger.dart @@ -1,6 +1,7 @@ // ignore_for_file: type=lint import 'package:json_annotation/json_annotation.dart'; +import 'package:json_annotation/json_annotation.dart' as json; import 'package:collection/collection.dart'; import 'dart:convert'; @@ -30,7 +31,7 @@ abstract class JellyfinOpenApi extends ChopperService { ErrorConverter? errorConverter, Converter? converter, Uri? baseUrl, - Iterable? interceptors, + List? interceptors, }) { if (client != null) { return _$JellyfinOpenApi(client); diff --git a/lib/jellyfin/jellyfin_open_api.swagger.g.dart b/lib/jellyfin/jellyfin_open_api.swagger.g.dart index 3410a90..5c02ac6 100644 --- a/lib/jellyfin/jellyfin_open_api.swagger.g.dart +++ b/lib/jellyfin/jellyfin_open_api.swagger.g.dart @@ -15,22 +15,15 @@ AccessSchedule _$AccessScheduleFromJson(Map json) => endHour: (json['EndHour'] as num?)?.toDouble(), ); -Map _$AccessScheduleToJson(AccessSchedule instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('UserId', instance.userId); - writeNotNull('DayOfWeek', dynamicDayOfWeekNullableToJson(instance.dayOfWeek)); - writeNotNull('StartHour', instance.startHour); - writeNotNull('EndHour', instance.endHour); - return val; -} +Map _$AccessScheduleToJson(AccessSchedule instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.userId case final value?) 'UserId': value, + if (dynamicDayOfWeekNullableToJson(instance.dayOfWeek) case final value?) + 'DayOfWeek': value, + if (instance.startHour case final value?) 'StartHour': value, + if (instance.endHour case final value?) 'EndHour': value, + }; ActivityLogEntry _$ActivityLogEntryFromJson(Map json) => ActivityLogEntry( @@ -47,27 +40,21 @@ ActivityLogEntry _$ActivityLogEntryFromJson(Map json) => severity: logLevelNullableFromJson(json['Severity']), ); -Map _$ActivityLogEntryToJson(ActivityLogEntry instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('Name', instance.name); - writeNotNull('Overview', instance.overview); - writeNotNull('ShortOverview', instance.shortOverview); - writeNotNull('Type', instance.type); - writeNotNull('ItemId', instance.itemId); - writeNotNull('Date', instance.date?.toIso8601String()); - writeNotNull('UserId', instance.userId); - writeNotNull('UserPrimaryImageTag', instance.userPrimaryImageTag); - writeNotNull('Severity', logLevelNullableToJson(instance.severity)); - return val; -} +Map _$ActivityLogEntryToJson(ActivityLogEntry instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.name case final value?) 'Name': value, + if (instance.overview case final value?) 'Overview': value, + if (instance.shortOverview case final value?) 'ShortOverview': value, + if (instance.type case final value?) 'Type': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.date?.toIso8601String() case final value?) 'Date': value, + if (instance.userId case final value?) 'UserId': value, + if (instance.userPrimaryImageTag case final value?) + 'UserPrimaryImageTag': value, + if (logLevelNullableToJson(instance.severity) case final value?) + 'Severity': value, + }; ActivityLogEntryMessage _$ActivityLogEntryMessageFromJson( Map json) => @@ -83,21 +70,15 @@ ActivityLogEntryMessage _$ActivityLogEntryMessageFromJson( ); Map _$ActivityLogEntryMessageToJson( - ActivityLogEntryMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.map((e) => e.toJson()).toList()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ActivityLogEntryMessage instance) => + { + if (instance.data?.map((e) => e.toJson()).toList() case final value?) + 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ActivityLogEntryQueryResult _$ActivityLogEntryQueryResultFromJson( Map json) => @@ -111,20 +92,14 @@ ActivityLogEntryQueryResult _$ActivityLogEntryQueryResultFromJson( ); Map _$ActivityLogEntryQueryResultToJson( - ActivityLogEntryQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + ActivityLogEntryQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; ActivityLogEntryStartMessage _$ActivityLogEntryStartMessageFromJson( Map json) => @@ -135,20 +110,13 @@ ActivityLogEntryStartMessage _$ActivityLogEntryStartMessageFromJson( ); Map _$ActivityLogEntryStartMessageToJson( - ActivityLogEntryStartMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ActivityLogEntryStartMessage instance) => + { + if (instance.data case final value?) 'Data': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ActivityLogEntryStopMessage _$ActivityLogEntryStopMessageFromJson( Map json) => @@ -158,19 +126,12 @@ ActivityLogEntryStopMessage _$ActivityLogEntryStopMessageFromJson( ); Map _$ActivityLogEntryStopMessageToJson( - ActivityLogEntryStopMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ActivityLogEntryStopMessage instance) => + { + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; AddVirtualFolderDto _$AddVirtualFolderDtoFromJson(Map json) => AddVirtualFolderDto( @@ -180,18 +141,12 @@ AddVirtualFolderDto _$AddVirtualFolderDtoFromJson(Map json) => json['LibraryOptions'] as Map), ); -Map _$AddVirtualFolderDtoToJson(AddVirtualFolderDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('LibraryOptions', instance.libraryOptions?.toJson()); - return val; -} +Map _$AddVirtualFolderDtoToJson( + AddVirtualFolderDto instance) => + { + if (instance.libraryOptions?.toJson() case final value?) + 'LibraryOptions': value, + }; AlbumInfo _$AlbumInfoFromJson(Map json) => AlbumInfo( name: json['Name'] as String?, @@ -218,32 +173,28 @@ AlbumInfo _$AlbumInfoFromJson(Map json) => AlbumInfo( [], ); -Map _$AlbumInfoToJson(AlbumInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - writeNotNull('AlbumArtists', instance.albumArtists); - writeNotNull('ArtistProviderIds', instance.artistProviderIds); - writeNotNull( - 'SongInfos', instance.songInfos?.map((e) => e.toJson()).toList()); - return val; -} +Map _$AlbumInfoToJson(AlbumInfo instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + if (instance.albumArtists case final value?) 'AlbumArtists': value, + if (instance.artistProviderIds case final value?) + 'ArtistProviderIds': value, + if (instance.songInfos?.map((e) => e.toJson()).toList() case final value?) + 'SongInfos': value, + }; AlbumInfoRemoteSearchQuery _$AlbumInfoRemoteSearchQueryFromJson( Map json) => @@ -257,21 +208,15 @@ AlbumInfoRemoteSearchQuery _$AlbumInfoRemoteSearchQueryFromJson( ); Map _$AlbumInfoRemoteSearchQueryToJson( - AlbumInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + AlbumInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; AllThemeMediaResult _$AllThemeMediaResultFromJson(Map json) => AllThemeMediaResult( @@ -289,21 +234,16 @@ AllThemeMediaResult _$AllThemeMediaResultFromJson(Map json) => json['SoundtrackSongsResult'] as Map), ); -Map _$AllThemeMediaResultToJson(AllThemeMediaResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ThemeVideosResult', instance.themeVideosResult?.toJson()); - writeNotNull('ThemeSongsResult', instance.themeSongsResult?.toJson()); - writeNotNull( - 'SoundtrackSongsResult', instance.soundtrackSongsResult?.toJson()); - return val; -} +Map _$AllThemeMediaResultToJson( + AllThemeMediaResult instance) => + { + if (instance.themeVideosResult?.toJson() case final value?) + 'ThemeVideosResult': value, + if (instance.themeSongsResult?.toJson() case final value?) + 'ThemeSongsResult': value, + if (instance.soundtrackSongsResult?.toJson() case final value?) + 'SoundtrackSongsResult': value, + }; ArtistInfo _$ArtistInfoFromJson(Map json) => ArtistInfo( name: json['Name'] as String?, @@ -325,30 +265,26 @@ ArtistInfo _$ArtistInfoFromJson(Map json) => ArtistInfo( [], ); -Map _$ArtistInfoToJson(ArtistInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - writeNotNull( - 'SongInfos', instance.songInfos?.map((e) => e.toJson()).toList()); - return val; -} +Map _$ArtistInfoToJson(ArtistInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + if (instance.songInfos?.map((e) => e.toJson()).toList() case final value?) + 'SongInfos': value, + }; ArtistInfoRemoteSearchQuery _$ArtistInfoRemoteSearchQueryFromJson( Map json) => @@ -362,21 +298,15 @@ ArtistInfoRemoteSearchQuery _$ArtistInfoRemoteSearchQueryFromJson( ); Map _$ArtistInfoRemoteSearchQueryToJson( - ArtistInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + ArtistInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; AuthenticateUserByName _$AuthenticateUserByNameFromJson( Map json) => @@ -386,19 +316,11 @@ AuthenticateUserByName _$AuthenticateUserByNameFromJson( ); Map _$AuthenticateUserByNameToJson( - AuthenticateUserByName instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Username', instance.username); - writeNotNull('Pw', instance.pw); - return val; -} + AuthenticateUserByName instance) => + { + if (instance.username case final value?) 'Username': value, + if (instance.pw case final value?) 'Pw': value, + }; AuthenticationInfo _$AuthenticationInfoFromJson(Map json) => AuthenticationInfo( @@ -422,30 +344,24 @@ AuthenticationInfo _$AuthenticationInfoFromJson(Map json) => userName: json['UserName'] as String?, ); -Map _$AuthenticationInfoToJson(AuthenticationInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('AccessToken', instance.accessToken); - writeNotNull('DeviceId', instance.deviceId); - writeNotNull('AppName', instance.appName); - writeNotNull('AppVersion', instance.appVersion); - writeNotNull('DeviceName', instance.deviceName); - writeNotNull('UserId', instance.userId); - writeNotNull('IsActive', instance.isActive); - writeNotNull('DateCreated', instance.dateCreated?.toIso8601String()); - writeNotNull('DateRevoked', instance.dateRevoked?.toIso8601String()); - writeNotNull( - 'DateLastActivity', instance.dateLastActivity?.toIso8601String()); - writeNotNull('UserName', instance.userName); - return val; -} +Map _$AuthenticationInfoToJson(AuthenticationInfo instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.accessToken case final value?) 'AccessToken': value, + if (instance.deviceId case final value?) 'DeviceId': value, + if (instance.appName case final value?) 'AppName': value, + if (instance.appVersion case final value?) 'AppVersion': value, + if (instance.deviceName case final value?) 'DeviceName': value, + if (instance.userId case final value?) 'UserId': value, + if (instance.isActive case final value?) 'IsActive': value, + if (instance.dateCreated?.toIso8601String() case final value?) + 'DateCreated': value, + if (instance.dateRevoked?.toIso8601String() case final value?) + 'DateRevoked': value, + if (instance.dateLastActivity?.toIso8601String() case final value?) + 'DateLastActivity': value, + if (instance.userName case final value?) 'UserName': value, + }; AuthenticationInfoQueryResult _$AuthenticationInfoQueryResultFromJson( Map json) => @@ -460,20 +376,14 @@ AuthenticationInfoQueryResult _$AuthenticationInfoQueryResultFromJson( ); Map _$AuthenticationInfoQueryResultToJson( - AuthenticationInfoQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + AuthenticationInfoQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; AuthenticationResult _$AuthenticationResultFromJson( Map json) => @@ -490,21 +400,14 @@ AuthenticationResult _$AuthenticationResultFromJson( ); Map _$AuthenticationResultToJson( - AuthenticationResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('User', instance.user?.toJson()); - writeNotNull('SessionInfo', instance.sessionInfo?.toJson()); - writeNotNull('AccessToken', instance.accessToken); - writeNotNull('ServerId', instance.serverId); - return val; -} + AuthenticationResult instance) => + { + if (instance.user?.toJson() case final value?) 'User': value, + if (instance.sessionInfo?.toJson() case final value?) + 'SessionInfo': value, + if (instance.accessToken case final value?) 'AccessToken': value, + if (instance.serverId case final value?) 'ServerId': value, + }; BaseItemDto _$BaseItemDtoFromJson(Map json) => BaseItemDto( name: json['Name'] as String?, @@ -738,183 +641,232 @@ BaseItemDto _$BaseItemDtoFromJson(Map json) => BaseItemDto( json['CurrentProgram'] as Map), ); -Map _$BaseItemDtoToJson(BaseItemDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('ServerId', instance.serverId); - writeNotNull('Id', instance.id); - writeNotNull('Etag', instance.etag); - writeNotNull('SourceType', instance.sourceType); - writeNotNull('PlaylistItemId', instance.playlistItemId); - writeNotNull('DateCreated', instance.dateCreated?.toIso8601String()); - writeNotNull( - 'DateLastMediaAdded', instance.dateLastMediaAdded?.toIso8601String()); - writeNotNull('ExtraType', extraTypeNullableToJson(instance.extraType)); - writeNotNull('AirsBeforeSeasonNumber', instance.airsBeforeSeasonNumber); - writeNotNull('AirsAfterSeasonNumber', instance.airsAfterSeasonNumber); - writeNotNull('AirsBeforeEpisodeNumber', instance.airsBeforeEpisodeNumber); - writeNotNull('CanDelete', instance.canDelete); - writeNotNull('CanDownload', instance.canDownload); - writeNotNull('HasLyrics', instance.hasLyrics); - writeNotNull('HasSubtitles', instance.hasSubtitles); - writeNotNull('PreferredMetadataLanguage', instance.preferredMetadataLanguage); - writeNotNull( - 'PreferredMetadataCountryCode', instance.preferredMetadataCountryCode); - writeNotNull('Container', instance.container); - writeNotNull('SortName', instance.sortName); - writeNotNull('ForcedSortName', instance.forcedSortName); - writeNotNull( - 'Video3DFormat', video3DFormatNullableToJson(instance.video3DFormat)); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull( - 'ExternalUrls', instance.externalUrls?.map((e) => e.toJson()).toList()); - writeNotNull( - 'MediaSources', instance.mediaSources?.map((e) => e.toJson()).toList()); - writeNotNull('CriticRating', instance.criticRating); - writeNotNull('ProductionLocations', instance.productionLocations); - writeNotNull('Path', instance.path); - writeNotNull('EnableMediaSourceDisplay', instance.enableMediaSourceDisplay); - writeNotNull('OfficialRating', instance.officialRating); - writeNotNull('CustomRating', instance.customRating); - writeNotNull('ChannelId', instance.channelId); - writeNotNull('ChannelName', instance.channelName); - writeNotNull('Overview', instance.overview); - writeNotNull('Taglines', instance.taglines); - writeNotNull('Genres', instance.genres); - writeNotNull('CommunityRating', instance.communityRating); - writeNotNull('CumulativeRunTimeTicks', instance.cumulativeRunTimeTicks); - writeNotNull('RunTimeTicks', instance.runTimeTicks); - writeNotNull('PlayAccess', playAccessNullableToJson(instance.playAccess)); - writeNotNull('AspectRatio', instance.aspectRatio); - writeNotNull('ProductionYear', instance.productionYear); - writeNotNull('IsPlaceHolder', instance.isPlaceHolder); - writeNotNull('Number', instance.number); - writeNotNull('ChannelNumber', instance.channelNumber); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('IndexNumberEnd', instance.indexNumberEnd); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('RemoteTrailers', - instance.remoteTrailers?.map((e) => e.toJson()).toList()); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('IsHD', instance.isHD); - writeNotNull('IsFolder', instance.isFolder); - writeNotNull('ParentId', instance.parentId); - writeNotNull('Type', baseItemKindNullableToJson(instance.type)); - writeNotNull('People', instance.people?.map((e) => e.toJson()).toList()); - writeNotNull('Studios', instance.studios?.map((e) => e.toJson()).toList()); - writeNotNull( - 'GenreItems', instance.genreItems?.map((e) => e.toJson()).toList()); - writeNotNull('ParentLogoItemId', instance.parentLogoItemId); - writeNotNull('ParentBackdropItemId', instance.parentBackdropItemId); - writeNotNull('ParentBackdropImageTags', instance.parentBackdropImageTags); - writeNotNull('LocalTrailerCount', instance.localTrailerCount); - writeNotNull('UserData', instance.userData?.toJson()); - writeNotNull('RecursiveItemCount', instance.recursiveItemCount); - writeNotNull('ChildCount', instance.childCount); - writeNotNull('SeriesName', instance.seriesName); - writeNotNull('SeriesId', instance.seriesId); - writeNotNull('SeasonId', instance.seasonId); - writeNotNull('SpecialFeatureCount', instance.specialFeatureCount); - writeNotNull('DisplayPreferencesId', instance.displayPreferencesId); - writeNotNull('Status', instance.status); - writeNotNull('AirTime', instance.airTime); - val['AirDays'] = dayOfWeekListToJson(instance.airDays); - writeNotNull('Tags', instance.tags); - writeNotNull('PrimaryImageAspectRatio', instance.primaryImageAspectRatio); - writeNotNull('Artists', instance.artists); - writeNotNull( - 'ArtistItems', instance.artistItems?.map((e) => e.toJson()).toList()); - writeNotNull('Album', instance.album); - writeNotNull( - 'CollectionType', collectionTypeNullableToJson(instance.collectionType)); - writeNotNull('DisplayOrder', instance.displayOrder); - writeNotNull('AlbumId', instance.albumId); - writeNotNull('AlbumPrimaryImageTag', instance.albumPrimaryImageTag); - writeNotNull('SeriesPrimaryImageTag', instance.seriesPrimaryImageTag); - writeNotNull('AlbumArtist', instance.albumArtist); - writeNotNull( - 'AlbumArtists', instance.albumArtists?.map((e) => e.toJson()).toList()); - writeNotNull('SeasonName', instance.seasonName); - writeNotNull( - 'MediaStreams', instance.mediaStreams?.map((e) => e.toJson()).toList()); - writeNotNull('VideoType', videoTypeNullableToJson(instance.videoType)); - writeNotNull('PartCount', instance.partCount); - writeNotNull('MediaSourceCount', instance.mediaSourceCount); - writeNotNull('ImageTags', instance.imageTags); - writeNotNull('BackdropImageTags', instance.backdropImageTags); - writeNotNull('ScreenshotImageTags', instance.screenshotImageTags); - writeNotNull('ParentLogoImageTag', instance.parentLogoImageTag); - writeNotNull('ParentArtItemId', instance.parentArtItemId); - writeNotNull('ParentArtImageTag', instance.parentArtImageTag); - writeNotNull('SeriesThumbImageTag', instance.seriesThumbImageTag); - writeNotNull('ImageBlurHashes', instance.imageBlurHashes?.toJson()); - writeNotNull('SeriesStudio', instance.seriesStudio); - writeNotNull('ParentThumbItemId', instance.parentThumbItemId); - writeNotNull('ParentThumbImageTag', instance.parentThumbImageTag); - writeNotNull('ParentPrimaryImageItemId', instance.parentPrimaryImageItemId); - writeNotNull('ParentPrimaryImageTag', instance.parentPrimaryImageTag); - writeNotNull('Chapters', instance.chapters?.map((e) => e.toJson()).toList()); - writeNotNull('Trickplay', instance.trickplay); - writeNotNull( - 'LocationType', locationTypeNullableToJson(instance.locationType)); - writeNotNull('IsoType', isoTypeNullableToJson(instance.isoType)); - writeNotNull('MediaType', mediaTypeNullableToJson(instance.mediaType)); - writeNotNull('EndDate', instance.endDate?.toIso8601String()); - val['LockedFields'] = metadataFieldListToJson(instance.lockedFields); - writeNotNull('TrailerCount', instance.trailerCount); - writeNotNull('MovieCount', instance.movieCount); - writeNotNull('SeriesCount', instance.seriesCount); - writeNotNull('ProgramCount', instance.programCount); - writeNotNull('EpisodeCount', instance.episodeCount); - writeNotNull('SongCount', instance.songCount); - writeNotNull('AlbumCount', instance.albumCount); - writeNotNull('ArtistCount', instance.artistCount); - writeNotNull('MusicVideoCount', instance.musicVideoCount); - writeNotNull('LockData', instance.lockData); - writeNotNull('Width', instance.width); - writeNotNull('Height', instance.height); - writeNotNull('CameraMake', instance.cameraMake); - writeNotNull('CameraModel', instance.cameraModel); - writeNotNull('Software', instance.software); - writeNotNull('ExposureTime', instance.exposureTime); - writeNotNull('FocalLength', instance.focalLength); - writeNotNull('ImageOrientation', - imageOrientationNullableToJson(instance.imageOrientation)); - writeNotNull('Aperture', instance.aperture); - writeNotNull('ShutterSpeed', instance.shutterSpeed); - writeNotNull('Latitude', instance.latitude); - writeNotNull('Longitude', instance.longitude); - writeNotNull('Altitude', instance.altitude); - writeNotNull('IsoSpeedRating', instance.isoSpeedRating); - writeNotNull('SeriesTimerId', instance.seriesTimerId); - writeNotNull('ProgramId', instance.programId); - writeNotNull('ChannelPrimaryImageTag', instance.channelPrimaryImageTag); - writeNotNull('StartDate', instance.startDate?.toIso8601String()); - writeNotNull('CompletionPercentage', instance.completionPercentage); - writeNotNull('IsRepeat', instance.isRepeat); - writeNotNull('EpisodeTitle', instance.episodeTitle); - writeNotNull('ChannelType', channelTypeNullableToJson(instance.channelType)); - writeNotNull('Audio', programAudioNullableToJson(instance.audio)); - writeNotNull('IsMovie', instance.isMovie); - writeNotNull('IsSports', instance.isSports); - writeNotNull('IsSeries', instance.isSeries); - writeNotNull('IsLive', instance.isLive); - writeNotNull('IsNews', instance.isNews); - writeNotNull('IsKids', instance.isKids); - writeNotNull('IsPremiere', instance.isPremiere); - writeNotNull('TimerId', instance.timerId); - writeNotNull('NormalizationGain', instance.normalizationGain); - writeNotNull('CurrentProgram', instance.currentProgram?.toJson()); - return val; -} +Map _$BaseItemDtoToJson(BaseItemDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.serverId case final value?) 'ServerId': value, + if (instance.id case final value?) 'Id': value, + if (instance.etag case final value?) 'Etag': value, + if (instance.sourceType case final value?) 'SourceType': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + if (instance.dateCreated?.toIso8601String() case final value?) + 'DateCreated': value, + if (instance.dateLastMediaAdded?.toIso8601String() case final value?) + 'DateLastMediaAdded': value, + if (extraTypeNullableToJson(instance.extraType) case final value?) + 'ExtraType': value, + if (instance.airsBeforeSeasonNumber case final value?) + 'AirsBeforeSeasonNumber': value, + if (instance.airsAfterSeasonNumber case final value?) + 'AirsAfterSeasonNumber': value, + if (instance.airsBeforeEpisodeNumber case final value?) + 'AirsBeforeEpisodeNumber': value, + if (instance.canDelete case final value?) 'CanDelete': value, + if (instance.canDownload case final value?) 'CanDownload': value, + if (instance.hasLyrics case final value?) 'HasLyrics': value, + if (instance.hasSubtitles case final value?) 'HasSubtitles': value, + if (instance.preferredMetadataLanguage case final value?) + 'PreferredMetadataLanguage': value, + if (instance.preferredMetadataCountryCode case final value?) + 'PreferredMetadataCountryCode': value, + if (instance.container case final value?) 'Container': value, + if (instance.sortName case final value?) 'SortName': value, + if (instance.forcedSortName case final value?) 'ForcedSortName': value, + if (video3DFormatNullableToJson(instance.video3DFormat) case final value?) + 'Video3DFormat': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.externalUrls?.map((e) => e.toJson()).toList() + case final value?) + 'ExternalUrls': value, + if (instance.mediaSources?.map((e) => e.toJson()).toList() + case final value?) + 'MediaSources': value, + if (instance.criticRating case final value?) 'CriticRating': value, + if (instance.productionLocations case final value?) + 'ProductionLocations': value, + if (instance.path case final value?) 'Path': value, + if (instance.enableMediaSourceDisplay case final value?) + 'EnableMediaSourceDisplay': value, + if (instance.officialRating case final value?) 'OfficialRating': value, + if (instance.customRating case final value?) 'CustomRating': value, + if (instance.channelId case final value?) 'ChannelId': value, + if (instance.channelName case final value?) 'ChannelName': value, + if (instance.overview case final value?) 'Overview': value, + if (instance.taglines case final value?) 'Taglines': value, + if (instance.genres case final value?) 'Genres': value, + if (instance.communityRating case final value?) 'CommunityRating': value, + if (instance.cumulativeRunTimeTicks case final value?) + 'CumulativeRunTimeTicks': value, + if (instance.runTimeTicks case final value?) 'RunTimeTicks': value, + if (playAccessNullableToJson(instance.playAccess) case final value?) + 'PlayAccess': value, + if (instance.aspectRatio case final value?) 'AspectRatio': value, + if (instance.productionYear case final value?) 'ProductionYear': value, + if (instance.isPlaceHolder case final value?) 'IsPlaceHolder': value, + if (instance.number case final value?) 'Number': value, + if (instance.channelNumber case final value?) 'ChannelNumber': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.indexNumberEnd case final value?) 'IndexNumberEnd': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.remoteTrailers?.map((e) => e.toJson()).toList() + case final value?) + 'RemoteTrailers': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.isHD case final value?) 'IsHD': value, + if (instance.isFolder case final value?) 'IsFolder': value, + if (instance.parentId case final value?) 'ParentId': value, + if (baseItemKindNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.people?.map((e) => e.toJson()).toList() case final value?) + 'People': value, + if (instance.studios?.map((e) => e.toJson()).toList() case final value?) + 'Studios': value, + if (instance.genreItems?.map((e) => e.toJson()).toList() + case final value?) + 'GenreItems': value, + if (instance.parentLogoItemId case final value?) + 'ParentLogoItemId': value, + if (instance.parentBackdropItemId case final value?) + 'ParentBackdropItemId': value, + if (instance.parentBackdropImageTags case final value?) + 'ParentBackdropImageTags': value, + if (instance.localTrailerCount case final value?) + 'LocalTrailerCount': value, + if (instance.userData?.toJson() case final value?) 'UserData': value, + if (instance.recursiveItemCount case final value?) + 'RecursiveItemCount': value, + if (instance.childCount case final value?) 'ChildCount': value, + if (instance.seriesName case final value?) 'SeriesName': value, + if (instance.seriesId case final value?) 'SeriesId': value, + if (instance.seasonId case final value?) 'SeasonId': value, + if (instance.specialFeatureCount case final value?) + 'SpecialFeatureCount': value, + if (instance.displayPreferencesId case final value?) + 'DisplayPreferencesId': value, + if (instance.status case final value?) 'Status': value, + if (instance.airTime case final value?) 'AirTime': value, + 'AirDays': dayOfWeekListToJson(instance.airDays), + if (instance.tags case final value?) 'Tags': value, + if (instance.primaryImageAspectRatio case final value?) + 'PrimaryImageAspectRatio': value, + if (instance.artists case final value?) 'Artists': value, + if (instance.artistItems?.map((e) => e.toJson()).toList() + case final value?) + 'ArtistItems': value, + if (instance.album case final value?) 'Album': value, + if (collectionTypeNullableToJson(instance.collectionType) + case final value?) + 'CollectionType': value, + if (instance.displayOrder case final value?) 'DisplayOrder': value, + if (instance.albumId case final value?) 'AlbumId': value, + if (instance.albumPrimaryImageTag case final value?) + 'AlbumPrimaryImageTag': value, + if (instance.seriesPrimaryImageTag case final value?) + 'SeriesPrimaryImageTag': value, + if (instance.albumArtist case final value?) 'AlbumArtist': value, + if (instance.albumArtists?.map((e) => e.toJson()).toList() + case final value?) + 'AlbumArtists': value, + if (instance.seasonName case final value?) 'SeasonName': value, + if (instance.mediaStreams?.map((e) => e.toJson()).toList() + case final value?) + 'MediaStreams': value, + if (videoTypeNullableToJson(instance.videoType) case final value?) + 'VideoType': value, + if (instance.partCount case final value?) 'PartCount': value, + if (instance.mediaSourceCount case final value?) + 'MediaSourceCount': value, + if (instance.imageTags case final value?) 'ImageTags': value, + if (instance.backdropImageTags case final value?) + 'BackdropImageTags': value, + if (instance.screenshotImageTags case final value?) + 'ScreenshotImageTags': value, + if (instance.parentLogoImageTag case final value?) + 'ParentLogoImageTag': value, + if (instance.parentArtItemId case final value?) 'ParentArtItemId': value, + if (instance.parentArtImageTag case final value?) + 'ParentArtImageTag': value, + if (instance.seriesThumbImageTag case final value?) + 'SeriesThumbImageTag': value, + if (instance.imageBlurHashes?.toJson() case final value?) + 'ImageBlurHashes': value, + if (instance.seriesStudio case final value?) 'SeriesStudio': value, + if (instance.parentThumbItemId case final value?) + 'ParentThumbItemId': value, + if (instance.parentThumbImageTag case final value?) + 'ParentThumbImageTag': value, + if (instance.parentPrimaryImageItemId case final value?) + 'ParentPrimaryImageItemId': value, + if (instance.parentPrimaryImageTag case final value?) + 'ParentPrimaryImageTag': value, + if (instance.chapters?.map((e) => e.toJson()).toList() case final value?) + 'Chapters': value, + if (instance.trickplay case final value?) 'Trickplay': value, + if (locationTypeNullableToJson(instance.locationType) case final value?) + 'LocationType': value, + if (isoTypeNullableToJson(instance.isoType) case final value?) + 'IsoType': value, + if (mediaTypeNullableToJson(instance.mediaType) case final value?) + 'MediaType': value, + if (instance.endDate?.toIso8601String() case final value?) + 'EndDate': value, + 'LockedFields': metadataFieldListToJson(instance.lockedFields), + if (instance.trailerCount case final value?) 'TrailerCount': value, + if (instance.movieCount case final value?) 'MovieCount': value, + if (instance.seriesCount case final value?) 'SeriesCount': value, + if (instance.programCount case final value?) 'ProgramCount': value, + if (instance.episodeCount case final value?) 'EpisodeCount': value, + if (instance.songCount case final value?) 'SongCount': value, + if (instance.albumCount case final value?) 'AlbumCount': value, + if (instance.artistCount case final value?) 'ArtistCount': value, + if (instance.musicVideoCount case final value?) 'MusicVideoCount': value, + if (instance.lockData case final value?) 'LockData': value, + if (instance.width case final value?) 'Width': value, + if (instance.height case final value?) 'Height': value, + if (instance.cameraMake case final value?) 'CameraMake': value, + if (instance.cameraModel case final value?) 'CameraModel': value, + if (instance.software case final value?) 'Software': value, + if (instance.exposureTime case final value?) 'ExposureTime': value, + if (instance.focalLength case final value?) 'FocalLength': value, + if (imageOrientationNullableToJson(instance.imageOrientation) + case final value?) + 'ImageOrientation': value, + if (instance.aperture case final value?) 'Aperture': value, + if (instance.shutterSpeed case final value?) 'ShutterSpeed': value, + if (instance.latitude case final value?) 'Latitude': value, + if (instance.longitude case final value?) 'Longitude': value, + if (instance.altitude case final value?) 'Altitude': value, + if (instance.isoSpeedRating case final value?) 'IsoSpeedRating': value, + if (instance.seriesTimerId case final value?) 'SeriesTimerId': value, + if (instance.programId case final value?) 'ProgramId': value, + if (instance.channelPrimaryImageTag case final value?) + 'ChannelPrimaryImageTag': value, + if (instance.startDate?.toIso8601String() case final value?) + 'StartDate': value, + if (instance.completionPercentage case final value?) + 'CompletionPercentage': value, + if (instance.isRepeat case final value?) 'IsRepeat': value, + if (instance.episodeTitle case final value?) 'EpisodeTitle': value, + if (channelTypeNullableToJson(instance.channelType) case final value?) + 'ChannelType': value, + if (programAudioNullableToJson(instance.audio) case final value?) + 'Audio': value, + if (instance.isMovie case final value?) 'IsMovie': value, + if (instance.isSports case final value?) 'IsSports': value, + if (instance.isSeries case final value?) 'IsSeries': value, + if (instance.isLive case final value?) 'IsLive': value, + if (instance.isNews case final value?) 'IsNews': value, + if (instance.isKids case final value?) 'IsKids': value, + if (instance.isPremiere case final value?) 'IsPremiere': value, + if (instance.timerId case final value?) 'TimerId': value, + if (instance.normalizationGain case final value?) + 'NormalizationGain': value, + if (instance.currentProgram?.toJson() case final value?) + 'CurrentProgram': value, + }; BaseItemDtoQueryResult _$BaseItemDtoQueryResultFromJson( Map json) => @@ -928,20 +880,14 @@ BaseItemDtoQueryResult _$BaseItemDtoQueryResultFromJson( ); Map _$BaseItemDtoQueryResultToJson( - BaseItemDtoQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + BaseItemDtoQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; BaseItemPerson _$BaseItemPersonFromJson(Map json) => BaseItemPerson( @@ -956,23 +902,17 @@ BaseItemPerson _$BaseItemPersonFromJson(Map json) => json['ImageBlurHashes'] as Map), ); -Map _$BaseItemPersonToJson(BaseItemPerson instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Id', instance.id); - writeNotNull('Role', instance.role); - writeNotNull('Type', personKindNullableToJson(instance.type)); - writeNotNull('PrimaryImageTag', instance.primaryImageTag); - writeNotNull('ImageBlurHashes', instance.imageBlurHashes?.toJson()); - return val; -} +Map _$BaseItemPersonToJson(BaseItemPerson instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.id case final value?) 'Id': value, + if (instance.role case final value?) 'Role': value, + if (personKindNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.primaryImageTag case final value?) 'PrimaryImageTag': value, + if (instance.imageBlurHashes?.toJson() case final value?) + 'ImageBlurHashes': value, + }; BasePluginConfiguration _$BasePluginConfigurationFromJson( Map json) => @@ -999,29 +939,24 @@ BookInfo _$BookInfoFromJson(Map json) => BookInfo( seriesName: json['SeriesName'] as String?, ); -Map _$BookInfoToJson(BookInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - writeNotNull('SeriesName', instance.seriesName); - return val; -} +Map _$BookInfoToJson(BookInfo instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + if (instance.seriesName case final value?) 'SeriesName': value, + }; BookInfoRemoteSearchQuery _$BookInfoRemoteSearchQueryFromJson( Map json) => @@ -1035,21 +970,15 @@ BookInfoRemoteSearchQuery _$BookInfoRemoteSearchQueryFromJson( ); Map _$BookInfoRemoteSearchQueryToJson( - BookInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + BookInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; BoxSetInfo _$BoxSetInfoFromJson(Map json) => BoxSetInfo( name: json['Name'] as String?, @@ -1067,28 +996,24 @@ BoxSetInfo _$BoxSetInfoFromJson(Map json) => BoxSetInfo( isAutomated: json['IsAutomated'] as bool?, ); -Map _$BoxSetInfoToJson(BoxSetInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - return val; -} +Map _$BoxSetInfoToJson(BoxSetInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + }; BoxSetInfoRemoteSearchQuery _$BoxSetInfoRemoteSearchQueryFromJson( Map json) => @@ -1102,21 +1027,15 @@ BoxSetInfoRemoteSearchQuery _$BoxSetInfoRemoteSearchQueryFromJson( ); Map _$BoxSetInfoRemoteSearchQueryToJson( - BoxSetInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + BoxSetInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; BrandingOptions _$BrandingOptionsFromJson(Map json) => BrandingOptions( @@ -1125,20 +1044,13 @@ BrandingOptions _$BrandingOptionsFromJson(Map json) => splashscreenEnabled: json['SplashscreenEnabled'] as bool?, ); -Map _$BrandingOptionsToJson(BrandingOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('LoginDisclaimer', instance.loginDisclaimer); - writeNotNull('CustomCss', instance.customCss); - writeNotNull('SplashscreenEnabled', instance.splashscreenEnabled); - return val; -} +Map _$BrandingOptionsToJson(BrandingOptions instance) => + { + if (instance.loginDisclaimer case final value?) 'LoginDisclaimer': value, + if (instance.customCss case final value?) 'CustomCss': value, + if (instance.splashscreenEnabled case final value?) + 'SplashscreenEnabled': value, + }; BufferRequestDto _$BufferRequestDtoFromJson(Map json) => BufferRequestDto( @@ -1149,21 +1061,13 @@ BufferRequestDto _$BufferRequestDtoFromJson(Map json) => playlistItemId: json['PlaylistItemId'] as String?, ); -Map _$BufferRequestDtoToJson(BufferRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('When', instance.when?.toIso8601String()); - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('IsPlaying', instance.isPlaying); - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} +Map _$BufferRequestDtoToJson(BufferRequestDto instance) => + { + if (instance.when?.toIso8601String() case final value?) 'When': value, + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (instance.isPlaying case final value?) 'IsPlaying': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; CastReceiverApplication _$CastReceiverApplicationFromJson( Map json) => @@ -1173,19 +1077,11 @@ CastReceiverApplication _$CastReceiverApplicationFromJson( ); Map _$CastReceiverApplicationToJson( - CastReceiverApplication instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('Name', instance.name); - return val; -} + CastReceiverApplication instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.name case final value?) 'Name': value, + }; ChannelFeatures _$ChannelFeaturesFromJson(Map json) => ChannelFeatures( @@ -1205,32 +1101,26 @@ ChannelFeatures _$ChannelFeaturesFromJson(Map json) => supportsContentDownloading: json['SupportsContentDownloading'] as bool?, ); -Map _$ChannelFeaturesToJson(ChannelFeatures instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Id', instance.id); - writeNotNull('CanSearch', instance.canSearch); - val['MediaTypes'] = channelMediaTypeListToJson(instance.mediaTypes); - val['ContentTypes'] = - channelMediaContentTypeListToJson(instance.contentTypes); - writeNotNull('MaxPageSize', instance.maxPageSize); - writeNotNull('AutoRefreshLevels', instance.autoRefreshLevels); - val['DefaultSortFields'] = - channelItemSortFieldListToJson(instance.defaultSortFields); - writeNotNull('SupportsSortOrderToggle', instance.supportsSortOrderToggle); - writeNotNull('SupportsLatestMedia', instance.supportsLatestMedia); - writeNotNull('CanFilter', instance.canFilter); - writeNotNull( - 'SupportsContentDownloading', instance.supportsContentDownloading); - return val; -} +Map _$ChannelFeaturesToJson(ChannelFeatures instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.id case final value?) 'Id': value, + if (instance.canSearch case final value?) 'CanSearch': value, + 'MediaTypes': channelMediaTypeListToJson(instance.mediaTypes), + 'ContentTypes': channelMediaContentTypeListToJson(instance.contentTypes), + if (instance.maxPageSize case final value?) 'MaxPageSize': value, + if (instance.autoRefreshLevels case final value?) + 'AutoRefreshLevels': value, + 'DefaultSortFields': + channelItemSortFieldListToJson(instance.defaultSortFields), + if (instance.supportsSortOrderToggle case final value?) + 'SupportsSortOrderToggle': value, + if (instance.supportsLatestMedia case final value?) + 'SupportsLatestMedia': value, + if (instance.canFilter case final value?) 'CanFilter': value, + if (instance.supportsContentDownloading case final value?) + 'SupportsContentDownloading': value, + }; ChannelMappingOptionsDto _$ChannelMappingOptionsDtoFromJson( Map json) => @@ -1252,23 +1142,18 @@ ChannelMappingOptionsDto _$ChannelMappingOptionsDtoFromJson( ); Map _$ChannelMappingOptionsDtoToJson( - ChannelMappingOptionsDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'TunerChannels', instance.tunerChannels?.map((e) => e.toJson()).toList()); - writeNotNull('ProviderChannels', - instance.providerChannels?.map((e) => e.toJson()).toList()); - writeNotNull('Mappings', instance.mappings?.map((e) => e.toJson()).toList()); - writeNotNull('ProviderName', instance.providerName); - return val; -} + ChannelMappingOptionsDto instance) => + { + if (instance.tunerChannels?.map((e) => e.toJson()).toList() + case final value?) + 'TunerChannels': value, + if (instance.providerChannels?.map((e) => e.toJson()).toList() + case final value?) + 'ProviderChannels': value, + if (instance.mappings?.map((e) => e.toJson()).toList() case final value?) + 'Mappings': value, + if (instance.providerName case final value?) 'ProviderName': value, + }; ChapterInfo _$ChapterInfoFromJson(Map json) => ChapterInfo( startPositionTicks: (json['StartPositionTicks'] as num?)?.toInt(), @@ -1280,23 +1165,16 @@ ChapterInfo _$ChapterInfoFromJson(Map json) => ChapterInfo( imageTag: json['ImageTag'] as String?, ); -Map _$ChapterInfoToJson(ChapterInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('StartPositionTicks', instance.startPositionTicks); - writeNotNull('Name', instance.name); - writeNotNull('ImagePath', instance.imagePath); - writeNotNull( - 'ImageDateModified', instance.imageDateModified?.toIso8601String()); - writeNotNull('ImageTag', instance.imageTag); - return val; -} +Map _$ChapterInfoToJson(ChapterInfo instance) => + { + if (instance.startPositionTicks case final value?) + 'StartPositionTicks': value, + if (instance.name case final value?) 'Name': value, + if (instance.imagePath case final value?) 'ImagePath': value, + if (instance.imageDateModified?.toIso8601String() case final value?) + 'ImageDateModified': value, + if (instance.imageTag case final value?) 'ImageTag': value, + }; ClientCapabilitiesDto _$ClientCapabilitiesDtoFromJson( Map json) => @@ -1317,27 +1195,20 @@ ClientCapabilitiesDto _$ClientCapabilitiesDtoFromJson( ); Map _$ClientCapabilitiesDtoToJson( - ClientCapabilitiesDto instance) { - final val = { - 'PlayableMediaTypes': mediaTypeListToJson(instance.playableMediaTypes), - 'SupportedCommands': - generalCommandTypeListToJson(instance.supportedCommands), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SupportsMediaControl', instance.supportsMediaControl); - writeNotNull( - 'SupportsPersistentIdentifier', instance.supportsPersistentIdentifier); - writeNotNull('DeviceProfile', instance.deviceProfile?.toJson()); - writeNotNull('AppStoreUrl', instance.appStoreUrl); - writeNotNull('IconUrl', instance.iconUrl); - return val; -} + ClientCapabilitiesDto instance) => + { + 'PlayableMediaTypes': mediaTypeListToJson(instance.playableMediaTypes), + 'SupportedCommands': + generalCommandTypeListToJson(instance.supportedCommands), + if (instance.supportsMediaControl case final value?) + 'SupportsMediaControl': value, + if (instance.supportsPersistentIdentifier case final value?) + 'SupportsPersistentIdentifier': value, + if (instance.deviceProfile?.toJson() case final value?) + 'DeviceProfile': value, + if (instance.appStoreUrl case final value?) 'AppStoreUrl': value, + if (instance.iconUrl case final value?) 'IconUrl': value, + }; ClientLogDocumentResponseDto _$ClientLogDocumentResponseDtoFromJson( Map json) => @@ -1346,18 +1217,10 @@ ClientLogDocumentResponseDto _$ClientLogDocumentResponseDtoFromJson( ); Map _$ClientLogDocumentResponseDtoToJson( - ClientLogDocumentResponseDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('FileName', instance.fileName); - return val; -} + ClientLogDocumentResponseDto instance) => + { + if (instance.fileName case final value?) 'FileName': value, + }; CodecProfile _$CodecProfileFromJson(Map json) => CodecProfile( type: codecTypeNullableFromJson(json['Type']), @@ -1374,25 +1237,20 @@ CodecProfile _$CodecProfileFromJson(Map json) => CodecProfile( subContainer: json['SubContainer'] as String?, ); -Map _$CodecProfileToJson(CodecProfile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Type', codecTypeNullableToJson(instance.type)); - writeNotNull( - 'Conditions', instance.conditions?.map((e) => e.toJson()).toList()); - writeNotNull('ApplyConditions', - instance.applyConditions?.map((e) => e.toJson()).toList()); - writeNotNull('Codec', instance.codec); - writeNotNull('Container', instance.container); - writeNotNull('SubContainer', instance.subContainer); - return val; -} +Map _$CodecProfileToJson(CodecProfile instance) => + { + if (codecTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.conditions?.map((e) => e.toJson()).toList() + case final value?) + 'Conditions': value, + if (instance.applyConditions?.map((e) => e.toJson()).toList() + case final value?) + 'ApplyConditions': value, + if (instance.codec case final value?) 'Codec': value, + if (instance.container case final value?) 'Container': value, + if (instance.subContainer case final value?) 'SubContainer': value, + }; CollectionCreationResult _$CollectionCreationResultFromJson( Map json) => @@ -1401,18 +1259,10 @@ CollectionCreationResult _$CollectionCreationResultFromJson( ); Map _$CollectionCreationResultToJson( - CollectionCreationResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - return val; -} + CollectionCreationResult instance) => + { + if (instance.id case final value?) 'Id': value, + }; ConfigImageTypes _$ConfigImageTypesFromJson(Map json) => ConfigImageTypes( @@ -1440,24 +1290,16 @@ ConfigImageTypes _$ConfigImageTypesFromJson(Map json) => [], ); -Map _$ConfigImageTypesToJson(ConfigImageTypes instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('BackdropSizes', instance.backdropSizes); - writeNotNull('BaseUrl', instance.baseUrl); - writeNotNull('LogoSizes', instance.logoSizes); - writeNotNull('PosterSizes', instance.posterSizes); - writeNotNull('ProfileSizes', instance.profileSizes); - writeNotNull('SecureBaseUrl', instance.secureBaseUrl); - writeNotNull('StillSizes', instance.stillSizes); - return val; -} +Map _$ConfigImageTypesToJson(ConfigImageTypes instance) => + { + if (instance.backdropSizes case final value?) 'BackdropSizes': value, + if (instance.baseUrl case final value?) 'BaseUrl': value, + if (instance.logoSizes case final value?) 'LogoSizes': value, + if (instance.posterSizes case final value?) 'PosterSizes': value, + if (instance.profileSizes case final value?) 'ProfileSizes': value, + if (instance.secureBaseUrl case final value?) 'SecureBaseUrl': value, + if (instance.stillSizes case final value?) 'StillSizes': value, + }; ConfigurationPageInfo _$ConfigurationPageInfoFromJson( Map json) => @@ -1471,23 +1313,16 @@ ConfigurationPageInfo _$ConfigurationPageInfoFromJson( ); Map _$ConfigurationPageInfoToJson( - ConfigurationPageInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('EnableInMainMenu', instance.enableInMainMenu); - writeNotNull('MenuSection', instance.menuSection); - writeNotNull('MenuIcon', instance.menuIcon); - writeNotNull('DisplayName', instance.displayName); - writeNotNull('PluginId', instance.pluginId); - return val; -} + ConfigurationPageInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.enableInMainMenu case final value?) + 'EnableInMainMenu': value, + if (instance.menuSection case final value?) 'MenuSection': value, + if (instance.menuIcon case final value?) 'MenuIcon': value, + if (instance.displayName case final value?) 'DisplayName': value, + if (instance.pluginId case final value?) 'PluginId': value, + }; ContainerProfile _$ContainerProfileFromJson(Map json) => ContainerProfile( @@ -1500,22 +1335,16 @@ ContainerProfile _$ContainerProfileFromJson(Map json) => subContainer: json['SubContainer'] as String?, ); -Map _$ContainerProfileToJson(ContainerProfile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Type', dlnaProfileTypeNullableToJson(instance.type)); - writeNotNull( - 'Conditions', instance.conditions?.map((e) => e.toJson()).toList()); - writeNotNull('Container', instance.container); - writeNotNull('SubContainer', instance.subContainer); - return val; -} +Map _$ContainerProfileToJson(ContainerProfile instance) => + { + if (dlnaProfileTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.conditions?.map((e) => e.toJson()).toList() + case final value?) + 'Conditions': value, + if (instance.container case final value?) 'Container': value, + if (instance.subContainer case final value?) 'SubContainer': value, + }; CountryInfo _$CountryInfoFromJson(Map json) => CountryInfo( name: json['Name'] as String?, @@ -1524,21 +1353,15 @@ CountryInfo _$CountryInfoFromJson(Map json) => CountryInfo( threeLetterISORegionName: json['ThreeLetterISORegionName'] as String?, ); -Map _$CountryInfoToJson(CountryInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('DisplayName', instance.displayName); - writeNotNull('TwoLetterISORegionName', instance.twoLetterISORegionName); - writeNotNull('ThreeLetterISORegionName', instance.threeLetterISORegionName); - return val; -} +Map _$CountryInfoToJson(CountryInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.displayName case final value?) 'DisplayName': value, + if (instance.twoLetterISORegionName case final value?) + 'TwoLetterISORegionName': value, + if (instance.threeLetterISORegionName case final value?) + 'ThreeLetterISORegionName': value, + }; CreatePlaylistDto _$CreatePlaylistDtoFromJson(Map json) => CreatePlaylistDto( @@ -1555,23 +1378,17 @@ CreatePlaylistDto _$CreatePlaylistDtoFromJson(Map json) => isPublic: json['IsPublic'] as bool?, ); -Map _$CreatePlaylistDtoToJson(CreatePlaylistDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Ids', instance.ids); - writeNotNull('UserId', instance.userId); - writeNotNull('MediaType', mediaTypeNullableToJson(instance.mediaType)); - writeNotNull('Users', instance.users?.map((e) => e.toJson()).toList()); - writeNotNull('IsPublic', instance.isPublic); - return val; -} +Map _$CreatePlaylistDtoToJson(CreatePlaylistDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.ids case final value?) 'Ids': value, + if (instance.userId case final value?) 'UserId': value, + if (mediaTypeNullableToJson(instance.mediaType) case final value?) + 'MediaType': value, + if (instance.users?.map((e) => e.toJson()).toList() case final value?) + 'Users': value, + if (instance.isPublic case final value?) 'IsPublic': value, + }; CreateUserByName _$CreateUserByNameFromJson(Map json) => CreateUserByName( @@ -1579,20 +1396,11 @@ CreateUserByName _$CreateUserByNameFromJson(Map json) => password: json['Password'] as String?, ); -Map _$CreateUserByNameToJson(CreateUserByName instance) { - final val = { - 'Name': instance.name, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Password', instance.password); - return val; -} +Map _$CreateUserByNameToJson(CreateUserByName instance) => + { + 'Name': instance.name, + if (instance.password case final value?) 'Password': value, + }; CultureDto _$CultureDtoFromJson(Map json) => CultureDto( name: json['Name'] as String?, @@ -1606,24 +1414,17 @@ CultureDto _$CultureDtoFromJson(Map json) => CultureDto( [], ); -Map _$CultureDtoToJson(CultureDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('DisplayName', instance.displayName); - writeNotNull('TwoLetterISOLanguageName', instance.twoLetterISOLanguageName); - writeNotNull( - 'ThreeLetterISOLanguageName', instance.threeLetterISOLanguageName); - writeNotNull( - 'ThreeLetterISOLanguageNames', instance.threeLetterISOLanguageNames); - return val; -} +Map _$CultureDtoToJson(CultureDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.displayName case final value?) 'DisplayName': value, + if (instance.twoLetterISOLanguageName case final value?) + 'TwoLetterISOLanguageName': value, + if (instance.threeLetterISOLanguageName case final value?) + 'ThreeLetterISOLanguageName': value, + if (instance.threeLetterISOLanguageNames case final value?) + 'ThreeLetterISOLanguageNames': value, + }; DefaultDirectoryBrowserInfoDto _$DefaultDirectoryBrowserInfoDtoFromJson( Map json) => @@ -1632,18 +1433,10 @@ DefaultDirectoryBrowserInfoDto _$DefaultDirectoryBrowserInfoDtoFromJson( ); Map _$DefaultDirectoryBrowserInfoDtoToJson( - DefaultDirectoryBrowserInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Path', instance.path); - return val; -} + DefaultDirectoryBrowserInfoDto instance) => + { + if (instance.path case final value?) 'Path': value, + }; DeviceInfoDto _$DeviceInfoDtoFromJson(Map json) => DeviceInfoDto( @@ -1665,29 +1458,22 @@ DeviceInfoDto _$DeviceInfoDtoFromJson(Map json) => iconUrl: json['IconUrl'] as String?, ); -Map _$DeviceInfoDtoToJson(DeviceInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('CustomName', instance.customName); - writeNotNull('AccessToken', instance.accessToken); - writeNotNull('Id', instance.id); - writeNotNull('LastUserName', instance.lastUserName); - writeNotNull('AppName', instance.appName); - writeNotNull('AppVersion', instance.appVersion); - writeNotNull('LastUserId', instance.lastUserId); - writeNotNull( - 'DateLastActivity', instance.dateLastActivity?.toIso8601String()); - writeNotNull('Capabilities', instance.capabilities?.toJson()); - writeNotNull('IconUrl', instance.iconUrl); - return val; -} +Map _$DeviceInfoDtoToJson(DeviceInfoDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.customName case final value?) 'CustomName': value, + if (instance.accessToken case final value?) 'AccessToken': value, + if (instance.id case final value?) 'Id': value, + if (instance.lastUserName case final value?) 'LastUserName': value, + if (instance.appName case final value?) 'AppName': value, + if (instance.appVersion case final value?) 'AppVersion': value, + if (instance.lastUserId case final value?) 'LastUserId': value, + if (instance.dateLastActivity?.toIso8601String() case final value?) + 'DateLastActivity': value, + if (instance.capabilities?.toJson() case final value?) + 'Capabilities': value, + if (instance.iconUrl case final value?) 'IconUrl': value, + }; DeviceInfoDtoQueryResult _$DeviceInfoDtoQueryResultFromJson( Map json) => @@ -1701,20 +1487,14 @@ DeviceInfoDtoQueryResult _$DeviceInfoDtoQueryResultFromJson( ); Map _$DeviceInfoDtoQueryResultToJson( - DeviceInfoDtoQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + DeviceInfoDtoQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; DeviceOptionsDto _$DeviceOptionsDtoFromJson(Map json) => DeviceOptionsDto( @@ -1723,20 +1503,12 @@ DeviceOptionsDto _$DeviceOptionsDtoFromJson(Map json) => customName: json['CustomName'] as String?, ); -Map _$DeviceOptionsDtoToJson(DeviceOptionsDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('DeviceId', instance.deviceId); - writeNotNull('CustomName', instance.customName); - return val; -} +Map _$DeviceOptionsDtoToJson(DeviceOptionsDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.deviceId case final value?) 'DeviceId': value, + if (instance.customName case final value?) 'CustomName': value, + }; DeviceProfile _$DeviceProfileFromJson(Map json) => DeviceProfile( @@ -1771,34 +1543,34 @@ DeviceProfile _$DeviceProfileFromJson(Map json) => [], ); -Map _$DeviceProfileToJson(DeviceProfile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Id', instance.id); - writeNotNull('MaxStreamingBitrate', instance.maxStreamingBitrate); - writeNotNull('MaxStaticBitrate', instance.maxStaticBitrate); - writeNotNull('MusicStreamingTranscodingBitrate', - instance.musicStreamingTranscodingBitrate); - writeNotNull('MaxStaticMusicBitrate', instance.maxStaticMusicBitrate); - writeNotNull('DirectPlayProfiles', - instance.directPlayProfiles?.map((e) => e.toJson()).toList()); - writeNotNull('TranscodingProfiles', - instance.transcodingProfiles?.map((e) => e.toJson()).toList()); - writeNotNull('ContainerProfiles', - instance.containerProfiles?.map((e) => e.toJson()).toList()); - writeNotNull( - 'CodecProfiles', instance.codecProfiles?.map((e) => e.toJson()).toList()); - writeNotNull('SubtitleProfiles', - instance.subtitleProfiles?.map((e) => e.toJson()).toList()); - return val; -} +Map _$DeviceProfileToJson(DeviceProfile instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.id case final value?) 'Id': value, + if (instance.maxStreamingBitrate case final value?) + 'MaxStreamingBitrate': value, + if (instance.maxStaticBitrate case final value?) + 'MaxStaticBitrate': value, + if (instance.musicStreamingTranscodingBitrate case final value?) + 'MusicStreamingTranscodingBitrate': value, + if (instance.maxStaticMusicBitrate case final value?) + 'MaxStaticMusicBitrate': value, + if (instance.directPlayProfiles?.map((e) => e.toJson()).toList() + case final value?) + 'DirectPlayProfiles': value, + if (instance.transcodingProfiles?.map((e) => e.toJson()).toList() + case final value?) + 'TranscodingProfiles': value, + if (instance.containerProfiles?.map((e) => e.toJson()).toList() + case final value?) + 'ContainerProfiles': value, + if (instance.codecProfiles?.map((e) => e.toJson()).toList() + case final value?) + 'CodecProfiles': value, + if (instance.subtitleProfiles?.map((e) => e.toJson()).toList() + case final value?) + 'SubtitleProfiles': value, + }; DirectPlayProfile _$DirectPlayProfileFromJson(Map json) => DirectPlayProfile( @@ -1808,21 +1580,14 @@ DirectPlayProfile _$DirectPlayProfileFromJson(Map json) => type: dlnaProfileTypeNullableFromJson(json['Type']), ); -Map _$DirectPlayProfileToJson(DirectPlayProfile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Container', instance.container); - writeNotNull('AudioCodec', instance.audioCodec); - writeNotNull('VideoCodec', instance.videoCodec); - writeNotNull('Type', dlnaProfileTypeNullableToJson(instance.type)); - return val; -} +Map _$DirectPlayProfileToJson(DirectPlayProfile instance) => + { + if (instance.container case final value?) 'Container': value, + if (instance.audioCodec case final value?) 'AudioCodec': value, + if (instance.videoCodec case final value?) 'VideoCodec': value, + if (dlnaProfileTypeNullableToJson(instance.type) case final value?) + 'Type': value, + }; DisplayPreferencesDto _$DisplayPreferencesDtoFromJson( Map json) => @@ -1844,32 +1609,29 @@ DisplayPreferencesDto _$DisplayPreferencesDtoFromJson( ); Map _$DisplayPreferencesDtoToJson( - DisplayPreferencesDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('ViewType', instance.viewType); - writeNotNull('SortBy', instance.sortBy); - writeNotNull('IndexBy', instance.indexBy); - writeNotNull('RememberIndexing', instance.rememberIndexing); - writeNotNull('PrimaryImageHeight', instance.primaryImageHeight); - writeNotNull('PrimaryImageWidth', instance.primaryImageWidth); - writeNotNull('CustomPrefs', instance.customPrefs); - writeNotNull('ScrollDirection', - scrollDirectionNullableToJson(instance.scrollDirection)); - writeNotNull('ShowBackdrop', instance.showBackdrop); - writeNotNull('RememberSorting', instance.rememberSorting); - writeNotNull('SortOrder', sortOrderNullableToJson(instance.sortOrder)); - writeNotNull('ShowSidebar', instance.showSidebar); - writeNotNull('Client', instance.$Client); - return val; -} + DisplayPreferencesDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.viewType case final value?) 'ViewType': value, + if (instance.sortBy case final value?) 'SortBy': value, + if (instance.indexBy case final value?) 'IndexBy': value, + if (instance.rememberIndexing case final value?) + 'RememberIndexing': value, + if (instance.primaryImageHeight case final value?) + 'PrimaryImageHeight': value, + if (instance.primaryImageWidth case final value?) + 'PrimaryImageWidth': value, + if (instance.customPrefs case final value?) 'CustomPrefs': value, + if (scrollDirectionNullableToJson(instance.scrollDirection) + case final value?) + 'ScrollDirection': value, + if (instance.showBackdrop case final value?) 'ShowBackdrop': value, + if (instance.rememberSorting case final value?) 'RememberSorting': value, + if (sortOrderNullableToJson(instance.sortOrder) case final value?) + 'SortOrder': value, + if (instance.showSidebar case final value?) 'ShowSidebar': value, + if (instance.$Client case final value?) 'Client': value, + }; EncodingOptions _$EncodingOptionsFromJson(Map json) => EncodingOptions( @@ -1944,102 +1706,115 @@ EncodingOptions _$EncodingOptionsFromJson(Map json) => [], ); -Map _$EncodingOptionsToJson(EncodingOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('EncodingThreadCount', instance.encodingThreadCount); - writeNotNull('TranscodingTempPath', instance.transcodingTempPath); - writeNotNull('FallbackFontPath', instance.fallbackFontPath); - writeNotNull('EnableFallbackFont', instance.enableFallbackFont); - writeNotNull('EnableAudioVbr', instance.enableAudioVbr); - writeNotNull('DownMixAudioBoost', instance.downMixAudioBoost); - writeNotNull('DownMixStereoAlgorithm', - downMixStereoAlgorithmsNullableToJson(instance.downMixStereoAlgorithm)); - writeNotNull('MaxMuxingQueueSize', instance.maxMuxingQueueSize); - writeNotNull('EnableThrottling', instance.enableThrottling); - writeNotNull('ThrottleDelaySeconds', instance.throttleDelaySeconds); - writeNotNull('EnableSegmentDeletion', instance.enableSegmentDeletion); - writeNotNull('SegmentKeepSeconds', instance.segmentKeepSeconds); - writeNotNull( - 'HardwareAccelerationType', - hardwareAccelerationTypeNullableToJson( - instance.hardwareAccelerationType)); - writeNotNull('EncoderAppPath', instance.encoderAppPath); - writeNotNull('EncoderAppPathDisplay', instance.encoderAppPathDisplay); - writeNotNull('VaapiDevice', instance.vaapiDevice); - writeNotNull('QsvDevice', instance.qsvDevice); - writeNotNull('EnableTonemapping', instance.enableTonemapping); - writeNotNull('EnableVppTonemapping', instance.enableVppTonemapping); - writeNotNull( - 'EnableVideoToolboxTonemapping', instance.enableVideoToolboxTonemapping); - writeNotNull('TonemappingAlgorithm', - tonemappingAlgorithmNullableToJson(instance.tonemappingAlgorithm)); - writeNotNull('TonemappingMode', - tonemappingModeNullableToJson(instance.tonemappingMode)); - writeNotNull('TonemappingRange', - tonemappingRangeNullableToJson(instance.tonemappingRange)); - writeNotNull('TonemappingDesat', instance.tonemappingDesat); - writeNotNull('TonemappingPeak', instance.tonemappingPeak); - writeNotNull('TonemappingParam', instance.tonemappingParam); - writeNotNull('VppTonemappingBrightness', instance.vppTonemappingBrightness); - writeNotNull('VppTonemappingContrast', instance.vppTonemappingContrast); - writeNotNull('H264Crf', instance.h264Crf); - writeNotNull('H265Crf', instance.h265Crf); - writeNotNull( - 'EncoderPreset', encoderPresetNullableToJson(instance.encoderPreset)); - writeNotNull('DeinterlaceDoubleRate', instance.deinterlaceDoubleRate); - writeNotNull('DeinterlaceMethod', - deinterlaceMethodNullableToJson(instance.deinterlaceMethod)); - writeNotNull('EnableDecodingColorDepth10Hevc', - instance.enableDecodingColorDepth10Hevc); - writeNotNull( - 'EnableDecodingColorDepth10Vp9', instance.enableDecodingColorDepth10Vp9); - writeNotNull('EnableDecodingColorDepth10HevcRext', - instance.enableDecodingColorDepth10HevcRext); - writeNotNull('EnableDecodingColorDepth12HevcRext', - instance.enableDecodingColorDepth12HevcRext); - writeNotNull( - 'EnableEnhancedNvdecDecoder', instance.enableEnhancedNvdecDecoder); - writeNotNull( - 'PreferSystemNativeHwDecoder', instance.preferSystemNativeHwDecoder); - writeNotNull('EnableIntelLowPowerH264HwEncoder', - instance.enableIntelLowPowerH264HwEncoder); - writeNotNull('EnableIntelLowPowerHevcHwEncoder', - instance.enableIntelLowPowerHevcHwEncoder); - writeNotNull('EnableHardwareEncoding', instance.enableHardwareEncoding); - writeNotNull('AllowHevcEncoding', instance.allowHevcEncoding); - writeNotNull('AllowAv1Encoding', instance.allowAv1Encoding); - writeNotNull('EnableSubtitleExtraction', instance.enableSubtitleExtraction); - writeNotNull('HardwareDecodingCodecs', instance.hardwareDecodingCodecs); - writeNotNull('AllowOnDemandMetadataBasedKeyframeExtractionForExtensions', - instance.allowOnDemandMetadataBasedKeyframeExtractionForExtensions); - return val; -} +Map _$EncodingOptionsToJson(EncodingOptions instance) => + { + if (instance.encodingThreadCount case final value?) + 'EncodingThreadCount': value, + if (instance.transcodingTempPath case final value?) + 'TranscodingTempPath': value, + if (instance.fallbackFontPath case final value?) + 'FallbackFontPath': value, + if (instance.enableFallbackFont case final value?) + 'EnableFallbackFont': value, + if (instance.enableAudioVbr case final value?) 'EnableAudioVbr': value, + if (instance.downMixAudioBoost case final value?) + 'DownMixAudioBoost': value, + if (downMixStereoAlgorithmsNullableToJson(instance.downMixStereoAlgorithm) + case final value?) + 'DownMixStereoAlgorithm': value, + if (instance.maxMuxingQueueSize case final value?) + 'MaxMuxingQueueSize': value, + if (instance.enableThrottling case final value?) + 'EnableThrottling': value, + if (instance.throttleDelaySeconds case final value?) + 'ThrottleDelaySeconds': value, + if (instance.enableSegmentDeletion case final value?) + 'EnableSegmentDeletion': value, + if (instance.segmentKeepSeconds case final value?) + 'SegmentKeepSeconds': value, + if (hardwareAccelerationTypeNullableToJson( + instance.hardwareAccelerationType) + case final value?) + 'HardwareAccelerationType': value, + if (instance.encoderAppPath case final value?) 'EncoderAppPath': value, + if (instance.encoderAppPathDisplay case final value?) + 'EncoderAppPathDisplay': value, + if (instance.vaapiDevice case final value?) 'VaapiDevice': value, + if (instance.qsvDevice case final value?) 'QsvDevice': value, + if (instance.enableTonemapping case final value?) + 'EnableTonemapping': value, + if (instance.enableVppTonemapping case final value?) + 'EnableVppTonemapping': value, + if (instance.enableVideoToolboxTonemapping case final value?) + 'EnableVideoToolboxTonemapping': value, + if (tonemappingAlgorithmNullableToJson(instance.tonemappingAlgorithm) + case final value?) + 'TonemappingAlgorithm': value, + if (tonemappingModeNullableToJson(instance.tonemappingMode) + case final value?) + 'TonemappingMode': value, + if (tonemappingRangeNullableToJson(instance.tonemappingRange) + case final value?) + 'TonemappingRange': value, + if (instance.tonemappingDesat case final value?) + 'TonemappingDesat': value, + if (instance.tonemappingPeak case final value?) 'TonemappingPeak': value, + if (instance.tonemappingParam case final value?) + 'TonemappingParam': value, + if (instance.vppTonemappingBrightness case final value?) + 'VppTonemappingBrightness': value, + if (instance.vppTonemappingContrast case final value?) + 'VppTonemappingContrast': value, + if (instance.h264Crf case final value?) 'H264Crf': value, + if (instance.h265Crf case final value?) 'H265Crf': value, + if (encoderPresetNullableToJson(instance.encoderPreset) case final value?) + 'EncoderPreset': value, + if (instance.deinterlaceDoubleRate case final value?) + 'DeinterlaceDoubleRate': value, + if (deinterlaceMethodNullableToJson(instance.deinterlaceMethod) + case final value?) + 'DeinterlaceMethod': value, + if (instance.enableDecodingColorDepth10Hevc case final value?) + 'EnableDecodingColorDepth10Hevc': value, + if (instance.enableDecodingColorDepth10Vp9 case final value?) + 'EnableDecodingColorDepth10Vp9': value, + if (instance.enableDecodingColorDepth10HevcRext case final value?) + 'EnableDecodingColorDepth10HevcRext': value, + if (instance.enableDecodingColorDepth12HevcRext case final value?) + 'EnableDecodingColorDepth12HevcRext': value, + if (instance.enableEnhancedNvdecDecoder case final value?) + 'EnableEnhancedNvdecDecoder': value, + if (instance.preferSystemNativeHwDecoder case final value?) + 'PreferSystemNativeHwDecoder': value, + if (instance.enableIntelLowPowerH264HwEncoder case final value?) + 'EnableIntelLowPowerH264HwEncoder': value, + if (instance.enableIntelLowPowerHevcHwEncoder case final value?) + 'EnableIntelLowPowerHevcHwEncoder': value, + if (instance.enableHardwareEncoding case final value?) + 'EnableHardwareEncoding': value, + if (instance.allowHevcEncoding case final value?) + 'AllowHevcEncoding': value, + if (instance.allowAv1Encoding case final value?) + 'AllowAv1Encoding': value, + if (instance.enableSubtitleExtraction case final value?) + 'EnableSubtitleExtraction': value, + if (instance.hardwareDecodingCodecs case final value?) + 'HardwareDecodingCodecs': value, + if (instance.allowOnDemandMetadataBasedKeyframeExtractionForExtensions + case final value?) + 'AllowOnDemandMetadataBasedKeyframeExtractionForExtensions': value, + }; EndPointInfo _$EndPointInfoFromJson(Map json) => EndPointInfo( isLocal: json['IsLocal'] as bool?, isInNetwork: json['IsInNetwork'] as bool?, ); -Map _$EndPointInfoToJson(EndPointInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('IsLocal', instance.isLocal); - writeNotNull('IsInNetwork', instance.isInNetwork); - return val; -} +Map _$EndPointInfoToJson(EndPointInfo instance) => + { + if (instance.isLocal case final value?) 'IsLocal': value, + if (instance.isInNetwork case final value?) 'IsInNetwork': value, + }; ExternalIdInfo _$ExternalIdInfoFromJson(Map json) => ExternalIdInfo( @@ -2049,40 +1824,25 @@ ExternalIdInfo _$ExternalIdInfoFromJson(Map json) => urlFormatString: json['UrlFormatString'] as String?, ); -Map _$ExternalIdInfoToJson(ExternalIdInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Key', instance.key); - writeNotNull('Type', externalIdMediaTypeNullableToJson(instance.type)); - writeNotNull('UrlFormatString', instance.urlFormatString); - return val; -} +Map _$ExternalIdInfoToJson(ExternalIdInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.key case final value?) 'Key': value, + if (externalIdMediaTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.urlFormatString case final value?) 'UrlFormatString': value, + }; ExternalUrl _$ExternalUrlFromJson(Map json) => ExternalUrl( name: json['Name'] as String?, url: json['Url'] as String?, ); -Map _$ExternalUrlToJson(ExternalUrl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Url', instance.url); - return val; -} +Map _$ExternalUrlToJson(ExternalUrl instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.url case final value?) 'Url': value, + }; FileSystemEntryInfo _$FileSystemEntryInfoFromJson(Map json) => FileSystemEntryInfo( @@ -2091,20 +1851,14 @@ FileSystemEntryInfo _$FileSystemEntryInfoFromJson(Map json) => type: fileSystemEntryTypeNullableFromJson(json['Type']), ); -Map _$FileSystemEntryInfoToJson(FileSystemEntryInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Path', instance.path); - writeNotNull('Type', fileSystemEntryTypeNullableToJson(instance.type)); - return val; -} +Map _$FileSystemEntryInfoToJson( + FileSystemEntryInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.path case final value?) 'Path': value, + if (fileSystemEntryTypeNullableToJson(instance.type) case final value?) + 'Type': value, + }; FontFile _$FontFileFromJson(Map json) => FontFile( name: json['Name'] as String?, @@ -2117,21 +1871,14 @@ FontFile _$FontFileFromJson(Map json) => FontFile( : DateTime.parse(json['DateModified'] as String), ); -Map _$FontFileToJson(FontFile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Size', instance.size); - writeNotNull('DateCreated', instance.dateCreated?.toIso8601String()); - writeNotNull('DateModified', instance.dateModified?.toIso8601String()); - return val; -} +Map _$FontFileToJson(FontFile instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.size case final value?) 'Size': value, + if (instance.dateCreated?.toIso8601String() case final value?) + 'DateCreated': value, + if (instance.dateModified?.toIso8601String() case final value?) + 'DateModified': value, + }; ForceKeepAliveMessage _$ForceKeepAliveMessageFromJson( Map json) => @@ -2144,21 +1891,14 @@ ForceKeepAliveMessage _$ForceKeepAliveMessageFromJson( ); Map _$ForceKeepAliveMessageToJson( - ForceKeepAliveMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ForceKeepAliveMessage instance) => + { + if (instance.data case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ForgotPasswordDto _$ForgotPasswordDtoFromJson(Map json) => ForgotPasswordDto( @@ -2193,21 +1933,14 @@ ForgotPasswordResult _$ForgotPasswordResultFromJson( ); Map _$ForgotPasswordResultToJson( - ForgotPasswordResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Action', forgotPasswordActionNullableToJson(instance.action)); - writeNotNull('PinFile', instance.pinFile); - writeNotNull( - 'PinExpirationDate', instance.pinExpirationDate?.toIso8601String()); - return val; -} + ForgotPasswordResult instance) => + { + if (forgotPasswordActionNullableToJson(instance.action) case final value?) + 'Action': value, + if (instance.pinFile case final value?) 'PinFile': value, + if (instance.pinExpirationDate?.toIso8601String() case final value?) + 'PinExpirationDate': value, + }; GeneralCommand _$GeneralCommandFromJson(Map json) => GeneralCommand( @@ -2216,20 +1949,14 @@ GeneralCommand _$GeneralCommandFromJson(Map json) => arguments: json['Arguments'] as Map?, ); -Map _$GeneralCommandToJson(GeneralCommand instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', generalCommandTypeNullableToJson(instance.name)); - writeNotNull('ControllingUserId', instance.controllingUserId); - writeNotNull('Arguments', instance.arguments); - return val; -} +Map _$GeneralCommandToJson(GeneralCommand instance) => + { + if (generalCommandTypeNullableToJson(instance.name) case final value?) + 'Name': value, + if (instance.controllingUserId case final value?) + 'ControllingUserId': value, + if (instance.arguments case final value?) 'Arguments': value, + }; GeneralCommandMessage _$GeneralCommandMessageFromJson( Map json) => @@ -2244,21 +1971,14 @@ GeneralCommandMessage _$GeneralCommandMessageFromJson( ); Map _$GeneralCommandMessageToJson( - GeneralCommandMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + GeneralCommandMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; GetProgramsDto _$GetProgramsDtoFromJson(Map json) => GetProgramsDto( @@ -2309,44 +2029,41 @@ GetProgramsDto _$GetProgramsDtoFromJson(Map json) => fields: itemFieldsListFromJson(json['Fields'] as List?), ); -Map _$GetProgramsDtoToJson(GetProgramsDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ChannelIds', instance.channelIds); - writeNotNull('UserId', instance.userId); - writeNotNull('MinStartDate', instance.minStartDate?.toIso8601String()); - writeNotNull('HasAired', instance.hasAired); - writeNotNull('IsAiring', instance.isAiring); - writeNotNull('MaxStartDate', instance.maxStartDate?.toIso8601String()); - writeNotNull('MinEndDate', instance.minEndDate?.toIso8601String()); - writeNotNull('MaxEndDate', instance.maxEndDate?.toIso8601String()); - writeNotNull('IsMovie', instance.isMovie); - writeNotNull('IsSeries', instance.isSeries); - writeNotNull('IsNews', instance.isNews); - writeNotNull('IsKids', instance.isKids); - writeNotNull('IsSports', instance.isSports); - writeNotNull('StartIndex', instance.startIndex); - writeNotNull('Limit', instance.limit); - val['SortBy'] = itemSortByListToJson(instance.sortBy); - val['SortOrder'] = sortOrderListToJson(instance.sortOrder); - writeNotNull('Genres', instance.genres); - writeNotNull('GenreIds', instance.genreIds); - writeNotNull('EnableImages', instance.enableImages); - writeNotNull('EnableTotalRecordCount', instance.enableTotalRecordCount); - writeNotNull('ImageTypeLimit', instance.imageTypeLimit); - val['EnableImageTypes'] = imageTypeListToJson(instance.enableImageTypes); - writeNotNull('EnableUserData', instance.enableUserData); - writeNotNull('SeriesTimerId', instance.seriesTimerId); - writeNotNull('LibrarySeriesId', instance.librarySeriesId); - val['Fields'] = itemFieldsListToJson(instance.fields); - return val; -} +Map _$GetProgramsDtoToJson(GetProgramsDto instance) => + { + if (instance.channelIds case final value?) 'ChannelIds': value, + if (instance.userId case final value?) 'UserId': value, + if (instance.minStartDate?.toIso8601String() case final value?) + 'MinStartDate': value, + if (instance.hasAired case final value?) 'HasAired': value, + if (instance.isAiring case final value?) 'IsAiring': value, + if (instance.maxStartDate?.toIso8601String() case final value?) + 'MaxStartDate': value, + if (instance.minEndDate?.toIso8601String() case final value?) + 'MinEndDate': value, + if (instance.maxEndDate?.toIso8601String() case final value?) + 'MaxEndDate': value, + if (instance.isMovie case final value?) 'IsMovie': value, + if (instance.isSeries case final value?) 'IsSeries': value, + if (instance.isNews case final value?) 'IsNews': value, + if (instance.isKids case final value?) 'IsKids': value, + if (instance.isSports case final value?) 'IsSports': value, + if (instance.startIndex case final value?) 'StartIndex': value, + if (instance.limit case final value?) 'Limit': value, + 'SortBy': itemSortByListToJson(instance.sortBy), + 'SortOrder': sortOrderListToJson(instance.sortOrder), + if (instance.genres case final value?) 'Genres': value, + if (instance.genreIds case final value?) 'GenreIds': value, + if (instance.enableImages case final value?) 'EnableImages': value, + if (instance.enableTotalRecordCount case final value?) + 'EnableTotalRecordCount': value, + if (instance.imageTypeLimit case final value?) 'ImageTypeLimit': value, + 'EnableImageTypes': imageTypeListToJson(instance.enableImageTypes), + if (instance.enableUserData case final value?) 'EnableUserData': value, + if (instance.seriesTimerId case final value?) 'SeriesTimerId': value, + if (instance.librarySeriesId case final value?) 'LibrarySeriesId': value, + 'Fields': itemFieldsListToJson(instance.fields), + }; GroupInfoDto _$GroupInfoDtoFromJson(Map json) => GroupInfoDto( groupId: json['GroupId'] as String?, @@ -2361,22 +2078,16 @@ GroupInfoDto _$GroupInfoDtoFromJson(Map json) => GroupInfoDto( : DateTime.parse(json['LastUpdatedAt'] as String), ); -Map _$GroupInfoDtoToJson(GroupInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('GroupName', instance.groupName); - writeNotNull('State', groupStateTypeNullableToJson(instance.state)); - writeNotNull('Participants', instance.participants); - writeNotNull('LastUpdatedAt', instance.lastUpdatedAt?.toIso8601String()); - return val; -} +Map _$GroupInfoDtoToJson(GroupInfoDto instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (instance.groupName case final value?) 'GroupName': value, + if (groupStateTypeNullableToJson(instance.state) case final value?) + 'State': value, + if (instance.participants case final value?) 'Participants': value, + if (instance.lastUpdatedAt?.toIso8601String() case final value?) + 'LastUpdatedAt': value, + }; GroupInfoDtoGroupUpdate _$GroupInfoDtoGroupUpdateFromJson( Map json) => @@ -2389,20 +2100,13 @@ GroupInfoDtoGroupUpdate _$GroupInfoDtoGroupUpdateFromJson( ); Map _$GroupInfoDtoGroupUpdateToJson( - GroupInfoDtoGroupUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('Type', groupUpdateTypeNullableToJson(instance.type)); - writeNotNull('Data', instance.data?.toJson()); - return val; -} + GroupInfoDtoGroupUpdate instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (groupUpdateTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.data?.toJson() case final value?) 'Data': value, + }; GroupStateUpdate _$GroupStateUpdateFromJson(Map json) => GroupStateUpdate( @@ -2410,19 +2114,13 @@ GroupStateUpdate _$GroupStateUpdateFromJson(Map json) => reason: playbackRequestTypeNullableFromJson(json['Reason']), ); -Map _$GroupStateUpdateToJson(GroupStateUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('State', groupStateTypeNullableToJson(instance.state)); - writeNotNull('Reason', playbackRequestTypeNullableToJson(instance.reason)); - return val; -} +Map _$GroupStateUpdateToJson(GroupStateUpdate instance) => + { + if (groupStateTypeNullableToJson(instance.state) case final value?) + 'State': value, + if (playbackRequestTypeNullableToJson(instance.reason) case final value?) + 'Reason': value, + }; GroupStateUpdateGroupUpdate _$GroupStateUpdateGroupUpdateFromJson( Map json) => @@ -2435,39 +2133,25 @@ GroupStateUpdateGroupUpdate _$GroupStateUpdateGroupUpdateFromJson( ); Map _$GroupStateUpdateGroupUpdateToJson( - GroupStateUpdateGroupUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('Type', groupUpdateTypeNullableToJson(instance.type)); - writeNotNull('Data', instance.data?.toJson()); - return val; -} + GroupStateUpdateGroupUpdate instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (groupUpdateTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.data?.toJson() case final value?) 'Data': value, + }; GroupUpdate _$GroupUpdateFromJson(Map json) => GroupUpdate( groupId: json['GroupId'] as String?, type: groupUpdateTypeNullableFromJson(json['Type']), ); -Map _$GroupUpdateToJson(GroupUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('Type', groupUpdateTypeNullableToJson(instance.type)); - return val; -} +Map _$GroupUpdateToJson(GroupUpdate instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (groupUpdateTypeNullableToJson(instance.type) case final value?) + 'Type': value, + }; GuideInfo _$GuideInfoFromJson(Map json) => GuideInfo( startDate: json['StartDate'] == null @@ -2478,19 +2162,12 @@ GuideInfo _$GuideInfoFromJson(Map json) => GuideInfo( : DateTime.parse(json['EndDate'] as String), ); -Map _$GuideInfoToJson(GuideInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('StartDate', instance.startDate?.toIso8601String()); - writeNotNull('EndDate', instance.endDate?.toIso8601String()); - return val; -} +Map _$GuideInfoToJson(GuideInfo instance) => { + if (instance.startDate?.toIso8601String() case final value?) + 'StartDate': value, + if (instance.endDate?.toIso8601String() case final value?) + 'EndDate': value, + }; IgnoreWaitRequestDto _$IgnoreWaitRequestDtoFromJson( Map json) => @@ -2499,18 +2176,10 @@ IgnoreWaitRequestDto _$IgnoreWaitRequestDtoFromJson( ); Map _$IgnoreWaitRequestDtoToJson( - IgnoreWaitRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('IgnoreWait', instance.ignoreWait); - return val; -} + IgnoreWaitRequestDto instance) => + { + if (instance.ignoreWait case final value?) 'IgnoreWait': value, + }; ImageInfo _$ImageInfoFromJson(Map json) => ImageInfo( imageType: imageTypeNullableFromJson(json['ImageType']), @@ -2523,25 +2192,17 @@ ImageInfo _$ImageInfoFromJson(Map json) => ImageInfo( size: (json['Size'] as num?)?.toInt(), ); -Map _$ImageInfoToJson(ImageInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ImageType', imageTypeNullableToJson(instance.imageType)); - writeNotNull('ImageIndex', instance.imageIndex); - writeNotNull('ImageTag', instance.imageTag); - writeNotNull('Path', instance.path); - writeNotNull('BlurHash', instance.blurHash); - writeNotNull('Height', instance.height); - writeNotNull('Width', instance.width); - writeNotNull('Size', instance.size); - return val; -} +Map _$ImageInfoToJson(ImageInfo instance) => { + if (imageTypeNullableToJson(instance.imageType) case final value?) + 'ImageType': value, + if (instance.imageIndex case final value?) 'ImageIndex': value, + if (instance.imageTag case final value?) 'ImageTag': value, + if (instance.path case final value?) 'Path': value, + if (instance.blurHash case final value?) 'BlurHash': value, + if (instance.height case final value?) 'Height': value, + if (instance.width case final value?) 'Width': value, + if (instance.size case final value?) 'Size': value, + }; ImageOption _$ImageOptionFromJson(Map json) => ImageOption( type: imageTypeNullableFromJson(json['Type']), @@ -2549,20 +2210,13 @@ ImageOption _$ImageOptionFromJson(Map json) => ImageOption( minWidth: (json['MinWidth'] as num?)?.toInt(), ); -Map _$ImageOptionToJson(ImageOption instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Type', imageTypeNullableToJson(instance.type)); - writeNotNull('Limit', instance.limit); - writeNotNull('MinWidth', instance.minWidth); - return val; -} +Map _$ImageOptionToJson(ImageOption instance) => + { + if (imageTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.limit case final value?) 'Limit': value, + if (instance.minWidth case final value?) 'MinWidth': value, + }; ImageProviderInfo _$ImageProviderInfoFromJson(Map json) => ImageProviderInfo( @@ -2570,19 +2224,11 @@ ImageProviderInfo _$ImageProviderInfoFromJson(Map json) => supportedImages: imageTypeListFromJson(json['SupportedImages'] as List?), ); -Map _$ImageProviderInfoToJson(ImageProviderInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - val['SupportedImages'] = imageTypeListToJson(instance.supportedImages); - return val; -} +Map _$ImageProviderInfoToJson(ImageProviderInfo instance) => + { + if (instance.name case final value?) 'Name': value, + 'SupportedImages': imageTypeListToJson(instance.supportedImages), + }; InboundKeepAliveMessage _$InboundKeepAliveMessageFromJson( Map json) => @@ -2593,19 +2239,12 @@ InboundKeepAliveMessage _$InboundKeepAliveMessageFromJson( ); Map _$InboundKeepAliveMessageToJson( - InboundKeepAliveMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + InboundKeepAliveMessage instance) => + { + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; InboundWebSocketMessage _$InboundWebSocketMessageFromJson( Map json) => @@ -2628,24 +2267,17 @@ InstallationInfo _$InstallationInfoFromJson(Map json) => : PackageInfo.fromJson(json['PackageInfo'] as Map), ); -Map _$InstallationInfoToJson(InstallationInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Guid', instance.guid); - writeNotNull('Name', instance.name); - writeNotNull('Version', instance.version); - writeNotNull('Changelog', instance.changelog); - writeNotNull('SourceUrl', instance.sourceUrl); - writeNotNull('Checksum', instance.checksum); - writeNotNull('PackageInfo', instance.packageInfo?.toJson()); - return val; -} +Map _$InstallationInfoToJson(InstallationInfo instance) => + { + if (instance.guid case final value?) 'Guid': value, + if (instance.name case final value?) 'Name': value, + if (instance.version case final value?) 'Version': value, + if (instance.changelog case final value?) 'Changelog': value, + if (instance.sourceUrl case final value?) 'SourceUrl': value, + if (instance.checksum case final value?) 'Checksum': value, + if (instance.packageInfo?.toJson() case final value?) + 'PackageInfo': value, + }; IPlugin _$IPluginFromJson(Map json) => IPlugin( name: json['Name'] as String?, @@ -2657,24 +2289,16 @@ IPlugin _$IPluginFromJson(Map json) => IPlugin( dataFolderPath: json['DataFolderPath'] as String?, ); -Map _$IPluginToJson(IPlugin instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Description', instance.description); - writeNotNull('Id', instance.id); - writeNotNull('Version', instance.version); - writeNotNull('AssemblyFilePath', instance.assemblyFilePath); - writeNotNull('CanUninstall', instance.canUninstall); - writeNotNull('DataFolderPath', instance.dataFolderPath); - return val; -} +Map _$IPluginToJson(IPlugin instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.description case final value?) 'Description': value, + if (instance.id case final value?) 'Id': value, + if (instance.version case final value?) 'Version': value, + if (instance.assemblyFilePath case final value?) + 'AssemblyFilePath': value, + if (instance.canUninstall case final value?) 'CanUninstall': value, + if (instance.dataFolderPath case final value?) 'DataFolderPath': value, + }; ItemCounts _$ItemCountsFromJson(Map json) => ItemCounts( movieCount: (json['MovieCount'] as num?)?.toInt(), @@ -2691,47 +2315,32 @@ ItemCounts _$ItemCountsFromJson(Map json) => ItemCounts( itemCount: (json['ItemCount'] as num?)?.toInt(), ); -Map _$ItemCountsToJson(ItemCounts instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MovieCount', instance.movieCount); - writeNotNull('SeriesCount', instance.seriesCount); - writeNotNull('EpisodeCount', instance.episodeCount); - writeNotNull('ArtistCount', instance.artistCount); - writeNotNull('ProgramCount', instance.programCount); - writeNotNull('TrailerCount', instance.trailerCount); - writeNotNull('SongCount', instance.songCount); - writeNotNull('AlbumCount', instance.albumCount); - writeNotNull('MusicVideoCount', instance.musicVideoCount); - writeNotNull('BoxSetCount', instance.boxSetCount); - writeNotNull('BookCount', instance.bookCount); - writeNotNull('ItemCount', instance.itemCount); - return val; -} +Map _$ItemCountsToJson(ItemCounts instance) => + { + if (instance.movieCount case final value?) 'MovieCount': value, + if (instance.seriesCount case final value?) 'SeriesCount': value, + if (instance.episodeCount case final value?) 'EpisodeCount': value, + if (instance.artistCount case final value?) 'ArtistCount': value, + if (instance.programCount case final value?) 'ProgramCount': value, + if (instance.trailerCount case final value?) 'TrailerCount': value, + if (instance.songCount case final value?) 'SongCount': value, + if (instance.albumCount case final value?) 'AlbumCount': value, + if (instance.musicVideoCount case final value?) 'MusicVideoCount': value, + if (instance.boxSetCount case final value?) 'BoxSetCount': value, + if (instance.bookCount case final value?) 'BookCount': value, + if (instance.itemCount case final value?) 'ItemCount': value, + }; JoinGroupRequestDto _$JoinGroupRequestDtoFromJson(Map json) => JoinGroupRequestDto( groupId: json['GroupId'] as String?, ); -Map _$JoinGroupRequestDtoToJson(JoinGroupRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - return val; -} +Map _$JoinGroupRequestDtoToJson( + JoinGroupRequestDto instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + }; LibraryChangedMessage _$LibraryChangedMessageFromJson( Map json) => @@ -2746,21 +2355,14 @@ LibraryChangedMessage _$LibraryChangedMessageFromJson( ); Map _$LibraryChangedMessageToJson( - LibraryChangedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + LibraryChangedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; LibraryOptionInfoDto _$LibraryOptionInfoDtoFromJson( Map json) => @@ -2770,19 +2372,11 @@ LibraryOptionInfoDto _$LibraryOptionInfoDtoFromJson( ); Map _$LibraryOptionInfoDtoToJson( - LibraryOptionInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('DefaultEnabled', instance.defaultEnabled); - return val; -} + LibraryOptionInfoDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.defaultEnabled case final value?) 'DefaultEnabled': value, + }; LibraryOptions _$LibraryOptionsFromJson(Map json) => LibraryOptions( @@ -2889,77 +2483,91 @@ LibraryOptions _$LibraryOptionsFromJson(Map json) => [], ); -Map _$LibraryOptionsToJson(LibraryOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Enabled', instance.enabled); - writeNotNull('EnablePhotos', instance.enablePhotos); - writeNotNull('EnableRealtimeMonitor', instance.enableRealtimeMonitor); - writeNotNull('EnableLUFSScan', instance.enableLUFSScan); - writeNotNull( - 'EnableChapterImageExtraction', instance.enableChapterImageExtraction); - writeNotNull('ExtractChapterImagesDuringLibraryScan', - instance.extractChapterImagesDuringLibraryScan); - writeNotNull('EnableTrickplayImageExtraction', - instance.enableTrickplayImageExtraction); - writeNotNull('ExtractTrickplayImagesDuringLibraryScan', - instance.extractTrickplayImagesDuringLibraryScan); - writeNotNull( - 'PathInfos', instance.pathInfos?.map((e) => e.toJson()).toList()); - writeNotNull('SaveLocalMetadata', instance.saveLocalMetadata); - writeNotNull('EnableInternetProviders', instance.enableInternetProviders); - writeNotNull( - 'EnableAutomaticSeriesGrouping', instance.enableAutomaticSeriesGrouping); - writeNotNull('EnableEmbeddedTitles', instance.enableEmbeddedTitles); - writeNotNull( - 'EnableEmbeddedExtrasTitles', instance.enableEmbeddedExtrasTitles); - writeNotNull( - 'EnableEmbeddedEpisodeInfos', instance.enableEmbeddedEpisodeInfos); - writeNotNull( - 'AutomaticRefreshIntervalDays', instance.automaticRefreshIntervalDays); - writeNotNull('PreferredMetadataLanguage', instance.preferredMetadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('SeasonZeroDisplayName', instance.seasonZeroDisplayName); - writeNotNull('MetadataSavers', instance.metadataSavers); - writeNotNull( - 'DisabledLocalMetadataReaders', instance.disabledLocalMetadataReaders); - writeNotNull('LocalMetadataReaderOrder', instance.localMetadataReaderOrder); - writeNotNull('DisabledSubtitleFetchers', instance.disabledSubtitleFetchers); - writeNotNull('SubtitleFetcherOrder', instance.subtitleFetcherOrder); - writeNotNull( - 'DisabledMediaSegmentProviders', instance.disabledMediaSegmentProviders); - writeNotNull('MediaSegmentProvideOrder', instance.mediaSegmentProvideOrder); - writeNotNull('SkipSubtitlesIfEmbeddedSubtitlesPresent', - instance.skipSubtitlesIfEmbeddedSubtitlesPresent); - writeNotNull('SkipSubtitlesIfAudioTrackMatches', - instance.skipSubtitlesIfAudioTrackMatches); - writeNotNull('SubtitleDownloadLanguages', instance.subtitleDownloadLanguages); - writeNotNull( - 'RequirePerfectSubtitleMatch', instance.requirePerfectSubtitleMatch); - writeNotNull('SaveSubtitlesWithMedia', instance.saveSubtitlesWithMedia); - writeNotNull('SaveLyricsWithMedia', instance.saveLyricsWithMedia); - writeNotNull('SaveTrickplayWithMedia', instance.saveTrickplayWithMedia); - writeNotNull('DisabledLyricFetchers', instance.disabledLyricFetchers); - writeNotNull('LyricFetcherOrder', instance.lyricFetcherOrder); - writeNotNull( - 'PreferNonstandardArtistsTag', instance.preferNonstandardArtistsTag); - writeNotNull('UseCustomTagDelimiters', instance.useCustomTagDelimiters); - writeNotNull('CustomTagDelimiters', instance.customTagDelimiters); - writeNotNull('DelimiterWhitelist', instance.delimiterWhitelist); - writeNotNull( - 'AutomaticallyAddToCollection', instance.automaticallyAddToCollection); - writeNotNull('AllowEmbeddedSubtitles', - embeddedSubtitleOptionsNullableToJson(instance.allowEmbeddedSubtitles)); - writeNotNull( - 'TypeOptions', instance.typeOptions?.map((e) => e.toJson()).toList()); - return val; -} +Map _$LibraryOptionsToJson(LibraryOptions instance) => + { + if (instance.enabled case final value?) 'Enabled': value, + if (instance.enablePhotos case final value?) 'EnablePhotos': value, + if (instance.enableRealtimeMonitor case final value?) + 'EnableRealtimeMonitor': value, + if (instance.enableLUFSScan case final value?) 'EnableLUFSScan': value, + if (instance.enableChapterImageExtraction case final value?) + 'EnableChapterImageExtraction': value, + if (instance.extractChapterImagesDuringLibraryScan case final value?) + 'ExtractChapterImagesDuringLibraryScan': value, + if (instance.enableTrickplayImageExtraction case final value?) + 'EnableTrickplayImageExtraction': value, + if (instance.extractTrickplayImagesDuringLibraryScan case final value?) + 'ExtractTrickplayImagesDuringLibraryScan': value, + if (instance.pathInfos?.map((e) => e.toJson()).toList() case final value?) + 'PathInfos': value, + if (instance.saveLocalMetadata case final value?) + 'SaveLocalMetadata': value, + if (instance.enableInternetProviders case final value?) + 'EnableInternetProviders': value, + if (instance.enableAutomaticSeriesGrouping case final value?) + 'EnableAutomaticSeriesGrouping': value, + if (instance.enableEmbeddedTitles case final value?) + 'EnableEmbeddedTitles': value, + if (instance.enableEmbeddedExtrasTitles case final value?) + 'EnableEmbeddedExtrasTitles': value, + if (instance.enableEmbeddedEpisodeInfos case final value?) + 'EnableEmbeddedEpisodeInfos': value, + if (instance.automaticRefreshIntervalDays case final value?) + 'AutomaticRefreshIntervalDays': value, + if (instance.preferredMetadataLanguage case final value?) + 'PreferredMetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.seasonZeroDisplayName case final value?) + 'SeasonZeroDisplayName': value, + if (instance.metadataSavers case final value?) 'MetadataSavers': value, + if (instance.disabledLocalMetadataReaders case final value?) + 'DisabledLocalMetadataReaders': value, + if (instance.localMetadataReaderOrder case final value?) + 'LocalMetadataReaderOrder': value, + if (instance.disabledSubtitleFetchers case final value?) + 'DisabledSubtitleFetchers': value, + if (instance.subtitleFetcherOrder case final value?) + 'SubtitleFetcherOrder': value, + if (instance.disabledMediaSegmentProviders case final value?) + 'DisabledMediaSegmentProviders': value, + if (instance.mediaSegmentProvideOrder case final value?) + 'MediaSegmentProvideOrder': value, + if (instance.skipSubtitlesIfEmbeddedSubtitlesPresent case final value?) + 'SkipSubtitlesIfEmbeddedSubtitlesPresent': value, + if (instance.skipSubtitlesIfAudioTrackMatches case final value?) + 'SkipSubtitlesIfAudioTrackMatches': value, + if (instance.subtitleDownloadLanguages case final value?) + 'SubtitleDownloadLanguages': value, + if (instance.requirePerfectSubtitleMatch case final value?) + 'RequirePerfectSubtitleMatch': value, + if (instance.saveSubtitlesWithMedia case final value?) + 'SaveSubtitlesWithMedia': value, + if (instance.saveLyricsWithMedia case final value?) + 'SaveLyricsWithMedia': value, + if (instance.saveTrickplayWithMedia case final value?) + 'SaveTrickplayWithMedia': value, + if (instance.disabledLyricFetchers case final value?) + 'DisabledLyricFetchers': value, + if (instance.lyricFetcherOrder case final value?) + 'LyricFetcherOrder': value, + if (instance.preferNonstandardArtistsTag case final value?) + 'PreferNonstandardArtistsTag': value, + if (instance.useCustomTagDelimiters case final value?) + 'UseCustomTagDelimiters': value, + if (instance.customTagDelimiters case final value?) + 'CustomTagDelimiters': value, + if (instance.delimiterWhitelist case final value?) + 'DelimiterWhitelist': value, + if (instance.automaticallyAddToCollection case final value?) + 'AutomaticallyAddToCollection': value, + if (embeddedSubtitleOptionsNullableToJson(instance.allowEmbeddedSubtitles) + case final value?) + 'AllowEmbeddedSubtitles': value, + if (instance.typeOptions?.map((e) => e.toJson()).toList() + case final value?) + 'TypeOptions': value, + }; LibraryOptionsResultDto _$LibraryOptionsResultDtoFromJson( Map json) => @@ -2992,27 +2600,24 @@ LibraryOptionsResultDto _$LibraryOptionsResultDtoFromJson( ); Map _$LibraryOptionsResultDtoToJson( - LibraryOptionsResultDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MetadataSavers', - instance.metadataSavers?.map((e) => e.toJson()).toList()); - writeNotNull('MetadataReaders', - instance.metadataReaders?.map((e) => e.toJson()).toList()); - writeNotNull('SubtitleFetchers', - instance.subtitleFetchers?.map((e) => e.toJson()).toList()); - writeNotNull( - 'LyricFetchers', instance.lyricFetchers?.map((e) => e.toJson()).toList()); - writeNotNull( - 'TypeOptions', instance.typeOptions?.map((e) => e.toJson()).toList()); - return val; -} + LibraryOptionsResultDto instance) => + { + if (instance.metadataSavers?.map((e) => e.toJson()).toList() + case final value?) + 'MetadataSavers': value, + if (instance.metadataReaders?.map((e) => e.toJson()).toList() + case final value?) + 'MetadataReaders': value, + if (instance.subtitleFetchers?.map((e) => e.toJson()).toList() + case final value?) + 'SubtitleFetchers': value, + if (instance.lyricFetchers?.map((e) => e.toJson()).toList() + case final value?) + 'LyricFetchers': value, + if (instance.typeOptions?.map((e) => e.toJson()).toList() + case final value?) + 'TypeOptions': value, + }; LibraryTypeOptionsDto _$LibraryTypeOptionsDtoFromJson( Map json) => @@ -3037,26 +2642,20 @@ LibraryTypeOptionsDto _$LibraryTypeOptionsDtoFromJson( ); Map _$LibraryTypeOptionsDtoToJson( - LibraryTypeOptionsDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Type', instance.type); - writeNotNull('MetadataFetchers', - instance.metadataFetchers?.map((e) => e.toJson()).toList()); - writeNotNull( - 'ImageFetchers', instance.imageFetchers?.map((e) => e.toJson()).toList()); - val['SupportedImageTypes'] = - imageTypeListToJson(instance.supportedImageTypes); - writeNotNull('DefaultImageOptions', - instance.defaultImageOptions?.map((e) => e.toJson()).toList()); - return val; -} + LibraryTypeOptionsDto instance) => + { + if (instance.type case final value?) 'Type': value, + if (instance.metadataFetchers?.map((e) => e.toJson()).toList() + case final value?) + 'MetadataFetchers': value, + if (instance.imageFetchers?.map((e) => e.toJson()).toList() + case final value?) + 'ImageFetchers': value, + 'SupportedImageTypes': imageTypeListToJson(instance.supportedImageTypes), + if (instance.defaultImageOptions?.map((e) => e.toJson()).toList() + case final value?) + 'DefaultImageOptions': value, + }; LibraryUpdateInfo _$LibraryUpdateInfoFromJson(Map json) => LibraryUpdateInfo( @@ -3087,24 +2686,18 @@ LibraryUpdateInfo _$LibraryUpdateInfoFromJson(Map json) => isEmpty: json['IsEmpty'] as bool?, ); -Map _$LibraryUpdateInfoToJson(LibraryUpdateInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('FoldersAddedTo', instance.foldersAddedTo); - writeNotNull('FoldersRemovedFrom', instance.foldersRemovedFrom); - writeNotNull('ItemsAdded', instance.itemsAdded); - writeNotNull('ItemsRemoved', instance.itemsRemoved); - writeNotNull('ItemsUpdated', instance.itemsUpdated); - writeNotNull('CollectionFolders', instance.collectionFolders); - writeNotNull('IsEmpty', instance.isEmpty); - return val; -} +Map _$LibraryUpdateInfoToJson(LibraryUpdateInfo instance) => + { + if (instance.foldersAddedTo case final value?) 'FoldersAddedTo': value, + if (instance.foldersRemovedFrom case final value?) + 'FoldersRemovedFrom': value, + if (instance.itemsAdded case final value?) 'ItemsAdded': value, + if (instance.itemsRemoved case final value?) 'ItemsRemoved': value, + if (instance.itemsUpdated case final value?) 'ItemsUpdated': value, + if (instance.collectionFolders case final value?) + 'CollectionFolders': value, + if (instance.isEmpty case final value?) 'IsEmpty': value, + }; ListingsProviderInfo _$ListingsProviderInfoFromJson( Map json) => @@ -3148,36 +2741,31 @@ ListingsProviderInfo _$ListingsProviderInfoFromJson( ); Map _$ListingsProviderInfoToJson( - ListingsProviderInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('Type', instance.type); - writeNotNull('Username', instance.username); - writeNotNull('Password', instance.password); - writeNotNull('ListingsId', instance.listingsId); - writeNotNull('ZipCode', instance.zipCode); - writeNotNull('Country', instance.country); - writeNotNull('Path', instance.path); - writeNotNull('EnabledTuners', instance.enabledTuners); - writeNotNull('EnableAllTuners', instance.enableAllTuners); - writeNotNull('NewsCategories', instance.newsCategories); - writeNotNull('SportsCategories', instance.sportsCategories); - writeNotNull('KidsCategories', instance.kidsCategories); - writeNotNull('MovieCategories', instance.movieCategories); - writeNotNull('ChannelMappings', - instance.channelMappings?.map((e) => e.toJson()).toList()); - writeNotNull('MoviePrefix', instance.moviePrefix); - writeNotNull('PreferredLanguage', instance.preferredLanguage); - writeNotNull('UserAgent', instance.userAgent); - return val; -} + ListingsProviderInfo instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.type case final value?) 'Type': value, + if (instance.username case final value?) 'Username': value, + if (instance.password case final value?) 'Password': value, + if (instance.listingsId case final value?) 'ListingsId': value, + if (instance.zipCode case final value?) 'ZipCode': value, + if (instance.country case final value?) 'Country': value, + if (instance.path case final value?) 'Path': value, + if (instance.enabledTuners case final value?) 'EnabledTuners': value, + if (instance.enableAllTuners case final value?) 'EnableAllTuners': value, + if (instance.newsCategories case final value?) 'NewsCategories': value, + if (instance.sportsCategories case final value?) + 'SportsCategories': value, + if (instance.kidsCategories case final value?) 'KidsCategories': value, + if (instance.movieCategories case final value?) 'MovieCategories': value, + if (instance.channelMappings?.map((e) => e.toJson()).toList() + case final value?) + 'ChannelMappings': value, + if (instance.moviePrefix case final value?) 'MoviePrefix': value, + if (instance.preferredLanguage case final value?) + 'PreferredLanguage': value, + if (instance.userAgent case final value?) 'UserAgent': value, + }; LiveStreamResponse _$LiveStreamResponseFromJson(Map json) => LiveStreamResponse( @@ -3187,18 +2775,11 @@ LiveStreamResponse _$LiveStreamResponseFromJson(Map json) => json['MediaSource'] as Map), ); -Map _$LiveStreamResponseToJson(LiveStreamResponse instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MediaSource', instance.mediaSource?.toJson()); - return val; -} +Map _$LiveStreamResponseToJson(LiveStreamResponse instance) => + { + if (instance.mediaSource?.toJson() case final value?) + 'MediaSource': value, + }; LiveTvInfo _$LiveTvInfoFromJson(Map json) => LiveTvInfo( services: (json['Services'] as List?) @@ -3213,20 +2794,13 @@ LiveTvInfo _$LiveTvInfoFromJson(Map json) => LiveTvInfo( [], ); -Map _$LiveTvInfoToJson(LiveTvInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Services', instance.services?.map((e) => e.toJson()).toList()); - writeNotNull('IsEnabled', instance.isEnabled); - writeNotNull('EnabledUsers', instance.enabledUsers); - return val; -} +Map _$LiveTvInfoToJson(LiveTvInfo instance) => + { + if (instance.services?.map((e) => e.toJson()).toList() case final value?) + 'Services': value, + if (instance.isEnabled case final value?) 'IsEnabled': value, + if (instance.enabledUsers case final value?) 'EnabledUsers': value, + }; LiveTvOptions _$LiveTvOptionsFromJson(Map json) => LiveTvOptions( @@ -3259,36 +2833,39 @@ LiveTvOptions _$LiveTvOptionsFromJson(Map json) => saveRecordingImages: json['SaveRecordingImages'] as bool?, ); -Map _$LiveTvOptionsToJson(LiveTvOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GuideDays', instance.guideDays); - writeNotNull('RecordingPath', instance.recordingPath); - writeNotNull('MovieRecordingPath', instance.movieRecordingPath); - writeNotNull('SeriesRecordingPath', instance.seriesRecordingPath); - writeNotNull('EnableRecordingSubfolders', instance.enableRecordingSubfolders); - writeNotNull('EnableOriginalAudioWithEncodedRecordings', - instance.enableOriginalAudioWithEncodedRecordings); - writeNotNull( - 'TunerHosts', instance.tunerHosts?.map((e) => e.toJson()).toList()); - writeNotNull('ListingProviders', - instance.listingProviders?.map((e) => e.toJson()).toList()); - writeNotNull('PrePaddingSeconds', instance.prePaddingSeconds); - writeNotNull('PostPaddingSeconds', instance.postPaddingSeconds); - writeNotNull('MediaLocationsCreated', instance.mediaLocationsCreated); - writeNotNull('RecordingPostProcessor', instance.recordingPostProcessor); - writeNotNull('RecordingPostProcessorArguments', - instance.recordingPostProcessorArguments); - writeNotNull('SaveRecordingNFO', instance.saveRecordingNFO); - writeNotNull('SaveRecordingImages', instance.saveRecordingImages); - return val; -} +Map _$LiveTvOptionsToJson(LiveTvOptions instance) => + { + if (instance.guideDays case final value?) 'GuideDays': value, + if (instance.recordingPath case final value?) 'RecordingPath': value, + if (instance.movieRecordingPath case final value?) + 'MovieRecordingPath': value, + if (instance.seriesRecordingPath case final value?) + 'SeriesRecordingPath': value, + if (instance.enableRecordingSubfolders case final value?) + 'EnableRecordingSubfolders': value, + if (instance.enableOriginalAudioWithEncodedRecordings case final value?) + 'EnableOriginalAudioWithEncodedRecordings': value, + if (instance.tunerHosts?.map((e) => e.toJson()).toList() + case final value?) + 'TunerHosts': value, + if (instance.listingProviders?.map((e) => e.toJson()).toList() + case final value?) + 'ListingProviders': value, + if (instance.prePaddingSeconds case final value?) + 'PrePaddingSeconds': value, + if (instance.postPaddingSeconds case final value?) + 'PostPaddingSeconds': value, + if (instance.mediaLocationsCreated case final value?) + 'MediaLocationsCreated': value, + if (instance.recordingPostProcessor case final value?) + 'RecordingPostProcessor': value, + if (instance.recordingPostProcessorArguments case final value?) + 'RecordingPostProcessorArguments': value, + if (instance.saveRecordingNFO case final value?) + 'SaveRecordingNFO': value, + if (instance.saveRecordingImages case final value?) + 'SaveRecordingImages': value, + }; LiveTvServiceInfo _$LiveTvServiceInfoFromJson(Map json) => LiveTvServiceInfo( @@ -3305,25 +2882,19 @@ LiveTvServiceInfo _$LiveTvServiceInfoFromJson(Map json) => [], ); -Map _$LiveTvServiceInfoToJson(LiveTvServiceInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('HomePageUrl', instance.homePageUrl); - writeNotNull('Status', liveTvServiceStatusNullableToJson(instance.status)); - writeNotNull('StatusMessage', instance.statusMessage); - writeNotNull('Version', instance.version); - writeNotNull('HasUpdateAvailable', instance.hasUpdateAvailable); - writeNotNull('IsVisible', instance.isVisible); - writeNotNull('Tuners', instance.tuners); - return val; -} +Map _$LiveTvServiceInfoToJson(LiveTvServiceInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.homePageUrl case final value?) 'HomePageUrl': value, + if (liveTvServiceStatusNullableToJson(instance.status) case final value?) + 'Status': value, + if (instance.statusMessage case final value?) 'StatusMessage': value, + if (instance.version case final value?) 'Version': value, + if (instance.hasUpdateAvailable case final value?) + 'HasUpdateAvailable': value, + if (instance.isVisible case final value?) 'IsVisible': value, + if (instance.tuners case final value?) 'Tuners': value, + }; LocalizationOption _$LocalizationOptionFromJson(Map json) => LocalizationOption( @@ -3331,19 +2902,11 @@ LocalizationOption _$LocalizationOptionFromJson(Map json) => $Value: json['Value'] as String?, ); -Map _$LocalizationOptionToJson(LocalizationOption instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Value', instance.$Value); - return val; -} +Map _$LocalizationOptionToJson(LocalizationOption instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.$Value case final value?) 'Value': value, + }; LogFile _$LogFileFromJson(Map json) => LogFile( dateCreated: json['DateCreated'] == null @@ -3356,21 +2919,14 @@ LogFile _$LogFileFromJson(Map json) => LogFile( name: json['Name'] as String?, ); -Map _$LogFileToJson(LogFile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('DateCreated', instance.dateCreated?.toIso8601String()); - writeNotNull('DateModified', instance.dateModified?.toIso8601String()); - writeNotNull('Size', instance.size); - writeNotNull('Name', instance.name); - return val; -} +Map _$LogFileToJson(LogFile instance) => { + if (instance.dateCreated?.toIso8601String() case final value?) + 'DateCreated': value, + if (instance.dateModified?.toIso8601String() case final value?) + 'DateModified': value, + if (instance.size case final value?) 'Size': value, + if (instance.name case final value?) 'Name': value, + }; LyricDto _$LyricDtoFromJson(Map json) => LyricDto( metadata: json['Metadata'] == null @@ -3382,38 +2938,21 @@ LyricDto _$LyricDtoFromJson(Map json) => LyricDto( [], ); -Map _$LyricDtoToJson(LyricDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Metadata', instance.metadata?.toJson()); - writeNotNull('Lyrics', instance.lyrics?.map((e) => e.toJson()).toList()); - return val; -} +Map _$LyricDtoToJson(LyricDto instance) => { + if (instance.metadata?.toJson() case final value?) 'Metadata': value, + if (instance.lyrics?.map((e) => e.toJson()).toList() case final value?) + 'Lyrics': value, + }; LyricLine _$LyricLineFromJson(Map json) => LyricLine( text: json['Text'] as String?, start: (json['Start'] as num?)?.toInt(), ); -Map _$LyricLineToJson(LyricLine instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Text', instance.text); - writeNotNull('Start', instance.start); - return val; -} +Map _$LyricLineToJson(LyricLine instance) => { + if (instance.text case final value?) 'Text': value, + if (instance.start case final value?) 'Start': value, + }; LyricMetadata _$LyricMetadataFromJson(Map json) => LyricMetadata( @@ -3429,27 +2968,19 @@ LyricMetadata _$LyricMetadataFromJson(Map json) => isSynced: json['IsSynced'] as bool?, ); -Map _$LyricMetadataToJson(LyricMetadata instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Artist', instance.artist); - writeNotNull('Album', instance.album); - writeNotNull('Title', instance.title); - writeNotNull('Author', instance.author); - writeNotNull('Length', instance.length); - writeNotNull('By', instance.by); - writeNotNull('Offset', instance.offset); - writeNotNull('Creator', instance.creator); - writeNotNull('Version', instance.version); - writeNotNull('IsSynced', instance.isSynced); - return val; -} +Map _$LyricMetadataToJson(LyricMetadata instance) => + { + if (instance.artist case final value?) 'Artist': value, + if (instance.album case final value?) 'Album': value, + if (instance.title case final value?) 'Title': value, + if (instance.author case final value?) 'Author': value, + if (instance.length case final value?) 'Length': value, + if (instance.by case final value?) 'By': value, + if (instance.offset case final value?) 'Offset': value, + if (instance.creator case final value?) 'Creator': value, + if (instance.version case final value?) 'Version': value, + if (instance.isSynced case final value?) 'IsSynced': value, + }; MediaAttachment _$MediaAttachmentFromJson(Map json) => MediaAttachment( @@ -3462,24 +2993,16 @@ MediaAttachment _$MediaAttachmentFromJson(Map json) => deliveryUrl: json['DeliveryUrl'] as String?, ); -Map _$MediaAttachmentToJson(MediaAttachment instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Codec', instance.codec); - writeNotNull('CodecTag', instance.codecTag); - writeNotNull('Comment', instance.comment); - writeNotNull('Index', instance.index); - writeNotNull('FileName', instance.fileName); - writeNotNull('MimeType', instance.mimeType); - writeNotNull('DeliveryUrl', instance.deliveryUrl); - return val; -} +Map _$MediaAttachmentToJson(MediaAttachment instance) => + { + if (instance.codec case final value?) 'Codec': value, + if (instance.codecTag case final value?) 'CodecTag': value, + if (instance.comment case final value?) 'Comment': value, + if (instance.index case final value?) 'Index': value, + if (instance.fileName case final value?) 'FileName': value, + if (instance.mimeType case final value?) 'MimeType': value, + if (instance.deliveryUrl case final value?) 'DeliveryUrl': value, + }; MediaPathDto _$MediaPathDtoFromJson(Map json) => MediaPathDto( name: json['Name'] as String, @@ -3489,39 +3012,22 @@ MediaPathDto _$MediaPathDtoFromJson(Map json) => MediaPathDto( : MediaPathInfo.fromJson(json['PathInfo'] as Map), ); -Map _$MediaPathDtoToJson(MediaPathDto instance) { - final val = { - 'Name': instance.name, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Path', instance.path); - writeNotNull('PathInfo', instance.pathInfo?.toJson()); - return val; -} +Map _$MediaPathDtoToJson(MediaPathDto instance) => + { + 'Name': instance.name, + if (instance.path case final value?) 'Path': value, + if (instance.pathInfo?.toJson() case final value?) 'PathInfo': value, + }; MediaPathInfo _$MediaPathInfoFromJson(Map json) => MediaPathInfo( path: json['Path'] as String?, ); -Map _$MediaPathInfoToJson(MediaPathInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Path', instance.path); - return val; -} +Map _$MediaPathInfoToJson(MediaPathInfo instance) => + { + if (instance.path case final value?) 'Path': value, + }; MediaSegmentDto _$MediaSegmentDtoFromJson(Map json) => MediaSegmentDto( @@ -3532,22 +3038,15 @@ MediaSegmentDto _$MediaSegmentDtoFromJson(Map json) => endTicks: (json['EndTicks'] as num?)?.toInt(), ); -Map _$MediaSegmentDtoToJson(MediaSegmentDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('ItemId', instance.itemId); - writeNotNull('Type', mediaSegmentTypeNullableToJson(instance.type)); - writeNotNull('StartTicks', instance.startTicks); - writeNotNull('EndTicks', instance.endTicks); - return val; -} +Map _$MediaSegmentDtoToJson(MediaSegmentDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.itemId case final value?) 'ItemId': value, + if (mediaSegmentTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.startTicks case final value?) 'StartTicks': value, + if (instance.endTicks case final value?) 'EndTicks': value, + }; MediaSegmentDtoQueryResult _$MediaSegmentDtoQueryResultFromJson( Map json) => @@ -3561,20 +3060,14 @@ MediaSegmentDtoQueryResult _$MediaSegmentDtoQueryResultFromJson( ); Map _$MediaSegmentDtoQueryResultToJson( - MediaSegmentDtoQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + MediaSegmentDtoQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; MediaSourceInfo _$MediaSourceInfoFromJson(Map json) => MediaSourceInfo( @@ -3639,71 +3132,81 @@ MediaSourceInfo _$MediaSourceInfoFromJson(Map json) => hasSegments: json['HasSegments'] as bool?, ); -Map _$MediaSourceInfoToJson(MediaSourceInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Protocol', mediaProtocolNullableToJson(instance.protocol)); - writeNotNull('Id', instance.id); - writeNotNull('Path', instance.path); - writeNotNull('EncoderPath', instance.encoderPath); - writeNotNull( - 'EncoderProtocol', mediaProtocolNullableToJson(instance.encoderProtocol)); - writeNotNull('Type', mediaSourceTypeNullableToJson(instance.type)); - writeNotNull('Container', instance.container); - writeNotNull('Size', instance.size); - writeNotNull('Name', instance.name); - writeNotNull('IsRemote', instance.isRemote); - writeNotNull('ETag', instance.eTag); - writeNotNull('RunTimeTicks', instance.runTimeTicks); - writeNotNull('ReadAtNativeFramerate', instance.readAtNativeFramerate); - writeNotNull('IgnoreDts', instance.ignoreDts); - writeNotNull('IgnoreIndex', instance.ignoreIndex); - writeNotNull('GenPtsInput', instance.genPtsInput); - writeNotNull('SupportsTranscoding', instance.supportsTranscoding); - writeNotNull('SupportsDirectStream', instance.supportsDirectStream); - writeNotNull('SupportsDirectPlay', instance.supportsDirectPlay); - writeNotNull('IsInfiniteStream', instance.isInfiniteStream); - writeNotNull('UseMostCompatibleTranscodingProfile', - instance.useMostCompatibleTranscodingProfile); - writeNotNull('RequiresOpening', instance.requiresOpening); - writeNotNull('OpenToken', instance.openToken); - writeNotNull('RequiresClosing', instance.requiresClosing); - writeNotNull('LiveStreamId', instance.liveStreamId); - writeNotNull('BufferMs', instance.bufferMs); - writeNotNull('RequiresLooping', instance.requiresLooping); - writeNotNull('SupportsProbing', instance.supportsProbing); - writeNotNull('VideoType', videoTypeNullableToJson(instance.videoType)); - writeNotNull('IsoType', isoTypeNullableToJson(instance.isoType)); - writeNotNull( - 'Video3DFormat', video3DFormatNullableToJson(instance.video3DFormat)); - writeNotNull( - 'MediaStreams', instance.mediaStreams?.map((e) => e.toJson()).toList()); - writeNotNull('MediaAttachments', - instance.mediaAttachments?.map((e) => e.toJson()).toList()); - writeNotNull('Formats', instance.formats); - writeNotNull('Bitrate', instance.bitrate); - writeNotNull( - 'FallbackMaxStreamingBitrate', instance.fallbackMaxStreamingBitrate); - writeNotNull( - 'Timestamp', transportStreamTimestampNullableToJson(instance.timestamp)); - writeNotNull('RequiredHttpHeaders', instance.requiredHttpHeaders); - writeNotNull('TranscodingUrl', instance.transcodingUrl); - writeNotNull('TranscodingSubProtocol', - mediaStreamProtocolNullableToJson(instance.transcodingSubProtocol)); - writeNotNull('TranscodingContainer', instance.transcodingContainer); - writeNotNull('AnalyzeDurationMs', instance.analyzeDurationMs); - writeNotNull('DefaultAudioStreamIndex', instance.defaultAudioStreamIndex); - writeNotNull( - 'DefaultSubtitleStreamIndex', instance.defaultSubtitleStreamIndex); - writeNotNull('HasSegments', instance.hasSegments); - return val; -} +Map _$MediaSourceInfoToJson(MediaSourceInfo instance) => + { + if (mediaProtocolNullableToJson(instance.protocol) case final value?) + 'Protocol': value, + if (instance.id case final value?) 'Id': value, + if (instance.path case final value?) 'Path': value, + if (instance.encoderPath case final value?) 'EncoderPath': value, + if (mediaProtocolNullableToJson(instance.encoderProtocol) + case final value?) + 'EncoderProtocol': value, + if (mediaSourceTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.container case final value?) 'Container': value, + if (instance.size case final value?) 'Size': value, + if (instance.name case final value?) 'Name': value, + if (instance.isRemote case final value?) 'IsRemote': value, + if (instance.eTag case final value?) 'ETag': value, + if (instance.runTimeTicks case final value?) 'RunTimeTicks': value, + if (instance.readAtNativeFramerate case final value?) + 'ReadAtNativeFramerate': value, + if (instance.ignoreDts case final value?) 'IgnoreDts': value, + if (instance.ignoreIndex case final value?) 'IgnoreIndex': value, + if (instance.genPtsInput case final value?) 'GenPtsInput': value, + if (instance.supportsTranscoding case final value?) + 'SupportsTranscoding': value, + if (instance.supportsDirectStream case final value?) + 'SupportsDirectStream': value, + if (instance.supportsDirectPlay case final value?) + 'SupportsDirectPlay': value, + if (instance.isInfiniteStream case final value?) + 'IsInfiniteStream': value, + if (instance.useMostCompatibleTranscodingProfile case final value?) + 'UseMostCompatibleTranscodingProfile': value, + if (instance.requiresOpening case final value?) 'RequiresOpening': value, + if (instance.openToken case final value?) 'OpenToken': value, + if (instance.requiresClosing case final value?) 'RequiresClosing': value, + if (instance.liveStreamId case final value?) 'LiveStreamId': value, + if (instance.bufferMs case final value?) 'BufferMs': value, + if (instance.requiresLooping case final value?) 'RequiresLooping': value, + if (instance.supportsProbing case final value?) 'SupportsProbing': value, + if (videoTypeNullableToJson(instance.videoType) case final value?) + 'VideoType': value, + if (isoTypeNullableToJson(instance.isoType) case final value?) + 'IsoType': value, + if (video3DFormatNullableToJson(instance.video3DFormat) case final value?) + 'Video3DFormat': value, + if (instance.mediaStreams?.map((e) => e.toJson()).toList() + case final value?) + 'MediaStreams': value, + if (instance.mediaAttachments?.map((e) => e.toJson()).toList() + case final value?) + 'MediaAttachments': value, + if (instance.formats case final value?) 'Formats': value, + if (instance.bitrate case final value?) 'Bitrate': value, + if (instance.fallbackMaxStreamingBitrate case final value?) + 'FallbackMaxStreamingBitrate': value, + if (transportStreamTimestampNullableToJson(instance.timestamp) + case final value?) + 'Timestamp': value, + if (instance.requiredHttpHeaders case final value?) + 'RequiredHttpHeaders': value, + if (instance.transcodingUrl case final value?) 'TranscodingUrl': value, + if (mediaStreamProtocolNullableToJson(instance.transcodingSubProtocol) + case final value?) + 'TranscodingSubProtocol': value, + if (instance.transcodingContainer case final value?) + 'TranscodingContainer': value, + if (instance.analyzeDurationMs case final value?) + 'AnalyzeDurationMs': value, + if (instance.defaultAudioStreamIndex case final value?) + 'DefaultAudioStreamIndex': value, + if (instance.defaultSubtitleStreamIndex case final value?) + 'DefaultSubtitleStreamIndex': value, + if (instance.hasSegments case final value?) 'HasSegments': value, + }; MediaStream _$MediaStreamFromJson(Map json) => MediaStream( codec: json['Codec'] as String?, @@ -3775,83 +3278,90 @@ MediaStream _$MediaStreamFromJson(Map json) => MediaStream( isAnamorphic: json['IsAnamorphic'] as bool?, ); -Map _$MediaStreamToJson(MediaStream instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Codec', instance.codec); - writeNotNull('CodecTag', instance.codecTag); - writeNotNull('Language', instance.language); - writeNotNull('ColorRange', instance.colorRange); - writeNotNull('ColorSpace', instance.colorSpace); - writeNotNull('ColorTransfer', instance.colorTransfer); - writeNotNull('ColorPrimaries', instance.colorPrimaries); - writeNotNull('DvVersionMajor', instance.dvVersionMajor); - writeNotNull('DvVersionMinor', instance.dvVersionMinor); - writeNotNull('DvProfile', instance.dvProfile); - writeNotNull('DvLevel', instance.dvLevel); - writeNotNull('RpuPresentFlag', instance.rpuPresentFlag); - writeNotNull('ElPresentFlag', instance.elPresentFlag); - writeNotNull('BlPresentFlag', instance.blPresentFlag); - writeNotNull('DvBlSignalCompatibilityId', instance.dvBlSignalCompatibilityId); - writeNotNull('Rotation', instance.rotation); - writeNotNull('Comment', instance.comment); - writeNotNull('TimeBase', instance.timeBase); - writeNotNull('CodecTimeBase', instance.codecTimeBase); - writeNotNull('Title', instance.title); - writeNotNull('VideoRange', videoRangeNullableToJson(instance.videoRange)); - writeNotNull( - 'VideoRangeType', videoRangeTypeNullableToJson(instance.videoRangeType)); - writeNotNull('VideoDoViTitle', instance.videoDoViTitle); - writeNotNull('AudioSpatialFormat', - audioSpatialFormatNullableToJson(instance.audioSpatialFormat)); - writeNotNull('LocalizedUndefined', instance.localizedUndefined); - writeNotNull('LocalizedDefault', instance.localizedDefault); - writeNotNull('LocalizedForced', instance.localizedForced); - writeNotNull('LocalizedExternal', instance.localizedExternal); - writeNotNull('LocalizedHearingImpaired', instance.localizedHearingImpaired); - writeNotNull('DisplayTitle', instance.displayTitle); - writeNotNull('NalLengthSize', instance.nalLengthSize); - writeNotNull('IsInterlaced', instance.isInterlaced); - writeNotNull('IsAVC', instance.isAVC); - writeNotNull('ChannelLayout', instance.channelLayout); - writeNotNull('BitRate', instance.bitRate); - writeNotNull('BitDepth', instance.bitDepth); - writeNotNull('RefFrames', instance.refFrames); - writeNotNull('PacketLength', instance.packetLength); - writeNotNull('Channels', instance.channels); - writeNotNull('SampleRate', instance.sampleRate); - writeNotNull('IsDefault', instance.isDefault); - writeNotNull('IsForced', instance.isForced); - writeNotNull('IsHearingImpaired', instance.isHearingImpaired); - writeNotNull('Height', instance.height); - writeNotNull('Width', instance.width); - writeNotNull('AverageFrameRate', instance.averageFrameRate); - writeNotNull('RealFrameRate', instance.realFrameRate); - writeNotNull('ReferenceFrameRate', instance.referenceFrameRate); - writeNotNull('Profile', instance.profile); - writeNotNull('Type', mediaStreamTypeNullableToJson(instance.type)); - writeNotNull('AspectRatio', instance.aspectRatio); - writeNotNull('Index', instance.index); - writeNotNull('Score', instance.score); - writeNotNull('IsExternal', instance.isExternal); - writeNotNull('DeliveryMethod', - subtitleDeliveryMethodNullableToJson(instance.deliveryMethod)); - writeNotNull('DeliveryUrl', instance.deliveryUrl); - writeNotNull('IsExternalUrl', instance.isExternalUrl); - writeNotNull('IsTextSubtitleStream', instance.isTextSubtitleStream); - writeNotNull('SupportsExternalStream', instance.supportsExternalStream); - writeNotNull('Path', instance.path); - writeNotNull('PixelFormat', instance.pixelFormat); - writeNotNull('Level', instance.level); - writeNotNull('IsAnamorphic', instance.isAnamorphic); - return val; -} +Map _$MediaStreamToJson(MediaStream instance) => + { + if (instance.codec case final value?) 'Codec': value, + if (instance.codecTag case final value?) 'CodecTag': value, + if (instance.language case final value?) 'Language': value, + if (instance.colorRange case final value?) 'ColorRange': value, + if (instance.colorSpace case final value?) 'ColorSpace': value, + if (instance.colorTransfer case final value?) 'ColorTransfer': value, + if (instance.colorPrimaries case final value?) 'ColorPrimaries': value, + if (instance.dvVersionMajor case final value?) 'DvVersionMajor': value, + if (instance.dvVersionMinor case final value?) 'DvVersionMinor': value, + if (instance.dvProfile case final value?) 'DvProfile': value, + if (instance.dvLevel case final value?) 'DvLevel': value, + if (instance.rpuPresentFlag case final value?) 'RpuPresentFlag': value, + if (instance.elPresentFlag case final value?) 'ElPresentFlag': value, + if (instance.blPresentFlag case final value?) 'BlPresentFlag': value, + if (instance.dvBlSignalCompatibilityId case final value?) + 'DvBlSignalCompatibilityId': value, + if (instance.rotation case final value?) 'Rotation': value, + if (instance.comment case final value?) 'Comment': value, + if (instance.timeBase case final value?) 'TimeBase': value, + if (instance.codecTimeBase case final value?) 'CodecTimeBase': value, + if (instance.title case final value?) 'Title': value, + if (videoRangeNullableToJson(instance.videoRange) case final value?) + 'VideoRange': value, + if (videoRangeTypeNullableToJson(instance.videoRangeType) + case final value?) + 'VideoRangeType': value, + if (instance.videoDoViTitle case final value?) 'VideoDoViTitle': value, + if (audioSpatialFormatNullableToJson(instance.audioSpatialFormat) + case final value?) + 'AudioSpatialFormat': value, + if (instance.localizedUndefined case final value?) + 'LocalizedUndefined': value, + if (instance.localizedDefault case final value?) + 'LocalizedDefault': value, + if (instance.localizedForced case final value?) 'LocalizedForced': value, + if (instance.localizedExternal case final value?) + 'LocalizedExternal': value, + if (instance.localizedHearingImpaired case final value?) + 'LocalizedHearingImpaired': value, + if (instance.displayTitle case final value?) 'DisplayTitle': value, + if (instance.nalLengthSize case final value?) 'NalLengthSize': value, + if (instance.isInterlaced case final value?) 'IsInterlaced': value, + if (instance.isAVC case final value?) 'IsAVC': value, + if (instance.channelLayout case final value?) 'ChannelLayout': value, + if (instance.bitRate case final value?) 'BitRate': value, + if (instance.bitDepth case final value?) 'BitDepth': value, + if (instance.refFrames case final value?) 'RefFrames': value, + if (instance.packetLength case final value?) 'PacketLength': value, + if (instance.channels case final value?) 'Channels': value, + if (instance.sampleRate case final value?) 'SampleRate': value, + if (instance.isDefault case final value?) 'IsDefault': value, + if (instance.isForced case final value?) 'IsForced': value, + if (instance.isHearingImpaired case final value?) + 'IsHearingImpaired': value, + if (instance.height case final value?) 'Height': value, + if (instance.width case final value?) 'Width': value, + if (instance.averageFrameRate case final value?) + 'AverageFrameRate': value, + if (instance.realFrameRate case final value?) 'RealFrameRate': value, + if (instance.referenceFrameRate case final value?) + 'ReferenceFrameRate': value, + if (instance.profile case final value?) 'Profile': value, + if (mediaStreamTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.aspectRatio case final value?) 'AspectRatio': value, + if (instance.index case final value?) 'Index': value, + if (instance.score case final value?) 'Score': value, + if (instance.isExternal case final value?) 'IsExternal': value, + if (subtitleDeliveryMethodNullableToJson(instance.deliveryMethod) + case final value?) + 'DeliveryMethod': value, + if (instance.deliveryUrl case final value?) 'DeliveryUrl': value, + if (instance.isExternalUrl case final value?) 'IsExternalUrl': value, + if (instance.isTextSubtitleStream case final value?) + 'IsTextSubtitleStream': value, + if (instance.supportsExternalStream case final value?) + 'SupportsExternalStream': value, + if (instance.path case final value?) 'Path': value, + if (instance.pixelFormat case final value?) 'PixelFormat': value, + if (instance.level case final value?) 'Level': value, + if (instance.isAnamorphic case final value?) 'IsAnamorphic': value, + }; MediaUpdateInfoDto _$MediaUpdateInfoDtoFromJson(Map json) => MediaUpdateInfoDto( @@ -3862,18 +3372,11 @@ MediaUpdateInfoDto _$MediaUpdateInfoDtoFromJson(Map json) => [], ); -Map _$MediaUpdateInfoDtoToJson(MediaUpdateInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Updates', instance.updates?.map((e) => e.toJson()).toList()); - return val; -} +Map _$MediaUpdateInfoDtoToJson(MediaUpdateInfoDto instance) => + { + if (instance.updates?.map((e) => e.toJson()).toList() case final value?) + 'Updates': value, + }; MediaUpdateInfoPathDto _$MediaUpdateInfoPathDtoFromJson( Map json) => @@ -3883,38 +3386,21 @@ MediaUpdateInfoPathDto _$MediaUpdateInfoPathDtoFromJson( ); Map _$MediaUpdateInfoPathDtoToJson( - MediaUpdateInfoPathDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Path', instance.path); - writeNotNull('UpdateType', instance.updateType); - return val; -} + MediaUpdateInfoPathDto instance) => + { + if (instance.path case final value?) 'Path': value, + if (instance.updateType case final value?) 'UpdateType': value, + }; MediaUrl _$MediaUrlFromJson(Map json) => MediaUrl( url: json['Url'] as String?, name: json['Name'] as String?, ); -Map _$MediaUrlToJson(MediaUrl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Url', instance.url); - writeNotNull('Name', instance.name); - return val; -} +Map _$MediaUrlToJson(MediaUrl instance) => { + if (instance.url case final value?) 'Url': value, + if (instance.name case final value?) 'Name': value, + }; MessageCommand _$MessageCommandFromJson(Map json) => MessageCommand( @@ -3923,20 +3409,12 @@ MessageCommand _$MessageCommandFromJson(Map json) => timeoutMs: (json['TimeoutMs'] as num?)?.toInt(), ); -Map _$MessageCommandToJson(MessageCommand instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Header', instance.header); - val['Text'] = instance.text; - writeNotNull('TimeoutMs', instance.timeoutMs); - return val; -} +Map _$MessageCommandToJson(MessageCommand instance) => + { + if (instance.header case final value?) 'Header': value, + 'Text': instance.text, + if (instance.timeoutMs case final value?) 'TimeoutMs': value, + }; MetadataConfiguration _$MetadataConfigurationFromJson( Map json) => @@ -3946,19 +3424,11 @@ MetadataConfiguration _$MetadataConfigurationFromJson( ); Map _$MetadataConfigurationToJson( - MetadataConfiguration instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UseFileCreationTimeForDateAdded', - instance.useFileCreationTimeForDateAdded); - return val; -} + MetadataConfiguration instance) => + { + if (instance.useFileCreationTimeForDateAdded case final value?) + 'UseFileCreationTimeForDateAdded': value, + }; MetadataEditorInfo _$MetadataEditorInfoFromJson(Map json) => MetadataEditorInfo( @@ -3985,28 +3455,24 @@ MetadataEditorInfo _$MetadataEditorInfoFromJson(Map json) => [], ); -Map _$MetadataEditorInfoToJson(MetadataEditorInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ParentalRatingOptions', - instance.parentalRatingOptions?.map((e) => e.toJson()).toList()); - writeNotNull( - 'Countries', instance.countries?.map((e) => e.toJson()).toList()); - writeNotNull('Cultures', instance.cultures?.map((e) => e.toJson()).toList()); - writeNotNull('ExternalIdInfos', - instance.externalIdInfos?.map((e) => e.toJson()).toList()); - writeNotNull( - 'ContentType', collectionTypeNullableToJson(instance.contentType)); - writeNotNull('ContentTypeOptions', - instance.contentTypeOptions?.map((e) => e.toJson()).toList()); - return val; -} +Map _$MetadataEditorInfoToJson(MetadataEditorInfo instance) => + { + if (instance.parentalRatingOptions?.map((e) => e.toJson()).toList() + case final value?) + 'ParentalRatingOptions': value, + if (instance.countries?.map((e) => e.toJson()).toList() case final value?) + 'Countries': value, + if (instance.cultures?.map((e) => e.toJson()).toList() case final value?) + 'Cultures': value, + if (instance.externalIdInfos?.map((e) => e.toJson()).toList() + case final value?) + 'ExternalIdInfos': value, + if (collectionTypeNullableToJson(instance.contentType) case final value?) + 'ContentType': value, + if (instance.contentTypeOptions?.map((e) => e.toJson()).toList() + case final value?) + 'ContentTypeOptions': value, + }; MetadataOptions _$MetadataOptionsFromJson(Map json) => MetadataOptions( @@ -4039,24 +3505,22 @@ MetadataOptions _$MetadataOptionsFromJson(Map json) => [], ); -Map _$MetadataOptionsToJson(MetadataOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ItemType', instance.itemType); - writeNotNull('DisabledMetadataSavers', instance.disabledMetadataSavers); - writeNotNull('LocalMetadataReaderOrder', instance.localMetadataReaderOrder); - writeNotNull('DisabledMetadataFetchers', instance.disabledMetadataFetchers); - writeNotNull('MetadataFetcherOrder', instance.metadataFetcherOrder); - writeNotNull('DisabledImageFetchers', instance.disabledImageFetchers); - writeNotNull('ImageFetcherOrder', instance.imageFetcherOrder); - return val; -} +Map _$MetadataOptionsToJson(MetadataOptions instance) => + { + if (instance.itemType case final value?) 'ItemType': value, + if (instance.disabledMetadataSavers case final value?) + 'DisabledMetadataSavers': value, + if (instance.localMetadataReaderOrder case final value?) + 'LocalMetadataReaderOrder': value, + if (instance.disabledMetadataFetchers case final value?) + 'DisabledMetadataFetchers': value, + if (instance.metadataFetcherOrder case final value?) + 'MetadataFetcherOrder': value, + if (instance.disabledImageFetchers case final value?) + 'DisabledImageFetchers': value, + if (instance.imageFetcherOrder case final value?) + 'ImageFetcherOrder': value, + }; MovePlaylistItemRequestDto _$MovePlaylistItemRequestDtoFromJson( Map json) => @@ -4066,19 +3530,11 @@ MovePlaylistItemRequestDto _$MovePlaylistItemRequestDtoFromJson( ); Map _$MovePlaylistItemRequestDtoToJson( - MovePlaylistItemRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlaylistItemId', instance.playlistItemId); - writeNotNull('NewIndex', instance.newIndex); - return val; -} + MovePlaylistItemRequestDto instance) => + { + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + if (instance.newIndex case final value?) 'NewIndex': value, + }; MovieInfo _$MovieInfoFromJson(Map json) => MovieInfo( name: json['Name'] as String?, @@ -4096,28 +3552,23 @@ MovieInfo _$MovieInfoFromJson(Map json) => MovieInfo( isAutomated: json['IsAutomated'] as bool?, ); -Map _$MovieInfoToJson(MovieInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - return val; -} +Map _$MovieInfoToJson(MovieInfo instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + }; MovieInfoRemoteSearchQuery _$MovieInfoRemoteSearchQueryFromJson( Map json) => @@ -4131,21 +3582,15 @@ MovieInfoRemoteSearchQuery _$MovieInfoRemoteSearchQueryFromJson( ); Map _$MovieInfoRemoteSearchQueryToJson( - MovieInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + MovieInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; MusicVideoInfo _$MusicVideoInfoFromJson(Map json) => MusicVideoInfo( @@ -4168,29 +3613,25 @@ MusicVideoInfo _$MusicVideoInfoFromJson(Map json) => [], ); -Map _$MusicVideoInfoToJson(MusicVideoInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - writeNotNull('Artists', instance.artists); - return val; -} +Map _$MusicVideoInfoToJson(MusicVideoInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + if (instance.artists case final value?) 'Artists': value, + }; MusicVideoInfoRemoteSearchQuery _$MusicVideoInfoRemoteSearchQueryFromJson( Map json) => @@ -4204,59 +3645,37 @@ MusicVideoInfoRemoteSearchQuery _$MusicVideoInfoRemoteSearchQueryFromJson( ); Map _$MusicVideoInfoRemoteSearchQueryToJson( - MusicVideoInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + MusicVideoInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; NameGuidPair _$NameGuidPairFromJson(Map json) => NameGuidPair( name: json['Name'] as String?, id: json['Id'] as String?, ); -Map _$NameGuidPairToJson(NameGuidPair instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Id', instance.id); - return val; -} +Map _$NameGuidPairToJson(NameGuidPair instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.id case final value?) 'Id': value, + }; NameIdPair _$NameIdPairFromJson(Map json) => NameIdPair( name: json['Name'] as String?, id: json['Id'] as String?, ); -Map _$NameIdPairToJson(NameIdPair instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Id', instance.id); - return val; -} +Map _$NameIdPairToJson(NameIdPair instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.id case final value?) 'Id': value, + }; NameValuePair _$NameValuePairFromJson(Map json) => NameValuePair( @@ -4264,19 +3683,11 @@ NameValuePair _$NameValuePairFromJson(Map json) => $Value: json['Value'] as String?, ); -Map _$NameValuePairToJson(NameValuePair instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Value', instance.$Value); - return val; -} +Map _$NameValuePairToJson(NameValuePair instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.$Value case final value?) 'Value': value, + }; NetworkConfiguration _$NetworkConfigurationFromJson( Map json) => @@ -4327,78 +3738,63 @@ NetworkConfiguration _$NetworkConfigurationFromJson( ); Map _$NetworkConfigurationToJson( - NetworkConfiguration instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('BaseUrl', instance.baseUrl); - writeNotNull('EnableHttps', instance.enableHttps); - writeNotNull('RequireHttps', instance.requireHttps); - writeNotNull('CertificatePath', instance.certificatePath); - writeNotNull('CertificatePassword', instance.certificatePassword); - writeNotNull('InternalHttpPort', instance.internalHttpPort); - writeNotNull('InternalHttpsPort', instance.internalHttpsPort); - writeNotNull('PublicHttpPort', instance.publicHttpPort); - writeNotNull('PublicHttpsPort', instance.publicHttpsPort); - writeNotNull('AutoDiscovery', instance.autoDiscovery); - writeNotNull('EnableUPnP', instance.enableUPnP); - writeNotNull('EnableIPv4', instance.enableIPv4); - writeNotNull('EnableIPv6', instance.enableIPv6); - writeNotNull('EnableRemoteAccess', instance.enableRemoteAccess); - writeNotNull('LocalNetworkSubnets', instance.localNetworkSubnets); - writeNotNull('LocalNetworkAddresses', instance.localNetworkAddresses); - writeNotNull('KnownProxies', instance.knownProxies); - writeNotNull('IgnoreVirtualInterfaces', instance.ignoreVirtualInterfaces); - writeNotNull('VirtualInterfaceNames', instance.virtualInterfaceNames); - writeNotNull('EnablePublishedServerUriByRequest', - instance.enablePublishedServerUriByRequest); - writeNotNull( - 'PublishedServerUriBySubnet', instance.publishedServerUriBySubnet); - writeNotNull('RemoteIPFilter', instance.remoteIPFilter); - writeNotNull('IsRemoteIPFilterBlacklist', instance.isRemoteIPFilterBlacklist); - return val; -} + NetworkConfiguration instance) => + { + if (instance.baseUrl case final value?) 'BaseUrl': value, + if (instance.enableHttps case final value?) 'EnableHttps': value, + if (instance.requireHttps case final value?) 'RequireHttps': value, + if (instance.certificatePath case final value?) 'CertificatePath': value, + if (instance.certificatePassword case final value?) + 'CertificatePassword': value, + if (instance.internalHttpPort case final value?) + 'InternalHttpPort': value, + if (instance.internalHttpsPort case final value?) + 'InternalHttpsPort': value, + if (instance.publicHttpPort case final value?) 'PublicHttpPort': value, + if (instance.publicHttpsPort case final value?) 'PublicHttpsPort': value, + if (instance.autoDiscovery case final value?) 'AutoDiscovery': value, + if (instance.enableUPnP case final value?) 'EnableUPnP': value, + if (instance.enableIPv4 case final value?) 'EnableIPv4': value, + if (instance.enableIPv6 case final value?) 'EnableIPv6': value, + if (instance.enableRemoteAccess case final value?) + 'EnableRemoteAccess': value, + if (instance.localNetworkSubnets case final value?) + 'LocalNetworkSubnets': value, + if (instance.localNetworkAddresses case final value?) + 'LocalNetworkAddresses': value, + if (instance.knownProxies case final value?) 'KnownProxies': value, + if (instance.ignoreVirtualInterfaces case final value?) + 'IgnoreVirtualInterfaces': value, + if (instance.virtualInterfaceNames case final value?) + 'VirtualInterfaceNames': value, + if (instance.enablePublishedServerUriByRequest case final value?) + 'EnablePublishedServerUriByRequest': value, + if (instance.publishedServerUriBySubnet case final value?) + 'PublishedServerUriBySubnet': value, + if (instance.remoteIPFilter case final value?) 'RemoteIPFilter': value, + if (instance.isRemoteIPFilterBlacklist case final value?) + 'IsRemoteIPFilterBlacklist': value, + }; NewGroupRequestDto _$NewGroupRequestDtoFromJson(Map json) => NewGroupRequestDto( groupName: json['GroupName'] as String?, ); -Map _$NewGroupRequestDtoToJson(NewGroupRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupName', instance.groupName); - return val; -} +Map _$NewGroupRequestDtoToJson(NewGroupRequestDto instance) => + { + if (instance.groupName case final value?) 'GroupName': value, + }; NextItemRequestDto _$NextItemRequestDtoFromJson(Map json) => NextItemRequestDto( playlistItemId: json['PlaylistItemId'] as String?, ); -Map _$NextItemRequestDtoToJson(NextItemRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} +Map _$NextItemRequestDtoToJson(NextItemRequestDto instance) => + { + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; OpenLiveStreamDto _$OpenLiveStreamDtoFromJson(Map json) => OpenLiveStreamDto( @@ -4423,33 +3819,32 @@ OpenLiveStreamDto _$OpenLiveStreamDtoFromJson(Map json) => mediaProtocolListFromJson(json['DirectPlayProtocols'] as List?), ); -Map _$OpenLiveStreamDtoToJson(OpenLiveStreamDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('OpenToken', instance.openToken); - writeNotNull('UserId', instance.userId); - writeNotNull('PlaySessionId', instance.playSessionId); - writeNotNull('MaxStreamingBitrate', instance.maxStreamingBitrate); - writeNotNull('StartTimeTicks', instance.startTimeTicks); - writeNotNull('AudioStreamIndex', instance.audioStreamIndex); - writeNotNull('SubtitleStreamIndex', instance.subtitleStreamIndex); - writeNotNull('MaxAudioChannels', instance.maxAudioChannels); - writeNotNull('ItemId', instance.itemId); - writeNotNull('EnableDirectPlay', instance.enableDirectPlay); - writeNotNull('EnableDirectStream', instance.enableDirectStream); - writeNotNull('AlwaysBurnInSubtitleWhenTranscoding', - instance.alwaysBurnInSubtitleWhenTranscoding); - writeNotNull('DeviceProfile', instance.deviceProfile?.toJson()); - val['DirectPlayProtocols'] = - mediaProtocolListToJson(instance.directPlayProtocols); - return val; -} +Map _$OpenLiveStreamDtoToJson(OpenLiveStreamDto instance) => + { + if (instance.openToken case final value?) 'OpenToken': value, + if (instance.userId case final value?) 'UserId': value, + if (instance.playSessionId case final value?) 'PlaySessionId': value, + if (instance.maxStreamingBitrate case final value?) + 'MaxStreamingBitrate': value, + if (instance.startTimeTicks case final value?) 'StartTimeTicks': value, + if (instance.audioStreamIndex case final value?) + 'AudioStreamIndex': value, + if (instance.subtitleStreamIndex case final value?) + 'SubtitleStreamIndex': value, + if (instance.maxAudioChannels case final value?) + 'MaxAudioChannels': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.enableDirectPlay case final value?) + 'EnableDirectPlay': value, + if (instance.enableDirectStream case final value?) + 'EnableDirectStream': value, + if (instance.alwaysBurnInSubtitleWhenTranscoding case final value?) + 'AlwaysBurnInSubtitleWhenTranscoding': value, + if (instance.deviceProfile?.toJson() case final value?) + 'DeviceProfile': value, + 'DirectPlayProtocols': + mediaProtocolListToJson(instance.directPlayProtocols), + }; OutboundKeepAliveMessage _$OutboundKeepAliveMessageFromJson( Map json) => @@ -4460,20 +3855,13 @@ OutboundKeepAliveMessage _$OutboundKeepAliveMessageFromJson( ); Map _$OutboundKeepAliveMessageToJson( - OutboundKeepAliveMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + OutboundKeepAliveMessage instance) => + { + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; OutboundWebSocketMessage _$OutboundWebSocketMessageFromJson( Map json) => @@ -4497,25 +3885,18 @@ PackageInfo _$PackageInfoFromJson(Map json) => PackageInfo( imageUrl: json['imageUrl'] as String?, ); -Map _$PackageInfoToJson(PackageInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('name', instance.name); - writeNotNull('description', instance.description); - writeNotNull('overview', instance.overview); - writeNotNull('owner', instance.owner); - writeNotNull('category', instance.category); - writeNotNull('guid', instance.guid); - writeNotNull('versions', instance.versions?.map((e) => e.toJson()).toList()); - writeNotNull('imageUrl', instance.imageUrl); - return val; -} +Map _$PackageInfoToJson(PackageInfo instance) => + { + if (instance.name case final value?) 'name': value, + if (instance.description case final value?) 'description': value, + if (instance.overview case final value?) 'overview': value, + if (instance.owner case final value?) 'owner': value, + if (instance.category case final value?) 'category': value, + if (instance.guid case final value?) 'guid': value, + if (instance.versions?.map((e) => e.toJson()).toList() case final value?) + 'versions': value, + if (instance.imageUrl case final value?) 'imageUrl': value, + }; ParentalRating _$ParentalRatingFromJson(Map json) => ParentalRating( @@ -4523,19 +3904,11 @@ ParentalRating _$ParentalRatingFromJson(Map json) => $Value: (json['Value'] as num?)?.toInt(), ); -Map _$ParentalRatingToJson(ParentalRating instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Value', instance.$Value); - return val; -} +Map _$ParentalRatingToJson(ParentalRating instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.$Value case final value?) 'Value': value, + }; PathSubstitution _$PathSubstitutionFromJson(Map json) => PathSubstitution( @@ -4543,19 +3916,11 @@ PathSubstitution _$PathSubstitutionFromJson(Map json) => to: json['To'] as String?, ); -Map _$PathSubstitutionToJson(PathSubstitution instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('From', instance.from); - writeNotNull('To', instance.to); - return val; -} +Map _$PathSubstitutionToJson(PathSubstitution instance) => + { + if (instance.from case final value?) 'From': value, + if (instance.to case final value?) 'To': value, + }; PersonLookupInfo _$PersonLookupInfoFromJson(Map json) => PersonLookupInfo( @@ -4574,28 +3939,24 @@ PersonLookupInfo _$PersonLookupInfoFromJson(Map json) => isAutomated: json['IsAutomated'] as bool?, ); -Map _$PersonLookupInfoToJson(PersonLookupInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - return val; -} +Map _$PersonLookupInfoToJson(PersonLookupInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + }; PersonLookupInfoRemoteSearchQuery _$PersonLookupInfoRemoteSearchQueryFromJson( Map json) => @@ -4610,39 +3971,25 @@ PersonLookupInfoRemoteSearchQuery _$PersonLookupInfoRemoteSearchQueryFromJson( ); Map _$PersonLookupInfoRemoteSearchQueryToJson( - PersonLookupInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + PersonLookupInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; PingRequestDto _$PingRequestDtoFromJson(Map json) => PingRequestDto( ping: (json['Ping'] as num?)?.toInt(), ); -Map _$PingRequestDtoToJson(PingRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Ping', instance.ping); - return val; -} +Map _$PingRequestDtoToJson(PingRequestDto instance) => + { + if (instance.ping case final value?) 'Ping': value, + }; PinRedeemResult _$PinRedeemResultFromJson(Map json) => PinRedeemResult( @@ -4653,19 +4000,11 @@ PinRedeemResult _$PinRedeemResultFromJson(Map json) => [], ); -Map _$PinRedeemResultToJson(PinRedeemResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Success', instance.success); - writeNotNull('UsersReset', instance.usersReset); - return val; -} +Map _$PinRedeemResultToJson(PinRedeemResult instance) => + { + if (instance.success case final value?) 'Success': value, + if (instance.usersReset case final value?) 'UsersReset': value, + }; PlaybackInfoDto _$PlaybackInfoDtoFromJson(Map json) => PlaybackInfoDto( @@ -4691,34 +4030,37 @@ PlaybackInfoDto _$PlaybackInfoDtoFromJson(Map json) => json['AlwaysBurnInSubtitleWhenTranscoding'] as bool?, ); -Map _$PlaybackInfoDtoToJson(PlaybackInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UserId', instance.userId); - writeNotNull('MaxStreamingBitrate', instance.maxStreamingBitrate); - writeNotNull('StartTimeTicks', instance.startTimeTicks); - writeNotNull('AudioStreamIndex', instance.audioStreamIndex); - writeNotNull('SubtitleStreamIndex', instance.subtitleStreamIndex); - writeNotNull('MaxAudioChannels', instance.maxAudioChannels); - writeNotNull('MediaSourceId', instance.mediaSourceId); - writeNotNull('LiveStreamId', instance.liveStreamId); - writeNotNull('DeviceProfile', instance.deviceProfile?.toJson()); - writeNotNull('EnableDirectPlay', instance.enableDirectPlay); - writeNotNull('EnableDirectStream', instance.enableDirectStream); - writeNotNull('EnableTranscoding', instance.enableTranscoding); - writeNotNull('AllowVideoStreamCopy', instance.allowVideoStreamCopy); - writeNotNull('AllowAudioStreamCopy', instance.allowAudioStreamCopy); - writeNotNull('AutoOpenLiveStream', instance.autoOpenLiveStream); - writeNotNull('AlwaysBurnInSubtitleWhenTranscoding', - instance.alwaysBurnInSubtitleWhenTranscoding); - return val; -} +Map _$PlaybackInfoDtoToJson(PlaybackInfoDto instance) => + { + if (instance.userId case final value?) 'UserId': value, + if (instance.maxStreamingBitrate case final value?) + 'MaxStreamingBitrate': value, + if (instance.startTimeTicks case final value?) 'StartTimeTicks': value, + if (instance.audioStreamIndex case final value?) + 'AudioStreamIndex': value, + if (instance.subtitleStreamIndex case final value?) + 'SubtitleStreamIndex': value, + if (instance.maxAudioChannels case final value?) + 'MaxAudioChannels': value, + if (instance.mediaSourceId case final value?) 'MediaSourceId': value, + if (instance.liveStreamId case final value?) 'LiveStreamId': value, + if (instance.deviceProfile?.toJson() case final value?) + 'DeviceProfile': value, + if (instance.enableDirectPlay case final value?) + 'EnableDirectPlay': value, + if (instance.enableDirectStream case final value?) + 'EnableDirectStream': value, + if (instance.enableTranscoding case final value?) + 'EnableTranscoding': value, + if (instance.allowVideoStreamCopy case final value?) + 'AllowVideoStreamCopy': value, + if (instance.allowAudioStreamCopy case final value?) + 'AllowAudioStreamCopy': value, + if (instance.autoOpenLiveStream case final value?) + 'AutoOpenLiveStream': value, + if (instance.alwaysBurnInSubtitleWhenTranscoding case final value?) + 'AlwaysBurnInSubtitleWhenTranscoding': value, + }; PlaybackInfoResponse _$PlaybackInfoResponseFromJson( Map json) => @@ -4732,22 +4074,15 @@ PlaybackInfoResponse _$PlaybackInfoResponseFromJson( ); Map _$PlaybackInfoResponseToJson( - PlaybackInfoResponse instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'MediaSources', instance.mediaSources?.map((e) => e.toJson()).toList()); - writeNotNull('PlaySessionId', instance.playSessionId); - writeNotNull( - 'ErrorCode', playbackErrorCodeNullableToJson(instance.errorCode)); - return val; -} + PlaybackInfoResponse instance) => + { + if (instance.mediaSources?.map((e) => e.toJson()).toList() + case final value?) + 'MediaSources': value, + if (instance.playSessionId case final value?) 'PlaySessionId': value, + if (playbackErrorCodeNullableToJson(instance.errorCode) case final value?) + 'ErrorCode': value, + }; PlaybackProgressInfo _$PlaybackProgressInfoFromJson( Map json) => @@ -4781,40 +4116,38 @@ PlaybackProgressInfo _$PlaybackProgressInfoFromJson( ); Map _$PlaybackProgressInfoToJson( - PlaybackProgressInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('CanSeek', instance.canSeek); - writeNotNull('Item', instance.item?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SessionId', instance.sessionId); - writeNotNull('MediaSourceId', instance.mediaSourceId); - writeNotNull('AudioStreamIndex', instance.audioStreamIndex); - writeNotNull('SubtitleStreamIndex', instance.subtitleStreamIndex); - writeNotNull('IsPaused', instance.isPaused); - writeNotNull('IsMuted', instance.isMuted); - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('PlaybackStartTimeTicks', instance.playbackStartTimeTicks); - writeNotNull('VolumeLevel', instance.volumeLevel); - writeNotNull('Brightness', instance.brightness); - writeNotNull('AspectRatio', instance.aspectRatio); - writeNotNull('PlayMethod', playMethodNullableToJson(instance.playMethod)); - writeNotNull('LiveStreamId', instance.liveStreamId); - writeNotNull('PlaySessionId', instance.playSessionId); - writeNotNull('RepeatMode', repeatModeNullableToJson(instance.repeatMode)); - writeNotNull( - 'PlaybackOrder', playbackOrderNullableToJson(instance.playbackOrder)); - writeNotNull('NowPlayingQueue', - instance.nowPlayingQueue?.map((e) => e.toJson()).toList()); - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} + PlaybackProgressInfo instance) => + { + if (instance.canSeek case final value?) 'CanSeek': value, + if (instance.item?.toJson() case final value?) 'Item': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.sessionId case final value?) 'SessionId': value, + if (instance.mediaSourceId case final value?) 'MediaSourceId': value, + if (instance.audioStreamIndex case final value?) + 'AudioStreamIndex': value, + if (instance.subtitleStreamIndex case final value?) + 'SubtitleStreamIndex': value, + if (instance.isPaused case final value?) 'IsPaused': value, + if (instance.isMuted case final value?) 'IsMuted': value, + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (instance.playbackStartTimeTicks case final value?) + 'PlaybackStartTimeTicks': value, + if (instance.volumeLevel case final value?) 'VolumeLevel': value, + if (instance.brightness case final value?) 'Brightness': value, + if (instance.aspectRatio case final value?) 'AspectRatio': value, + if (playMethodNullableToJson(instance.playMethod) case final value?) + 'PlayMethod': value, + if (instance.liveStreamId case final value?) 'LiveStreamId': value, + if (instance.playSessionId case final value?) 'PlaySessionId': value, + if (repeatModeNullableToJson(instance.repeatMode) case final value?) + 'RepeatMode': value, + if (playbackOrderNullableToJson(instance.playbackOrder) case final value?) + 'PlaybackOrder': value, + if (instance.nowPlayingQueue?.map((e) => e.toJson()).toList() + case final value?) + 'NowPlayingQueue': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; PlaybackStartInfo _$PlaybackStartInfoFromJson(Map json) => PlaybackStartInfo( @@ -4846,40 +4179,38 @@ PlaybackStartInfo _$PlaybackStartInfoFromJson(Map json) => playlistItemId: json['PlaylistItemId'] as String?, ); -Map _$PlaybackStartInfoToJson(PlaybackStartInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('CanSeek', instance.canSeek); - writeNotNull('Item', instance.item?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SessionId', instance.sessionId); - writeNotNull('MediaSourceId', instance.mediaSourceId); - writeNotNull('AudioStreamIndex', instance.audioStreamIndex); - writeNotNull('SubtitleStreamIndex', instance.subtitleStreamIndex); - writeNotNull('IsPaused', instance.isPaused); - writeNotNull('IsMuted', instance.isMuted); - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('PlaybackStartTimeTicks', instance.playbackStartTimeTicks); - writeNotNull('VolumeLevel', instance.volumeLevel); - writeNotNull('Brightness', instance.brightness); - writeNotNull('AspectRatio', instance.aspectRatio); - writeNotNull('PlayMethod', playMethodNullableToJson(instance.playMethod)); - writeNotNull('LiveStreamId', instance.liveStreamId); - writeNotNull('PlaySessionId', instance.playSessionId); - writeNotNull('RepeatMode', repeatModeNullableToJson(instance.repeatMode)); - writeNotNull( - 'PlaybackOrder', playbackOrderNullableToJson(instance.playbackOrder)); - writeNotNull('NowPlayingQueue', - instance.nowPlayingQueue?.map((e) => e.toJson()).toList()); - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} +Map _$PlaybackStartInfoToJson(PlaybackStartInfo instance) => + { + if (instance.canSeek case final value?) 'CanSeek': value, + if (instance.item?.toJson() case final value?) 'Item': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.sessionId case final value?) 'SessionId': value, + if (instance.mediaSourceId case final value?) 'MediaSourceId': value, + if (instance.audioStreamIndex case final value?) + 'AudioStreamIndex': value, + if (instance.subtitleStreamIndex case final value?) + 'SubtitleStreamIndex': value, + if (instance.isPaused case final value?) 'IsPaused': value, + if (instance.isMuted case final value?) 'IsMuted': value, + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (instance.playbackStartTimeTicks case final value?) + 'PlaybackStartTimeTicks': value, + if (instance.volumeLevel case final value?) 'VolumeLevel': value, + if (instance.brightness case final value?) 'Brightness': value, + if (instance.aspectRatio case final value?) 'AspectRatio': value, + if (playMethodNullableToJson(instance.playMethod) case final value?) + 'PlayMethod': value, + if (instance.liveStreamId case final value?) 'LiveStreamId': value, + if (instance.playSessionId case final value?) 'PlaySessionId': value, + if (repeatModeNullableToJson(instance.repeatMode) case final value?) + 'RepeatMode': value, + if (playbackOrderNullableToJson(instance.playbackOrder) case final value?) + 'PlaybackOrder': value, + if (instance.nowPlayingQueue?.map((e) => e.toJson()).toList() + case final value?) + 'NowPlayingQueue': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; PlaybackStopInfo _$PlaybackStopInfoFromJson(Map json) => PlaybackStopInfo( @@ -4901,29 +4232,22 @@ PlaybackStopInfo _$PlaybackStopInfoFromJson(Map json) => [], ); -Map _$PlaybackStopInfoToJson(PlaybackStopInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Item', instance.item?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SessionId', instance.sessionId); - writeNotNull('MediaSourceId', instance.mediaSourceId); - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('LiveStreamId', instance.liveStreamId); - writeNotNull('PlaySessionId', instance.playSessionId); - writeNotNull('Failed', instance.failed); - writeNotNull('NextMediaType', instance.nextMediaType); - writeNotNull('PlaylistItemId', instance.playlistItemId); - writeNotNull('NowPlayingQueue', - instance.nowPlayingQueue?.map((e) => e.toJson()).toList()); - return val; -} +Map _$PlaybackStopInfoToJson(PlaybackStopInfo instance) => + { + if (instance.item?.toJson() case final value?) 'Item': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.sessionId case final value?) 'SessionId': value, + if (instance.mediaSourceId case final value?) 'MediaSourceId': value, + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (instance.liveStreamId case final value?) 'LiveStreamId': value, + if (instance.playSessionId case final value?) 'PlaySessionId': value, + if (instance.failed case final value?) 'Failed': value, + if (instance.nextMediaType case final value?) 'NextMediaType': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + if (instance.nowPlayingQueue?.map((e) => e.toJson()).toList() + case final value?) + 'NowPlayingQueue': value, + }; PlayerStateInfo _$PlayerStateInfoFromJson(Map json) => PlayerStateInfo( @@ -4941,30 +4265,26 @@ PlayerStateInfo _$PlayerStateInfoFromJson(Map json) => liveStreamId: json['LiveStreamId'] as String?, ); -Map _$PlayerStateInfoToJson(PlayerStateInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('CanSeek', instance.canSeek); - writeNotNull('IsPaused', instance.isPaused); - writeNotNull('IsMuted', instance.isMuted); - writeNotNull('VolumeLevel', instance.volumeLevel); - writeNotNull('AudioStreamIndex', instance.audioStreamIndex); - writeNotNull('SubtitleStreamIndex', instance.subtitleStreamIndex); - writeNotNull('MediaSourceId', instance.mediaSourceId); - writeNotNull('PlayMethod', playMethodNullableToJson(instance.playMethod)); - writeNotNull('RepeatMode', repeatModeNullableToJson(instance.repeatMode)); - writeNotNull( - 'PlaybackOrder', playbackOrderNullableToJson(instance.playbackOrder)); - writeNotNull('LiveStreamId', instance.liveStreamId); - return val; -} +Map _$PlayerStateInfoToJson(PlayerStateInfo instance) => + { + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (instance.canSeek case final value?) 'CanSeek': value, + if (instance.isPaused case final value?) 'IsPaused': value, + if (instance.isMuted case final value?) 'IsMuted': value, + if (instance.volumeLevel case final value?) 'VolumeLevel': value, + if (instance.audioStreamIndex case final value?) + 'AudioStreamIndex': value, + if (instance.subtitleStreamIndex case final value?) + 'SubtitleStreamIndex': value, + if (instance.mediaSourceId case final value?) 'MediaSourceId': value, + if (playMethodNullableToJson(instance.playMethod) case final value?) + 'PlayMethod': value, + if (repeatModeNullableToJson(instance.repeatMode) case final value?) + 'RepeatMode': value, + if (playbackOrderNullableToJson(instance.playbackOrder) case final value?) + 'PlaybackOrder': value, + if (instance.liveStreamId case final value?) 'LiveStreamId': value, + }; PlaylistCreationResult _$PlaylistCreationResultFromJson( Map json) => @@ -4973,18 +4293,10 @@ PlaylistCreationResult _$PlaylistCreationResultFromJson( ); Map _$PlaylistCreationResultToJson( - PlaylistCreationResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - return val; -} + PlaylistCreationResult instance) => + { + if (instance.id case final value?) 'Id': value, + }; PlaylistDto _$PlaylistDtoFromJson(Map json) => PlaylistDto( openAccess: json['OpenAccess'] as bool?, @@ -4999,20 +4311,13 @@ PlaylistDto _$PlaylistDtoFromJson(Map json) => PlaylistDto( [], ); -Map _$PlaylistDtoToJson(PlaylistDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('OpenAccess', instance.openAccess); - writeNotNull('Shares', instance.shares?.map((e) => e.toJson()).toList()); - writeNotNull('ItemIds', instance.itemIds); - return val; -} +Map _$PlaylistDtoToJson(PlaylistDto instance) => + { + if (instance.openAccess case final value?) 'OpenAccess': value, + if (instance.shares?.map((e) => e.toJson()).toList() case final value?) + 'Shares': value, + if (instance.itemIds case final value?) 'ItemIds': value, + }; PlaylistUserPermissions _$PlaylistUserPermissionsFromJson( Map json) => @@ -5022,19 +4327,11 @@ PlaylistUserPermissions _$PlaylistUserPermissionsFromJson( ); Map _$PlaylistUserPermissionsToJson( - PlaylistUserPermissions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UserId', instance.userId); - writeNotNull('CanEdit', instance.canEdit); - return val; -} + PlaylistUserPermissions instance) => + { + if (instance.userId case final value?) 'UserId': value, + if (instance.canEdit case final value?) 'CanEdit': value, + }; PlayMessage _$PlayMessageFromJson(Map json) => PlayMessage( data: json['Data'] == null @@ -5045,21 +4342,14 @@ PlayMessage _$PlayMessageFromJson(Map json) => PlayMessage( json['MessageType']), ); -Map _$PlayMessageToJson(PlayMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$PlayMessageToJson(PlayMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PlayQueueUpdate _$PlayQueueUpdateFromJson(Map json) => PlayQueueUpdate( @@ -5079,27 +4369,26 @@ PlayQueueUpdate _$PlayQueueUpdateFromJson(Map json) => repeatMode: groupRepeatModeNullableFromJson(json['RepeatMode']), ); -Map _$PlayQueueUpdateToJson(PlayQueueUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Reason', playQueueUpdateReasonNullableToJson(instance.reason)); - writeNotNull('LastUpdate', instance.lastUpdate?.toIso8601String()); - writeNotNull('Playlist', instance.playlist?.map((e) => e.toJson()).toList()); - writeNotNull('PlayingItemIndex', instance.playingItemIndex); - writeNotNull('StartPositionTicks', instance.startPositionTicks); - writeNotNull('IsPlaying', instance.isPlaying); - writeNotNull( - 'ShuffleMode', groupShuffleModeNullableToJson(instance.shuffleMode)); - writeNotNull( - 'RepeatMode', groupRepeatModeNullableToJson(instance.repeatMode)); - return val; -} +Map _$PlayQueueUpdateToJson(PlayQueueUpdate instance) => + { + if (playQueueUpdateReasonNullableToJson(instance.reason) + case final value?) + 'Reason': value, + if (instance.lastUpdate?.toIso8601String() case final value?) + 'LastUpdate': value, + if (instance.playlist?.map((e) => e.toJson()).toList() case final value?) + 'Playlist': value, + if (instance.playingItemIndex case final value?) + 'PlayingItemIndex': value, + if (instance.startPositionTicks case final value?) + 'StartPositionTicks': value, + if (instance.isPlaying case final value?) 'IsPlaying': value, + if (groupShuffleModeNullableToJson(instance.shuffleMode) + case final value?) + 'ShuffleMode': value, + if (groupRepeatModeNullableToJson(instance.repeatMode) case final value?) + 'RepeatMode': value, + }; PlayQueueUpdateGroupUpdate _$PlayQueueUpdateGroupUpdateFromJson( Map json) => @@ -5112,20 +4401,13 @@ PlayQueueUpdateGroupUpdate _$PlayQueueUpdateGroupUpdateFromJson( ); Map _$PlayQueueUpdateGroupUpdateToJson( - PlayQueueUpdateGroupUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('Type', groupUpdateTypeNullableToJson(instance.type)); - writeNotNull('Data', instance.data?.toJson()); - return val; -} + PlayQueueUpdateGroupUpdate instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (groupUpdateTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.data?.toJson() case final value?) 'Data': value, + }; PlayRequest _$PlayRequestFromJson(Map json) => PlayRequest( itemIds: (json['ItemIds'] as List?) @@ -5141,25 +4423,22 @@ PlayRequest _$PlayRequestFromJson(Map json) => PlayRequest( startIndex: (json['StartIndex'] as num?)?.toInt(), ); -Map _$PlayRequestToJson(PlayRequest instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ItemIds', instance.itemIds); - writeNotNull('StartPositionTicks', instance.startPositionTicks); - writeNotNull('PlayCommand', playCommandNullableToJson(instance.playCommand)); - writeNotNull('ControllingUserId', instance.controllingUserId); - writeNotNull('SubtitleStreamIndex', instance.subtitleStreamIndex); - writeNotNull('AudioStreamIndex', instance.audioStreamIndex); - writeNotNull('MediaSourceId', instance.mediaSourceId); - writeNotNull('StartIndex', instance.startIndex); - return val; -} +Map _$PlayRequestToJson(PlayRequest instance) => + { + if (instance.itemIds case final value?) 'ItemIds': value, + if (instance.startPositionTicks case final value?) + 'StartPositionTicks': value, + if (playCommandNullableToJson(instance.playCommand) case final value?) + 'PlayCommand': value, + if (instance.controllingUserId case final value?) + 'ControllingUserId': value, + if (instance.subtitleStreamIndex case final value?) + 'SubtitleStreamIndex': value, + if (instance.audioStreamIndex case final value?) + 'AudioStreamIndex': value, + if (instance.mediaSourceId case final value?) 'MediaSourceId': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; PlayRequestDto _$PlayRequestDtoFromJson(Map json) => PlayRequestDto( @@ -5171,20 +4450,14 @@ PlayRequestDto _$PlayRequestDtoFromJson(Map json) => startPositionTicks: (json['StartPositionTicks'] as num?)?.toInt(), ); -Map _$PlayRequestDtoToJson(PlayRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlayingQueue', instance.playingQueue); - writeNotNull('PlayingItemPosition', instance.playingItemPosition); - writeNotNull('StartPositionTicks', instance.startPositionTicks); - return val; -} +Map _$PlayRequestDtoToJson(PlayRequestDto instance) => + { + if (instance.playingQueue case final value?) 'PlayingQueue': value, + if (instance.playingItemPosition case final value?) + 'PlayingItemPosition': value, + if (instance.startPositionTicks case final value?) + 'StartPositionTicks': value, + }; PlaystateMessage _$PlaystateMessageFromJson(Map json) => PlaystateMessage( @@ -5197,21 +4470,14 @@ PlaystateMessage _$PlaystateMessageFromJson(Map json) => json['MessageType']), ); -Map _$PlaystateMessageToJson(PlaystateMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$PlaystateMessageToJson(PlaystateMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PlaystateRequest _$PlaystateRequestFromJson(Map json) => PlaystateRequest( @@ -5220,20 +4486,15 @@ PlaystateRequest _$PlaystateRequestFromJson(Map json) => controllingUserId: json['ControllingUserId'] as String?, ); -Map _$PlaystateRequestToJson(PlaystateRequest instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Command', playstateCommandNullableToJson(instance.command)); - writeNotNull('SeekPositionTicks', instance.seekPositionTicks); - writeNotNull('ControllingUserId', instance.controllingUserId); - return val; -} +Map _$PlaystateRequestToJson(PlaystateRequest instance) => + { + if (playstateCommandNullableToJson(instance.command) case final value?) + 'Command': value, + if (instance.seekPositionTicks case final value?) + 'SeekPositionTicks': value, + if (instance.controllingUserId case final value?) + 'ControllingUserId': value, + }; PluginInfo _$PluginInfoFromJson(Map json) => PluginInfo( name: json['Name'] as String?, @@ -5246,25 +4507,19 @@ PluginInfo _$PluginInfoFromJson(Map json) => PluginInfo( status: pluginStatusNullableFromJson(json['Status']), ); -Map _$PluginInfoToJson(PluginInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Version', instance.version); - writeNotNull('ConfigurationFileName', instance.configurationFileName); - writeNotNull('Description', instance.description); - writeNotNull('Id', instance.id); - writeNotNull('CanUninstall', instance.canUninstall); - writeNotNull('HasImage', instance.hasImage); - writeNotNull('Status', pluginStatusNullableToJson(instance.status)); - return val; -} +Map _$PluginInfoToJson(PluginInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.version case final value?) 'Version': value, + if (instance.configurationFileName case final value?) + 'ConfigurationFileName': value, + if (instance.description case final value?) 'Description': value, + if (instance.id case final value?) 'Id': value, + if (instance.canUninstall case final value?) 'CanUninstall': value, + if (instance.hasImage case final value?) 'HasImage': value, + if (pluginStatusNullableToJson(instance.status) case final value?) + 'Status': value, + }; PluginInstallationCancelledMessage _$PluginInstallationCancelledMessageFromJson( Map json) => @@ -5278,21 +4533,14 @@ PluginInstallationCancelledMessage _$PluginInstallationCancelledMessageFromJson( ); Map _$PluginInstallationCancelledMessageToJson( - PluginInstallationCancelledMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + PluginInstallationCancelledMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PluginInstallationCompletedMessage _$PluginInstallationCompletedMessageFromJson( Map json) => @@ -5306,21 +4554,14 @@ PluginInstallationCompletedMessage _$PluginInstallationCompletedMessageFromJson( ); Map _$PluginInstallationCompletedMessageToJson( - PluginInstallationCompletedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + PluginInstallationCompletedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PluginInstallationFailedMessage _$PluginInstallationFailedMessageFromJson( Map json) => @@ -5334,21 +4575,14 @@ PluginInstallationFailedMessage _$PluginInstallationFailedMessageFromJson( ); Map _$PluginInstallationFailedMessageToJson( - PluginInstallationFailedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + PluginInstallationFailedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PluginInstallingMessage _$PluginInstallingMessageFromJson( Map json) => @@ -5363,21 +4597,14 @@ PluginInstallingMessage _$PluginInstallingMessageFromJson( ); Map _$PluginInstallingMessageToJson( - PluginInstallingMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + PluginInstallingMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PluginUninstalledMessage _$PluginUninstalledMessageFromJson( Map json) => @@ -5391,21 +4618,14 @@ PluginUninstalledMessage _$PluginUninstalledMessageFromJson( ); Map _$PluginUninstalledMessageToJson( - PluginUninstalledMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + PluginUninstalledMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; PreviousItemRequestDto _$PreviousItemRequestDtoFromJson( Map json) => @@ -5414,18 +4634,10 @@ PreviousItemRequestDto _$PreviousItemRequestDtoFromJson( ); Map _$PreviousItemRequestDtoToJson( - PreviousItemRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} + PreviousItemRequestDto instance) => + { + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; ProblemDetails _$ProblemDetailsFromJson(Map json) => ProblemDetails( @@ -5436,22 +4648,14 @@ ProblemDetails _$ProblemDetailsFromJson(Map json) => instance: json['instance'] as String?, ); -Map _$ProblemDetailsToJson(ProblemDetails instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('type', instance.type); - writeNotNull('title', instance.title); - writeNotNull('status', instance.status); - writeNotNull('detail', instance.detail); - writeNotNull('instance', instance.instance); - return val; -} +Map _$ProblemDetailsToJson(ProblemDetails instance) => + { + if (instance.type case final value?) 'type': value, + if (instance.title case final value?) 'title': value, + if (instance.status case final value?) 'status': value, + if (instance.detail case final value?) 'detail': value, + if (instance.instance case final value?) 'instance': value, + }; ProfileCondition _$ProfileConditionFromJson(Map json) => ProfileCondition( @@ -5461,23 +4665,17 @@ ProfileCondition _$ProfileConditionFromJson(Map json) => isRequired: json['IsRequired'] as bool?, ); -Map _$ProfileConditionToJson(ProfileCondition instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'Condition', profileConditionTypeNullableToJson(instance.condition)); - writeNotNull( - 'Property', profileConditionValueNullableToJson(instance.property)); - writeNotNull('Value', instance.$Value); - writeNotNull('IsRequired', instance.isRequired); - return val; -} +Map _$ProfileConditionToJson(ProfileCondition instance) => + { + if (profileConditionTypeNullableToJson(instance.condition) + case final value?) + 'Condition': value, + if (profileConditionValueNullableToJson(instance.property) + case final value?) + 'Property': value, + if (instance.$Value case final value?) 'Value': value, + if (instance.isRequired case final value?) 'IsRequired': value, + }; PublicSystemInfo _$PublicSystemInfoFromJson(Map json) => PublicSystemInfo( @@ -5490,24 +4688,17 @@ PublicSystemInfo _$PublicSystemInfoFromJson(Map json) => startupWizardCompleted: json['StartupWizardCompleted'] as bool?, ); -Map _$PublicSystemInfoToJson(PublicSystemInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('LocalAddress', instance.localAddress); - writeNotNull('ServerName', instance.serverName); - writeNotNull('Version', instance.version); - writeNotNull('ProductName', instance.productName); - writeNotNull('OperatingSystem', instance.operatingSystem); - writeNotNull('Id', instance.id); - writeNotNull('StartupWizardCompleted', instance.startupWizardCompleted); - return val; -} +Map _$PublicSystemInfoToJson(PublicSystemInfo instance) => + { + if (instance.localAddress case final value?) 'LocalAddress': value, + if (instance.serverName case final value?) 'ServerName': value, + if (instance.version case final value?) 'Version': value, + if (instance.productName case final value?) 'ProductName': value, + if (instance.operatingSystem case final value?) 'OperatingSystem': value, + if (instance.id case final value?) 'Id': value, + if (instance.startupWizardCompleted case final value?) + 'StartupWizardCompleted': value, + }; QueryFilters _$QueryFiltersFromJson(Map json) => QueryFilters( genres: (json['Genres'] as List?) @@ -5519,19 +4710,12 @@ QueryFilters _$QueryFiltersFromJson(Map json) => QueryFilters( [], ); -Map _$QueryFiltersToJson(QueryFilters instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Genres', instance.genres?.map((e) => e.toJson()).toList()); - writeNotNull('Tags', instance.tags); - return val; -} +Map _$QueryFiltersToJson(QueryFilters instance) => + { + if (instance.genres?.map((e) => e.toJson()).toList() case final value?) + 'Genres': value, + if (instance.tags case final value?) 'Tags': value, + }; QueryFiltersLegacy _$QueryFiltersLegacyFromJson(Map json) => QueryFiltersLegacy( @@ -5552,40 +4736,23 @@ QueryFiltersLegacy _$QueryFiltersLegacyFromJson(Map json) => [], ); -Map _$QueryFiltersLegacyToJson(QueryFiltersLegacy instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Genres', instance.genres); - writeNotNull('Tags', instance.tags); - writeNotNull('OfficialRatings', instance.officialRatings); - writeNotNull('Years', instance.years); - return val; -} +Map _$QueryFiltersLegacyToJson(QueryFiltersLegacy instance) => + { + if (instance.genres case final value?) 'Genres': value, + if (instance.tags case final value?) 'Tags': value, + if (instance.officialRatings case final value?) 'OfficialRatings': value, + if (instance.years case final value?) 'Years': value, + }; QueueItem _$QueueItemFromJson(Map json) => QueueItem( id: json['Id'] as String?, playlistItemId: json['PlaylistItemId'] as String?, ); -Map _$QueueItemToJson(QueueItem instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} +Map _$QueueItemToJson(QueueItem instance) => { + if (instance.id case final value?) 'Id': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; QueueRequestDto _$QueueRequestDtoFromJson(Map json) => QueueRequestDto( @@ -5596,19 +4763,12 @@ QueueRequestDto _$QueueRequestDtoFromJson(Map json) => mode: groupQueueModeNullableFromJson(json['Mode']), ); -Map _$QueueRequestDtoToJson(QueueRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ItemIds', instance.itemIds); - writeNotNull('Mode', groupQueueModeNullableToJson(instance.mode)); - return val; -} +Map _$QueueRequestDtoToJson(QueueRequestDto instance) => + { + if (instance.itemIds case final value?) 'ItemIds': value, + if (groupQueueModeNullableToJson(instance.mode) case final value?) + 'Mode': value, + }; QuickConnectDto _$QuickConnectDtoFromJson(Map json) => QuickConnectDto( @@ -5634,25 +4794,18 @@ QuickConnectResult _$QuickConnectResultFromJson(Map json) => : DateTime.parse(json['DateAdded'] as String), ); -Map _$QuickConnectResultToJson(QuickConnectResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Authenticated', instance.authenticated); - writeNotNull('Secret', instance.secret); - writeNotNull('Code', instance.code); - writeNotNull('DeviceId', instance.deviceId); - writeNotNull('DeviceName', instance.deviceName); - writeNotNull('AppName', instance.appName); - writeNotNull('AppVersion', instance.appVersion); - writeNotNull('DateAdded', instance.dateAdded?.toIso8601String()); - return val; -} +Map _$QuickConnectResultToJson(QuickConnectResult instance) => + { + if (instance.authenticated case final value?) 'Authenticated': value, + if (instance.secret case final value?) 'Secret': value, + if (instance.code case final value?) 'Code': value, + if (instance.deviceId case final value?) 'DeviceId': value, + if (instance.deviceName case final value?) 'DeviceName': value, + if (instance.appName case final value?) 'AppName': value, + if (instance.appVersion case final value?) 'AppVersion': value, + if (instance.dateAdded?.toIso8601String() case final value?) + 'DateAdded': value, + }; ReadyRequestDto _$ReadyRequestDtoFromJson(Map json) => ReadyRequestDto( @@ -5663,21 +4816,13 @@ ReadyRequestDto _$ReadyRequestDtoFromJson(Map json) => playlistItemId: json['PlaylistItemId'] as String?, ); -Map _$ReadyRequestDtoToJson(ReadyRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('When', instance.when?.toIso8601String()); - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('IsPlaying', instance.isPlaying); - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} +Map _$ReadyRequestDtoToJson(ReadyRequestDto instance) => + { + if (instance.when?.toIso8601String() case final value?) 'When': value, + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (instance.isPlaying case final value?) 'IsPlaying': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; RecommendationDto _$RecommendationDtoFromJson(Map json) => RecommendationDto( @@ -5691,22 +4836,17 @@ RecommendationDto _$RecommendationDtoFromJson(Map json) => categoryId: json['CategoryId'] as String?, ); -Map _$RecommendationDtoToJson(RecommendationDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('RecommendationType', - recommendationTypeNullableToJson(instance.recommendationType)); - writeNotNull('BaselineItemName', instance.baselineItemName); - writeNotNull('CategoryId', instance.categoryId); - return val; -} +Map _$RecommendationDtoToJson(RecommendationDto instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (recommendationTypeNullableToJson(instance.recommendationType) + case final value?) + 'RecommendationType': value, + if (instance.baselineItemName case final value?) + 'BaselineItemName': value, + if (instance.categoryId case final value?) 'CategoryId': value, + }; RefreshProgressMessage _$RefreshProgressMessageFromJson( Map json) => @@ -5719,21 +4859,14 @@ RefreshProgressMessage _$RefreshProgressMessageFromJson( ); Map _$RefreshProgressMessageToJson( - RefreshProgressMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + RefreshProgressMessage instance) => + { + if (instance.data case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; RemoteImageInfo _$RemoteImageInfoFromJson(Map json) => RemoteImageInfo( @@ -5749,27 +4882,21 @@ RemoteImageInfo _$RemoteImageInfoFromJson(Map json) => ratingType: ratingTypeNullableFromJson(json['RatingType']), ); -Map _$RemoteImageInfoToJson(RemoteImageInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ProviderName', instance.providerName); - writeNotNull('Url', instance.url); - writeNotNull('ThumbnailUrl', instance.thumbnailUrl); - writeNotNull('Height', instance.height); - writeNotNull('Width', instance.width); - writeNotNull('CommunityRating', instance.communityRating); - writeNotNull('VoteCount', instance.voteCount); - writeNotNull('Language', instance.language); - writeNotNull('Type', imageTypeNullableToJson(instance.type)); - writeNotNull('RatingType', ratingTypeNullableToJson(instance.ratingType)); - return val; -} +Map _$RemoteImageInfoToJson(RemoteImageInfo instance) => + { + if (instance.providerName case final value?) 'ProviderName': value, + if (instance.url case final value?) 'Url': value, + if (instance.thumbnailUrl case final value?) 'ThumbnailUrl': value, + if (instance.height case final value?) 'Height': value, + if (instance.width case final value?) 'Width': value, + if (instance.communityRating case final value?) 'CommunityRating': value, + if (instance.voteCount case final value?) 'VoteCount': value, + if (instance.language case final value?) 'Language': value, + if (imageTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (ratingTypeNullableToJson(instance.ratingType) case final value?) + 'RatingType': value, + }; RemoteImageResult _$RemoteImageResultFromJson(Map json) => RemoteImageResult( @@ -5784,20 +4911,14 @@ RemoteImageResult _$RemoteImageResultFromJson(Map json) => [], ); -Map _$RemoteImageResultToJson(RemoteImageResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Images', instance.images?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('Providers', instance.providers); - return val; -} +Map _$RemoteImageResultToJson(RemoteImageResult instance) => + { + if (instance.images?.map((e) => e.toJson()).toList() case final value?) + 'Images': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.providers case final value?) 'Providers': value, + }; RemoteLyricInfoDto _$RemoteLyricInfoDtoFromJson(Map json) => RemoteLyricInfoDto( @@ -5808,20 +4929,12 @@ RemoteLyricInfoDto _$RemoteLyricInfoDtoFromJson(Map json) => : LyricDto.fromJson(json['Lyrics'] as Map), ); -Map _$RemoteLyricInfoDtoToJson(RemoteLyricInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('ProviderName', instance.providerName); - writeNotNull('Lyrics', instance.lyrics?.toJson()); - return val; -} +Map _$RemoteLyricInfoDtoToJson(RemoteLyricInfoDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.providerName case final value?) 'ProviderName': value, + if (instance.lyrics?.toJson() case final value?) 'Lyrics': value, + }; RemoteSearchResult _$RemoteSearchResultFromJson(Map json) => RemoteSearchResult( @@ -5848,29 +4961,26 @@ RemoteSearchResult _$RemoteSearchResultFromJson(Map json) => [], ); -Map _$RemoteSearchResultToJson(RemoteSearchResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('ProductionYear', instance.productionYear); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('IndexNumberEnd', instance.indexNumberEnd); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('ImageUrl', instance.imageUrl); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('Overview', instance.overview); - writeNotNull('AlbumArtist', instance.albumArtist?.toJson()); - writeNotNull('Artists', instance.artists?.map((e) => e.toJson()).toList()); - return val; -} +Map _$RemoteSearchResultToJson(RemoteSearchResult instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.productionYear case final value?) 'ProductionYear': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.indexNumberEnd case final value?) 'IndexNumberEnd': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.imageUrl case final value?) 'ImageUrl': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.overview case final value?) 'Overview': value, + if (instance.albumArtist?.toJson() case final value?) + 'AlbumArtist': value, + if (instance.artists?.map((e) => e.toJson()).toList() case final value?) + 'Artists': value, + }; RemoteSubtitleInfo _$RemoteSubtitleInfoFromJson(Map json) => RemoteSubtitleInfo( @@ -5894,34 +5004,28 @@ RemoteSubtitleInfo _$RemoteSubtitleInfoFromJson(Map json) => hearingImpaired: json['HearingImpaired'] as bool?, ); -Map _$RemoteSubtitleInfoToJson(RemoteSubtitleInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'ThreeLetterISOLanguageName', instance.threeLetterISOLanguageName); - writeNotNull('Id', instance.id); - writeNotNull('ProviderName', instance.providerName); - writeNotNull('Name', instance.name); - writeNotNull('Format', instance.format); - writeNotNull('Author', instance.author); - writeNotNull('Comment', instance.comment); - writeNotNull('DateCreated', instance.dateCreated?.toIso8601String()); - writeNotNull('CommunityRating', instance.communityRating); - writeNotNull('FrameRate', instance.frameRate); - writeNotNull('DownloadCount', instance.downloadCount); - writeNotNull('IsHashMatch', instance.isHashMatch); - writeNotNull('AiTranslated', instance.aiTranslated); - writeNotNull('MachineTranslated', instance.machineTranslated); - writeNotNull('Forced', instance.forced); - writeNotNull('HearingImpaired', instance.hearingImpaired); - return val; -} +Map _$RemoteSubtitleInfoToJson(RemoteSubtitleInfo instance) => + { + if (instance.threeLetterISOLanguageName case final value?) + 'ThreeLetterISOLanguageName': value, + if (instance.id case final value?) 'Id': value, + if (instance.providerName case final value?) 'ProviderName': value, + if (instance.name case final value?) 'Name': value, + if (instance.format case final value?) 'Format': value, + if (instance.author case final value?) 'Author': value, + if (instance.comment case final value?) 'Comment': value, + if (instance.dateCreated?.toIso8601String() case final value?) + 'DateCreated': value, + if (instance.communityRating case final value?) 'CommunityRating': value, + if (instance.frameRate case final value?) 'FrameRate': value, + if (instance.downloadCount case final value?) 'DownloadCount': value, + if (instance.isHashMatch case final value?) 'IsHashMatch': value, + if (instance.aiTranslated case final value?) 'AiTranslated': value, + if (instance.machineTranslated case final value?) + 'MachineTranslated': value, + if (instance.forced case final value?) 'Forced': value, + if (instance.hearingImpaired case final value?) 'HearingImpaired': value, + }; RemoveFromPlaylistRequestDto _$RemoveFromPlaylistRequestDtoFromJson( Map json) => @@ -5935,20 +5039,13 @@ RemoveFromPlaylistRequestDto _$RemoveFromPlaylistRequestDtoFromJson( ); Map _$RemoveFromPlaylistRequestDtoToJson( - RemoveFromPlaylistRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlaylistItemIds', instance.playlistItemIds); - writeNotNull('ClearPlaylist', instance.clearPlaylist); - writeNotNull('ClearPlayingItem', instance.clearPlayingItem); - return val; -} + RemoveFromPlaylistRequestDto instance) => + { + if (instance.playlistItemIds case final value?) 'PlaylistItemIds': value, + if (instance.clearPlaylist case final value?) 'ClearPlaylist': value, + if (instance.clearPlayingItem case final value?) + 'ClearPlayingItem': value, + }; RepositoryInfo _$RepositoryInfoFromJson(Map json) => RepositoryInfo( @@ -5957,20 +5054,12 @@ RepositoryInfo _$RepositoryInfoFromJson(Map json) => enabled: json['Enabled'] as bool?, ); -Map _$RepositoryInfoToJson(RepositoryInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Url', instance.url); - writeNotNull('Enabled', instance.enabled); - return val; -} +Map _$RepositoryInfoToJson(RepositoryInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.url case final value?) 'Url': value, + if (instance.enabled case final value?) 'Enabled': value, + }; RestartRequiredMessage _$RestartRequiredMessageFromJson( Map json) => @@ -5982,20 +5071,13 @@ RestartRequiredMessage _$RestartRequiredMessageFromJson( ); Map _$RestartRequiredMessageToJson( - RestartRequiredMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + RestartRequiredMessage instance) => + { + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ScheduledTaskEndedMessage _$ScheduledTaskEndedMessageFromJson( Map json) => @@ -6009,21 +5091,14 @@ ScheduledTaskEndedMessage _$ScheduledTaskEndedMessageFromJson( ); Map _$ScheduledTaskEndedMessageToJson( - ScheduledTaskEndedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ScheduledTaskEndedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ScheduledTasksInfoMessage _$ScheduledTasksInfoMessageFromJson( Map json) => @@ -6038,21 +5113,15 @@ ScheduledTasksInfoMessage _$ScheduledTasksInfoMessageFromJson( ); Map _$ScheduledTasksInfoMessageToJson( - ScheduledTasksInfoMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.map((e) => e.toJson()).toList()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ScheduledTasksInfoMessage instance) => + { + if (instance.data?.map((e) => e.toJson()).toList() case final value?) + 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ScheduledTasksInfoStartMessage _$ScheduledTasksInfoStartMessageFromJson( Map json) => @@ -6063,20 +5132,13 @@ ScheduledTasksInfoStartMessage _$ScheduledTasksInfoStartMessageFromJson( ); Map _$ScheduledTasksInfoStartMessageToJson( - ScheduledTasksInfoStartMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ScheduledTasksInfoStartMessage instance) => + { + if (instance.data case final value?) 'Data': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ScheduledTasksInfoStopMessage _$ScheduledTasksInfoStopMessageFromJson( Map json) => @@ -6086,19 +5148,12 @@ ScheduledTasksInfoStopMessage _$ScheduledTasksInfoStopMessageFromJson( ); Map _$ScheduledTasksInfoStopMessageToJson( - ScheduledTasksInfoStopMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ScheduledTasksInfoStopMessage instance) => + { + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SearchHint _$SearchHintFromJson(Map json) => SearchHint( itemId: json['ItemId'] as String?, @@ -6140,46 +5195,47 @@ SearchHint _$SearchHintFromJson(Map json) => SearchHint( (json['PrimaryImageAspectRatio'] as num?)?.toDouble(), ); -Map _$SearchHintToJson(SearchHint instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ItemId', instance.itemId); - writeNotNull('Id', instance.id); - writeNotNull('Name', instance.name); - writeNotNull('MatchedTerm', instance.matchedTerm); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ProductionYear', instance.productionYear); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PrimaryImageTag', instance.primaryImageTag); - writeNotNull('ThumbImageTag', instance.thumbImageTag); - writeNotNull('ThumbImageItemId', instance.thumbImageItemId); - writeNotNull('BackdropImageTag', instance.backdropImageTag); - writeNotNull('BackdropImageItemId', instance.backdropImageItemId); - writeNotNull('Type', baseItemKindNullableToJson(instance.type)); - writeNotNull('IsFolder', instance.isFolder); - writeNotNull('RunTimeTicks', instance.runTimeTicks); - writeNotNull('MediaType', mediaTypeNullableToJson(instance.mediaType)); - writeNotNull('StartDate', instance.startDate?.toIso8601String()); - writeNotNull('EndDate', instance.endDate?.toIso8601String()); - writeNotNull('Series', instance.series); - writeNotNull('Status', instance.status); - writeNotNull('Album', instance.album); - writeNotNull('AlbumId', instance.albumId); - writeNotNull('AlbumArtist', instance.albumArtist); - writeNotNull('Artists', instance.artists); - writeNotNull('SongCount', instance.songCount); - writeNotNull('EpisodeCount', instance.episodeCount); - writeNotNull('ChannelId', instance.channelId); - writeNotNull('ChannelName', instance.channelName); - writeNotNull('PrimaryImageAspectRatio', instance.primaryImageAspectRatio); - return val; -} +Map _$SearchHintToJson(SearchHint instance) => + { + if (instance.itemId case final value?) 'ItemId': value, + if (instance.id case final value?) 'Id': value, + if (instance.name case final value?) 'Name': value, + if (instance.matchedTerm case final value?) 'MatchedTerm': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.productionYear case final value?) 'ProductionYear': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.primaryImageTag case final value?) 'PrimaryImageTag': value, + if (instance.thumbImageTag case final value?) 'ThumbImageTag': value, + if (instance.thumbImageItemId case final value?) + 'ThumbImageItemId': value, + if (instance.backdropImageTag case final value?) + 'BackdropImageTag': value, + if (instance.backdropImageItemId case final value?) + 'BackdropImageItemId': value, + if (baseItemKindNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.isFolder case final value?) 'IsFolder': value, + if (instance.runTimeTicks case final value?) 'RunTimeTicks': value, + if (mediaTypeNullableToJson(instance.mediaType) case final value?) + 'MediaType': value, + if (instance.startDate?.toIso8601String() case final value?) + 'StartDate': value, + if (instance.endDate?.toIso8601String() case final value?) + 'EndDate': value, + if (instance.series case final value?) 'Series': value, + if (instance.status case final value?) 'Status': value, + if (instance.album case final value?) 'Album': value, + if (instance.albumId case final value?) 'AlbumId': value, + if (instance.albumArtist case final value?) 'AlbumArtist': value, + if (instance.artists case final value?) 'Artists': value, + if (instance.songCount case final value?) 'SongCount': value, + if (instance.episodeCount case final value?) 'EpisodeCount': value, + if (instance.channelId case final value?) 'ChannelId': value, + if (instance.channelName case final value?) 'ChannelName': value, + if (instance.primaryImageAspectRatio case final value?) + 'PrimaryImageAspectRatio': value, + }; SearchHintResult _$SearchHintResultFromJson(Map json) => SearchHintResult( @@ -6190,38 +5246,24 @@ SearchHintResult _$SearchHintResultFromJson(Map json) => totalRecordCount: (json['TotalRecordCount'] as num?)?.toInt(), ); -Map _$SearchHintResultToJson(SearchHintResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'SearchHints', instance.searchHints?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - return val; -} +Map _$SearchHintResultToJson(SearchHintResult instance) => + { + if (instance.searchHints?.map((e) => e.toJson()).toList() + case final value?) + 'SearchHints': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + }; SeekRequestDto _$SeekRequestDtoFromJson(Map json) => SeekRequestDto( positionTicks: (json['PositionTicks'] as num?)?.toInt(), ); -Map _$SeekRequestDtoToJson(SeekRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PositionTicks', instance.positionTicks); - return val; -} +Map _$SeekRequestDtoToJson(SeekRequestDto instance) => + { + if (instance.positionTicks case final value?) 'PositionTicks': value, + }; SendCommand _$SendCommandFromJson(Map json) => SendCommand( groupId: json['GroupId'] as String?, @@ -6235,23 +5277,17 @@ SendCommand _$SendCommandFromJson(Map json) => SendCommand( : DateTime.parse(json['EmittedAt'] as String), ); -Map _$SendCommandToJson(SendCommand instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('PlaylistItemId', instance.playlistItemId); - writeNotNull('When', instance.when?.toIso8601String()); - writeNotNull('PositionTicks', instance.positionTicks); - writeNotNull('Command', sendCommandTypeNullableToJson(instance.command)); - writeNotNull('EmittedAt', instance.emittedAt?.toIso8601String()); - return val; -} +Map _$SendCommandToJson(SendCommand instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + if (instance.when?.toIso8601String() case final value?) 'When': value, + if (instance.positionTicks case final value?) 'PositionTicks': value, + if (sendCommandTypeNullableToJson(instance.command) case final value?) + 'Command': value, + if (instance.emittedAt?.toIso8601String() case final value?) + 'EmittedAt': value, + }; SeriesInfo _$SeriesInfoFromJson(Map json) => SeriesInfo( name: json['Name'] as String?, @@ -6269,28 +5305,24 @@ SeriesInfo _$SeriesInfoFromJson(Map json) => SeriesInfo( isAutomated: json['IsAutomated'] as bool?, ); -Map _$SeriesInfoToJson(SeriesInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - return val; -} +Map _$SeriesInfoToJson(SeriesInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + }; SeriesInfoRemoteSearchQuery _$SeriesInfoRemoteSearchQueryFromJson( Map json) => @@ -6304,21 +5336,15 @@ SeriesInfoRemoteSearchQuery _$SeriesInfoRemoteSearchQueryFromJson( ); Map _$SeriesInfoRemoteSearchQueryToJson( - SeriesInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + SeriesInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; SeriesTimerCancelledMessage _$SeriesTimerCancelledMessageFromJson( Map json) => @@ -6332,21 +5358,14 @@ SeriesTimerCancelledMessage _$SeriesTimerCancelledMessageFromJson( ); Map _$SeriesTimerCancelledMessageToJson( - SeriesTimerCancelledMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + SeriesTimerCancelledMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SeriesTimerCreatedMessage _$SeriesTimerCreatedMessageFromJson( Map json) => @@ -6360,21 +5379,14 @@ SeriesTimerCreatedMessage _$SeriesTimerCreatedMessageFromJson( ); Map _$SeriesTimerCreatedMessageToJson( - SeriesTimerCreatedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + SeriesTimerCreatedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SeriesTimerInfoDto _$SeriesTimerInfoDtoFromJson(Map json) => SeriesTimerInfoDto( @@ -6423,52 +5435,63 @@ SeriesTimerInfoDto _$SeriesTimerInfoDtoFromJson(Map json) => parentPrimaryImageTag: json['ParentPrimaryImageTag'] as String?, ); -Map _$SeriesTimerInfoDtoToJson(SeriesTimerInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('Type', instance.type); - writeNotNull('ServerId', instance.serverId); - writeNotNull('ExternalId', instance.externalId); - writeNotNull('ChannelId', instance.channelId); - writeNotNull('ExternalChannelId', instance.externalChannelId); - writeNotNull('ChannelName', instance.channelName); - writeNotNull('ChannelPrimaryImageTag', instance.channelPrimaryImageTag); - writeNotNull('ProgramId', instance.programId); - writeNotNull('ExternalProgramId', instance.externalProgramId); - writeNotNull('Name', instance.name); - writeNotNull('Overview', instance.overview); - writeNotNull('StartDate', instance.startDate?.toIso8601String()); - writeNotNull('EndDate', instance.endDate?.toIso8601String()); - writeNotNull('ServiceName', instance.serviceName); - writeNotNull('Priority', instance.priority); - writeNotNull('PrePaddingSeconds', instance.prePaddingSeconds); - writeNotNull('PostPaddingSeconds', instance.postPaddingSeconds); - writeNotNull('IsPrePaddingRequired', instance.isPrePaddingRequired); - writeNotNull('ParentBackdropItemId', instance.parentBackdropItemId); - writeNotNull('ParentBackdropImageTags', instance.parentBackdropImageTags); - writeNotNull('IsPostPaddingRequired', instance.isPostPaddingRequired); - writeNotNull('KeepUntil', keepUntilNullableToJson(instance.keepUntil)); - writeNotNull('RecordAnyTime', instance.recordAnyTime); - writeNotNull('SkipEpisodesInLibrary', instance.skipEpisodesInLibrary); - writeNotNull('RecordAnyChannel', instance.recordAnyChannel); - writeNotNull('KeepUpTo', instance.keepUpTo); - writeNotNull('RecordNewOnly', instance.recordNewOnly); - val['Days'] = dayOfWeekListToJson(instance.days); - writeNotNull('DayPattern', dayPatternNullableToJson(instance.dayPattern)); - writeNotNull('ImageTags', instance.imageTags); - writeNotNull('ParentThumbItemId', instance.parentThumbItemId); - writeNotNull('ParentThumbImageTag', instance.parentThumbImageTag); - writeNotNull('ParentPrimaryImageItemId', instance.parentPrimaryImageItemId); - writeNotNull('ParentPrimaryImageTag', instance.parentPrimaryImageTag); - return val; -} +Map _$SeriesTimerInfoDtoToJson(SeriesTimerInfoDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.type case final value?) 'Type': value, + if (instance.serverId case final value?) 'ServerId': value, + if (instance.externalId case final value?) 'ExternalId': value, + if (instance.channelId case final value?) 'ChannelId': value, + if (instance.externalChannelId case final value?) + 'ExternalChannelId': value, + if (instance.channelName case final value?) 'ChannelName': value, + if (instance.channelPrimaryImageTag case final value?) + 'ChannelPrimaryImageTag': value, + if (instance.programId case final value?) 'ProgramId': value, + if (instance.externalProgramId case final value?) + 'ExternalProgramId': value, + if (instance.name case final value?) 'Name': value, + if (instance.overview case final value?) 'Overview': value, + if (instance.startDate?.toIso8601String() case final value?) + 'StartDate': value, + if (instance.endDate?.toIso8601String() case final value?) + 'EndDate': value, + if (instance.serviceName case final value?) 'ServiceName': value, + if (instance.priority case final value?) 'Priority': value, + if (instance.prePaddingSeconds case final value?) + 'PrePaddingSeconds': value, + if (instance.postPaddingSeconds case final value?) + 'PostPaddingSeconds': value, + if (instance.isPrePaddingRequired case final value?) + 'IsPrePaddingRequired': value, + if (instance.parentBackdropItemId case final value?) + 'ParentBackdropItemId': value, + if (instance.parentBackdropImageTags case final value?) + 'ParentBackdropImageTags': value, + if (instance.isPostPaddingRequired case final value?) + 'IsPostPaddingRequired': value, + if (keepUntilNullableToJson(instance.keepUntil) case final value?) + 'KeepUntil': value, + if (instance.recordAnyTime case final value?) 'RecordAnyTime': value, + if (instance.skipEpisodesInLibrary case final value?) + 'SkipEpisodesInLibrary': value, + if (instance.recordAnyChannel case final value?) + 'RecordAnyChannel': value, + if (instance.keepUpTo case final value?) 'KeepUpTo': value, + if (instance.recordNewOnly case final value?) 'RecordNewOnly': value, + 'Days': dayOfWeekListToJson(instance.days), + if (dayPatternNullableToJson(instance.dayPattern) case final value?) + 'DayPattern': value, + if (instance.imageTags case final value?) 'ImageTags': value, + if (instance.parentThumbItemId case final value?) + 'ParentThumbItemId': value, + if (instance.parentThumbImageTag case final value?) + 'ParentThumbImageTag': value, + if (instance.parentPrimaryImageItemId case final value?) + 'ParentPrimaryImageItemId': value, + if (instance.parentPrimaryImageTag case final value?) + 'ParentPrimaryImageTag': value, + }; SeriesTimerInfoDtoQueryResult _$SeriesTimerInfoDtoQueryResultFromJson( Map json) => @@ -6483,20 +5506,14 @@ SeriesTimerInfoDtoQueryResult _$SeriesTimerInfoDtoQueryResultFromJson( ); Map _$SeriesTimerInfoDtoQueryResultToJson( - SeriesTimerInfoDtoQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + SeriesTimerInfoDtoQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; ServerConfiguration _$ServerConfigurationFromJson(Map json) => ServerConfiguration( @@ -6608,88 +5625,114 @@ ServerConfiguration _$ServerConfigurationFromJson(Map json) => json['TrickplayOptions'] as Map), ); -Map _$ServerConfigurationToJson(ServerConfiguration instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('LogFileRetentionDays', instance.logFileRetentionDays); - writeNotNull('IsStartupWizardCompleted', instance.isStartupWizardCompleted); - writeNotNull('CachePath', instance.cachePath); - writeNotNull('PreviousVersion', instance.previousVersion); - writeNotNull('PreviousVersionStr', instance.previousVersionStr); - writeNotNull('EnableMetrics', instance.enableMetrics); - writeNotNull( - 'EnableNormalizedItemByNameIds', instance.enableNormalizedItemByNameIds); - writeNotNull('IsPortAuthorized', instance.isPortAuthorized); - writeNotNull('QuickConnectAvailable', instance.quickConnectAvailable); - writeNotNull( - 'EnableCaseSensitiveItemIds', instance.enableCaseSensitiveItemIds); - writeNotNull('DisableLiveTvChannelUserDataName', - instance.disableLiveTvChannelUserDataName); - writeNotNull('MetadataPath', instance.metadataPath); - writeNotNull('PreferredMetadataLanguage', instance.preferredMetadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('SortReplaceCharacters', instance.sortReplaceCharacters); - writeNotNull('SortRemoveCharacters', instance.sortRemoveCharacters); - writeNotNull('SortRemoveWords', instance.sortRemoveWords); - writeNotNull('MinResumePct', instance.minResumePct); - writeNotNull('MaxResumePct', instance.maxResumePct); - writeNotNull('MinResumeDurationSeconds', instance.minResumeDurationSeconds); - writeNotNull('MinAudiobookResume', instance.minAudiobookResume); - writeNotNull('MaxAudiobookResume', instance.maxAudiobookResume); - writeNotNull('InactiveSessionThreshold', instance.inactiveSessionThreshold); - writeNotNull('LibraryMonitorDelay', instance.libraryMonitorDelay); - writeNotNull('LibraryUpdateDuration', instance.libraryUpdateDuration); - writeNotNull('ImageSavingConvention', - imageSavingConventionNullableToJson(instance.imageSavingConvention)); - writeNotNull('MetadataOptions', - instance.metadataOptions?.map((e) => e.toJson()).toList()); - writeNotNull('SkipDeserializationForBasicTypes', - instance.skipDeserializationForBasicTypes); - writeNotNull('ServerName', instance.serverName); - writeNotNull('UICulture', instance.uICulture); - writeNotNull('SaveMetadataHidden', instance.saveMetadataHidden); - writeNotNull( - 'ContentTypes', instance.contentTypes?.map((e) => e.toJson()).toList()); - writeNotNull('RemoteClientBitrateLimit', instance.remoteClientBitrateLimit); - writeNotNull('EnableFolderView', instance.enableFolderView); - writeNotNull( - 'EnableGroupingIntoCollections', instance.enableGroupingIntoCollections); - writeNotNull( - 'DisplaySpecialsWithinSeasons', instance.displaySpecialsWithinSeasons); - writeNotNull('CodecsUsed', instance.codecsUsed); - writeNotNull('PluginRepositories', - instance.pluginRepositories?.map((e) => e.toJson()).toList()); - writeNotNull('EnableExternalContentInSuggestions', - instance.enableExternalContentInSuggestions); - writeNotNull('ImageExtractionTimeoutMs', instance.imageExtractionTimeoutMs); - writeNotNull('PathSubstitutions', - instance.pathSubstitutions?.map((e) => e.toJson()).toList()); - writeNotNull('EnableSlowResponseWarning', instance.enableSlowResponseWarning); - writeNotNull('SlowResponseThresholdMs', instance.slowResponseThresholdMs); - writeNotNull('CorsHosts', instance.corsHosts); - writeNotNull('ActivityLogRetentionDays', instance.activityLogRetentionDays); - writeNotNull( - 'LibraryScanFanoutConcurrency', instance.libraryScanFanoutConcurrency); - writeNotNull('LibraryMetadataRefreshConcurrency', - instance.libraryMetadataRefreshConcurrency); - writeNotNull('RemoveOldPlugins', instance.removeOldPlugins); - writeNotNull('AllowClientLogUpload', instance.allowClientLogUpload); - writeNotNull('DummyChapterDuration', instance.dummyChapterDuration); - writeNotNull('ChapterImageResolution', - imageResolutionNullableToJson(instance.chapterImageResolution)); - writeNotNull( - 'ParallelImageEncodingLimit', instance.parallelImageEncodingLimit); - writeNotNull('CastReceiverApplications', - instance.castReceiverApplications?.map((e) => e.toJson()).toList()); - writeNotNull('TrickplayOptions', instance.trickplayOptions?.toJson()); - return val; -} +Map _$ServerConfigurationToJson( + ServerConfiguration instance) => + { + if (instance.logFileRetentionDays case final value?) + 'LogFileRetentionDays': value, + if (instance.isStartupWizardCompleted case final value?) + 'IsStartupWizardCompleted': value, + if (instance.cachePath case final value?) 'CachePath': value, + if (instance.previousVersion case final value?) 'PreviousVersion': value, + if (instance.previousVersionStr case final value?) + 'PreviousVersionStr': value, + if (instance.enableMetrics case final value?) 'EnableMetrics': value, + if (instance.enableNormalizedItemByNameIds case final value?) + 'EnableNormalizedItemByNameIds': value, + if (instance.isPortAuthorized case final value?) + 'IsPortAuthorized': value, + if (instance.quickConnectAvailable case final value?) + 'QuickConnectAvailable': value, + if (instance.enableCaseSensitiveItemIds case final value?) + 'EnableCaseSensitiveItemIds': value, + if (instance.disableLiveTvChannelUserDataName case final value?) + 'DisableLiveTvChannelUserDataName': value, + if (instance.metadataPath case final value?) 'MetadataPath': value, + if (instance.preferredMetadataLanguage case final value?) + 'PreferredMetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.sortReplaceCharacters case final value?) + 'SortReplaceCharacters': value, + if (instance.sortRemoveCharacters case final value?) + 'SortRemoveCharacters': value, + if (instance.sortRemoveWords case final value?) 'SortRemoveWords': value, + if (instance.minResumePct case final value?) 'MinResumePct': value, + if (instance.maxResumePct case final value?) 'MaxResumePct': value, + if (instance.minResumeDurationSeconds case final value?) + 'MinResumeDurationSeconds': value, + if (instance.minAudiobookResume case final value?) + 'MinAudiobookResume': value, + if (instance.maxAudiobookResume case final value?) + 'MaxAudiobookResume': value, + if (instance.inactiveSessionThreshold case final value?) + 'InactiveSessionThreshold': value, + if (instance.libraryMonitorDelay case final value?) + 'LibraryMonitorDelay': value, + if (instance.libraryUpdateDuration case final value?) + 'LibraryUpdateDuration': value, + if (imageSavingConventionNullableToJson(instance.imageSavingConvention) + case final value?) + 'ImageSavingConvention': value, + if (instance.metadataOptions?.map((e) => e.toJson()).toList() + case final value?) + 'MetadataOptions': value, + if (instance.skipDeserializationForBasicTypes case final value?) + 'SkipDeserializationForBasicTypes': value, + if (instance.serverName case final value?) 'ServerName': value, + if (instance.uICulture case final value?) 'UICulture': value, + if (instance.saveMetadataHidden case final value?) + 'SaveMetadataHidden': value, + if (instance.contentTypes?.map((e) => e.toJson()).toList() + case final value?) + 'ContentTypes': value, + if (instance.remoteClientBitrateLimit case final value?) + 'RemoteClientBitrateLimit': value, + if (instance.enableFolderView case final value?) + 'EnableFolderView': value, + if (instance.enableGroupingIntoCollections case final value?) + 'EnableGroupingIntoCollections': value, + if (instance.displaySpecialsWithinSeasons case final value?) + 'DisplaySpecialsWithinSeasons': value, + if (instance.codecsUsed case final value?) 'CodecsUsed': value, + if (instance.pluginRepositories?.map((e) => e.toJson()).toList() + case final value?) + 'PluginRepositories': value, + if (instance.enableExternalContentInSuggestions case final value?) + 'EnableExternalContentInSuggestions': value, + if (instance.imageExtractionTimeoutMs case final value?) + 'ImageExtractionTimeoutMs': value, + if (instance.pathSubstitutions?.map((e) => e.toJson()).toList() + case final value?) + 'PathSubstitutions': value, + if (instance.enableSlowResponseWarning case final value?) + 'EnableSlowResponseWarning': value, + if (instance.slowResponseThresholdMs case final value?) + 'SlowResponseThresholdMs': value, + if (instance.corsHosts case final value?) 'CorsHosts': value, + if (instance.activityLogRetentionDays case final value?) + 'ActivityLogRetentionDays': value, + if (instance.libraryScanFanoutConcurrency case final value?) + 'LibraryScanFanoutConcurrency': value, + if (instance.libraryMetadataRefreshConcurrency case final value?) + 'LibraryMetadataRefreshConcurrency': value, + if (instance.removeOldPlugins case final value?) + 'RemoveOldPlugins': value, + if (instance.allowClientLogUpload case final value?) + 'AllowClientLogUpload': value, + if (instance.dummyChapterDuration case final value?) + 'DummyChapterDuration': value, + if (imageResolutionNullableToJson(instance.chapterImageResolution) + case final value?) + 'ChapterImageResolution': value, + if (instance.parallelImageEncodingLimit case final value?) + 'ParallelImageEncodingLimit': value, + if (instance.castReceiverApplications?.map((e) => e.toJson()).toList() + case final value?) + 'CastReceiverApplications': value, + if (instance.trickplayOptions?.toJson() case final value?) + 'TrickplayOptions': value, + }; ServerDiscoveryInfo _$ServerDiscoveryInfoFromJson(Map json) => ServerDiscoveryInfo( @@ -6699,21 +5742,14 @@ ServerDiscoveryInfo _$ServerDiscoveryInfoFromJson(Map json) => endpointAddress: json['EndpointAddress'] as String?, ); -Map _$ServerDiscoveryInfoToJson(ServerDiscoveryInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Address', instance.address); - writeNotNull('Id', instance.id); - writeNotNull('Name', instance.name); - writeNotNull('EndpointAddress', instance.endpointAddress); - return val; -} +Map _$ServerDiscoveryInfoToJson( + ServerDiscoveryInfo instance) => + { + if (instance.address case final value?) 'Address': value, + if (instance.id case final value?) 'Id': value, + if (instance.name case final value?) 'Name': value, + if (instance.endpointAddress case final value?) 'EndpointAddress': value, + }; ServerRestartingMessage _$ServerRestartingMessageFromJson( Map json) => @@ -6725,20 +5761,13 @@ ServerRestartingMessage _$ServerRestartingMessageFromJson( ); Map _$ServerRestartingMessageToJson( - ServerRestartingMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ServerRestartingMessage instance) => + { + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; ServerShuttingDownMessage _$ServerShuttingDownMessageFromJson( Map json) => @@ -6749,20 +5778,13 @@ ServerShuttingDownMessage _$ServerShuttingDownMessageFromJson( ); Map _$ServerShuttingDownMessageToJson( - ServerShuttingDownMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + ServerShuttingDownMessage instance) => + { + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SessionInfoDto _$SessionInfoDtoFromJson(Map json) => SessionInfoDto( @@ -6829,52 +5851,57 @@ SessionInfoDto _$SessionInfoDtoFromJson(Map json) => generalCommandTypeListFromJson(json['SupportedCommands'] as List?), ); -Map _$SessionInfoDtoToJson(SessionInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlayState', instance.playState?.toJson()); - writeNotNull('AdditionalUsers', - instance.additionalUsers?.map((e) => e.toJson()).toList()); - writeNotNull('Capabilities', instance.capabilities?.toJson()); - writeNotNull('RemoteEndPoint', instance.remoteEndPoint); - val['PlayableMediaTypes'] = mediaTypeListToJson(instance.playableMediaTypes); - writeNotNull('Id', instance.id); - writeNotNull('UserId', instance.userId); - writeNotNull('UserName', instance.userName); - writeNotNull('Client', instance.$Client); - writeNotNull( - 'LastActivityDate', instance.lastActivityDate?.toIso8601String()); - writeNotNull( - 'LastPlaybackCheckIn', instance.lastPlaybackCheckIn?.toIso8601String()); - writeNotNull('LastPausedDate', instance.lastPausedDate?.toIso8601String()); - writeNotNull('DeviceName', instance.deviceName); - writeNotNull('DeviceType', instance.deviceType); - writeNotNull('NowPlayingItem', instance.nowPlayingItem?.toJson()); - writeNotNull('NowViewingItem', instance.nowViewingItem?.toJson()); - writeNotNull('DeviceId', instance.deviceId); - writeNotNull('ApplicationVersion', instance.applicationVersion); - writeNotNull('TranscodingInfo', instance.transcodingInfo?.toJson()); - writeNotNull('IsActive', instance.isActive); - writeNotNull('SupportsMediaControl', instance.supportsMediaControl); - writeNotNull('SupportsRemoteControl', instance.supportsRemoteControl); - writeNotNull('NowPlayingQueue', - instance.nowPlayingQueue?.map((e) => e.toJson()).toList()); - writeNotNull('NowPlayingQueueFullItems', - instance.nowPlayingQueueFullItems?.map((e) => e.toJson()).toList()); - writeNotNull('HasCustomDeviceName', instance.hasCustomDeviceName); - writeNotNull('PlaylistItemId', instance.playlistItemId); - writeNotNull('ServerId', instance.serverId); - writeNotNull('UserPrimaryImageTag', instance.userPrimaryImageTag); - val['SupportedCommands'] = - generalCommandTypeListToJson(instance.supportedCommands); - return val; -} +Map _$SessionInfoDtoToJson(SessionInfoDto instance) => + { + if (instance.playState?.toJson() case final value?) 'PlayState': value, + if (instance.additionalUsers?.map((e) => e.toJson()).toList() + case final value?) + 'AdditionalUsers': value, + if (instance.capabilities?.toJson() case final value?) + 'Capabilities': value, + if (instance.remoteEndPoint case final value?) 'RemoteEndPoint': value, + 'PlayableMediaTypes': mediaTypeListToJson(instance.playableMediaTypes), + if (instance.id case final value?) 'Id': value, + if (instance.userId case final value?) 'UserId': value, + if (instance.userName case final value?) 'UserName': value, + if (instance.$Client case final value?) 'Client': value, + if (instance.lastActivityDate?.toIso8601String() case final value?) + 'LastActivityDate': value, + if (instance.lastPlaybackCheckIn?.toIso8601String() case final value?) + 'LastPlaybackCheckIn': value, + if (instance.lastPausedDate?.toIso8601String() case final value?) + 'LastPausedDate': value, + if (instance.deviceName case final value?) 'DeviceName': value, + if (instance.deviceType case final value?) 'DeviceType': value, + if (instance.nowPlayingItem?.toJson() case final value?) + 'NowPlayingItem': value, + if (instance.nowViewingItem?.toJson() case final value?) + 'NowViewingItem': value, + if (instance.deviceId case final value?) 'DeviceId': value, + if (instance.applicationVersion case final value?) + 'ApplicationVersion': value, + if (instance.transcodingInfo?.toJson() case final value?) + 'TranscodingInfo': value, + if (instance.isActive case final value?) 'IsActive': value, + if (instance.supportsMediaControl case final value?) + 'SupportsMediaControl': value, + if (instance.supportsRemoteControl case final value?) + 'SupportsRemoteControl': value, + if (instance.nowPlayingQueue?.map((e) => e.toJson()).toList() + case final value?) + 'NowPlayingQueue': value, + if (instance.nowPlayingQueueFullItems?.map((e) => e.toJson()).toList() + case final value?) + 'NowPlayingQueueFullItems': value, + if (instance.hasCustomDeviceName case final value?) + 'HasCustomDeviceName': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + if (instance.serverId case final value?) 'ServerId': value, + if (instance.userPrimaryImageTag case final value?) + 'UserPrimaryImageTag': value, + 'SupportedCommands': + generalCommandTypeListToJson(instance.supportedCommands), + }; SessionsMessage _$SessionsMessageFromJson(Map json) => SessionsMessage( @@ -6888,21 +5915,15 @@ SessionsMessage _$SessionsMessageFromJson(Map json) => json['MessageType']), ); -Map _$SessionsMessageToJson(SessionsMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.map((e) => e.toJson()).toList()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$SessionsMessageToJson(SessionsMessage instance) => + { + if (instance.data?.map((e) => e.toJson()).toList() case final value?) + 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SessionsStartMessage _$SessionsStartMessageFromJson( Map json) => @@ -6914,20 +5935,13 @@ SessionsStartMessage _$SessionsStartMessageFromJson( ); Map _$SessionsStartMessageToJson( - SessionsStartMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + SessionsStartMessage instance) => + { + if (instance.data case final value?) 'Data': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SessionsStopMessage _$SessionsStopMessageFromJson(Map json) => SessionsStopMessage( @@ -6936,19 +5950,13 @@ SessionsStopMessage _$SessionsStopMessageFromJson(Map json) => json['MessageType']), ); -Map _$SessionsStopMessageToJson(SessionsStopMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$SessionsStopMessageToJson( + SessionsStopMessage instance) => + { + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SessionUserInfo _$SessionUserInfoFromJson(Map json) => SessionUserInfo( @@ -6956,19 +5964,11 @@ SessionUserInfo _$SessionUserInfoFromJson(Map json) => userName: json['UserName'] as String?, ); -Map _$SessionUserInfoToJson(SessionUserInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UserId', instance.userId); - writeNotNull('UserName', instance.userName); - return val; -} +Map _$SessionUserInfoToJson(SessionUserInfo instance) => + { + if (instance.userId case final value?) 'UserId': value, + if (instance.userName case final value?) 'UserName': value, + }; SetChannelMappingDto _$SetChannelMappingDtoFromJson( Map json) => @@ -6993,18 +5993,10 @@ SetPlaylistItemRequestDto _$SetPlaylistItemRequestDtoFromJson( ); Map _$SetPlaylistItemRequestDtoToJson( - SetPlaylistItemRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} + SetPlaylistItemRequestDto instance) => + { + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; SetRepeatModeRequestDto _$SetRepeatModeRequestDtoFromJson( Map json) => @@ -7013,18 +6005,11 @@ SetRepeatModeRequestDto _$SetRepeatModeRequestDtoFromJson( ); Map _$SetRepeatModeRequestDtoToJson( - SetRepeatModeRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Mode', groupRepeatModeNullableToJson(instance.mode)); - return val; -} + SetRepeatModeRequestDto instance) => + { + if (groupRepeatModeNullableToJson(instance.mode) case final value?) + 'Mode': value, + }; SetShuffleModeRequestDto _$SetShuffleModeRequestDtoFromJson( Map json) => @@ -7033,18 +6018,11 @@ SetShuffleModeRequestDto _$SetShuffleModeRequestDtoFromJson( ); Map _$SetShuffleModeRequestDtoToJson( - SetShuffleModeRequestDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Mode', groupShuffleModeNullableToJson(instance.mode)); - return val; -} + SetShuffleModeRequestDto instance) => + { + if (groupShuffleModeNullableToJson(instance.mode) case final value?) + 'Mode': value, + }; SongInfo _$SongInfoFromJson(Map json) => SongInfo( name: json['Name'] as String?, @@ -7071,31 +6049,26 @@ SongInfo _$SongInfoFromJson(Map json) => SongInfo( [], ); -Map _$SongInfoToJson(SongInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - writeNotNull('AlbumArtists', instance.albumArtists); - writeNotNull('Album', instance.album); - writeNotNull('Artists', instance.artists); - return val; -} +Map _$SongInfoToJson(SongInfo instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + if (instance.albumArtists case final value?) 'AlbumArtists': value, + if (instance.album case final value?) 'Album': value, + if (instance.artists case final value?) 'Artists': value, + }; SpecialViewOptionDto _$SpecialViewOptionDtoFromJson( Map json) => @@ -7105,19 +6078,11 @@ SpecialViewOptionDto _$SpecialViewOptionDtoFromJson( ); Map _$SpecialViewOptionDtoToJson( - SpecialViewOptionDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Id', instance.id); - return val; -} + SpecialViewOptionDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.id case final value?) 'Id': value, + }; StartupConfigurationDto _$StartupConfigurationDtoFromJson( Map json) => @@ -7128,20 +6093,14 @@ StartupConfigurationDto _$StartupConfigurationDtoFromJson( ); Map _$StartupConfigurationDtoToJson( - StartupConfigurationDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UICulture', instance.uICulture); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('PreferredMetadataLanguage', instance.preferredMetadataLanguage); - return val; -} + StartupConfigurationDto instance) => + { + if (instance.uICulture case final value?) 'UICulture': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.preferredMetadataLanguage case final value?) + 'PreferredMetadataLanguage': value, + }; StartupRemoteAccessDto _$StartupRemoteAccessDtoFromJson( Map json) => @@ -7163,19 +6122,11 @@ StartupUserDto _$StartupUserDtoFromJson(Map json) => password: json['Password'] as String?, ); -Map _$StartupUserDtoToJson(StartupUserDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Password', instance.password); - return val; -} +Map _$StartupUserDtoToJson(StartupUserDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.password case final value?) 'Password': value, + }; StringGroupUpdate _$StringGroupUpdateFromJson(Map json) => StringGroupUpdate( @@ -7184,20 +6135,13 @@ StringGroupUpdate _$StringGroupUpdateFromJson(Map json) => data: json['Data'] as String?, ); -Map _$StringGroupUpdateToJson(StringGroupUpdate instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('GroupId', instance.groupId); - writeNotNull('Type', groupUpdateTypeNullableToJson(instance.type)); - writeNotNull('Data', instance.data); - return val; -} +Map _$StringGroupUpdateToJson(StringGroupUpdate instance) => + { + if (instance.groupId case final value?) 'GroupId': value, + if (groupUpdateTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.data case final value?) 'Data': value, + }; SubtitleOptions _$SubtitleOptionsFromJson(Map json) => SubtitleOptions( @@ -7216,27 +6160,27 @@ SubtitleOptions _$SubtitleOptionsFromJson(Map json) => requirePerfectMatch: json['RequirePerfectMatch'] as bool?, ); -Map _$SubtitleOptionsToJson(SubtitleOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SkipIfEmbeddedSubtitlesPresent', - instance.skipIfEmbeddedSubtitlesPresent); - writeNotNull('SkipIfAudioTrackMatches', instance.skipIfAudioTrackMatches); - writeNotNull('DownloadLanguages', instance.downloadLanguages); - writeNotNull('DownloadMovieSubtitles', instance.downloadMovieSubtitles); - writeNotNull('DownloadEpisodeSubtitles', instance.downloadEpisodeSubtitles); - writeNotNull('OpenSubtitlesUsername', instance.openSubtitlesUsername); - writeNotNull('OpenSubtitlesPasswordHash', instance.openSubtitlesPasswordHash); - writeNotNull('IsOpenSubtitleVipAccount', instance.isOpenSubtitleVipAccount); - writeNotNull('RequirePerfectMatch', instance.requirePerfectMatch); - return val; -} +Map _$SubtitleOptionsToJson(SubtitleOptions instance) => + { + if (instance.skipIfEmbeddedSubtitlesPresent case final value?) + 'SkipIfEmbeddedSubtitlesPresent': value, + if (instance.skipIfAudioTrackMatches case final value?) + 'SkipIfAudioTrackMatches': value, + if (instance.downloadLanguages case final value?) + 'DownloadLanguages': value, + if (instance.downloadMovieSubtitles case final value?) + 'DownloadMovieSubtitles': value, + if (instance.downloadEpisodeSubtitles case final value?) + 'DownloadEpisodeSubtitles': value, + if (instance.openSubtitlesUsername case final value?) + 'OpenSubtitlesUsername': value, + if (instance.openSubtitlesPasswordHash case final value?) + 'OpenSubtitlesPasswordHash': value, + if (instance.isOpenSubtitleVipAccount case final value?) + 'IsOpenSubtitleVipAccount': value, + if (instance.requirePerfectMatch case final value?) + 'RequirePerfectMatch': value, + }; SubtitleProfile _$SubtitleProfileFromJson(Map json) => SubtitleProfile( @@ -7247,22 +6191,16 @@ SubtitleProfile _$SubtitleProfileFromJson(Map json) => container: json['Container'] as String?, ); -Map _$SubtitleProfileToJson(SubtitleProfile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Format', instance.format); - writeNotNull('Method', subtitleDeliveryMethodNullableToJson(instance.method)); - writeNotNull('DidlMode', instance.didlMode); - writeNotNull('Language', instance.language); - writeNotNull('Container', instance.container); - return val; -} +Map _$SubtitleProfileToJson(SubtitleProfile instance) => + { + if (instance.format case final value?) 'Format': value, + if (subtitleDeliveryMethodNullableToJson(instance.method) + case final value?) + 'Method': value, + if (instance.didlMode case final value?) 'DidlMode': value, + if (instance.language case final value?) 'Language': value, + if (instance.container case final value?) 'Container': value, + }; SyncPlayCommandMessage _$SyncPlayCommandMessageFromJson( Map json) => @@ -7277,21 +6215,14 @@ SyncPlayCommandMessage _$SyncPlayCommandMessageFromJson( ); Map _$SyncPlayCommandMessageToJson( - SyncPlayCommandMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + SyncPlayCommandMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SyncPlayGroupUpdateCommandMessage _$SyncPlayGroupUpdateCommandMessageFromJson( Map json) => @@ -7305,21 +6236,14 @@ SyncPlayGroupUpdateCommandMessage _$SyncPlayGroupUpdateCommandMessageFromJson( ); Map _$SyncPlayGroupUpdateCommandMessageToJson( - SyncPlayGroupUpdateCommandMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + SyncPlayGroupUpdateCommandMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; SyncPlayQueueItem _$SyncPlayQueueItemFromJson(Map json) => SyncPlayQueueItem( @@ -7327,19 +6251,11 @@ SyncPlayQueueItem _$SyncPlayQueueItemFromJson(Map json) => playlistItemId: json['PlaylistItemId'] as String?, ); -Map _$SyncPlayQueueItemToJson(SyncPlayQueueItem instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ItemId', instance.itemId); - writeNotNull('PlaylistItemId', instance.playlistItemId); - return val; -} +Map _$SyncPlayQueueItemToJson(SyncPlayQueueItem instance) => + { + if (instance.itemId case final value?) 'ItemId': value, + if (instance.playlistItemId case final value?) 'PlaylistItemId': value, + }; SystemInfo _$SystemInfoFromJson(Map json) => SystemInfo( localAddress: json['LocalAddress'] as String?, @@ -7379,47 +6295,50 @@ SystemInfo _$SystemInfoFromJson(Map json) => SystemInfo( systemArchitecture: json['SystemArchitecture'] as String?, ); -Map _$SystemInfoToJson(SystemInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('LocalAddress', instance.localAddress); - writeNotNull('ServerName', instance.serverName); - writeNotNull('Version', instance.version); - writeNotNull('ProductName', instance.productName); - writeNotNull('OperatingSystem', instance.operatingSystem); - writeNotNull('Id', instance.id); - writeNotNull('StartupWizardCompleted', instance.startupWizardCompleted); - writeNotNull( - 'OperatingSystemDisplayName', instance.operatingSystemDisplayName); - writeNotNull('PackageName', instance.packageName); - writeNotNull('HasPendingRestart', instance.hasPendingRestart); - writeNotNull('IsShuttingDown', instance.isShuttingDown); - writeNotNull('SupportsLibraryMonitor', instance.supportsLibraryMonitor); - writeNotNull('WebSocketPortNumber', instance.webSocketPortNumber); - writeNotNull('CompletedInstallations', - instance.completedInstallations?.map((e) => e.toJson()).toList()); - writeNotNull('CanSelfRestart', instance.canSelfRestart); - writeNotNull('CanLaunchWebBrowser', instance.canLaunchWebBrowser); - writeNotNull('ProgramDataPath', instance.programDataPath); - writeNotNull('WebPath', instance.webPath); - writeNotNull('ItemsByNamePath', instance.itemsByNamePath); - writeNotNull('CachePath', instance.cachePath); - writeNotNull('LogPath', instance.logPath); - writeNotNull('InternalMetadataPath', instance.internalMetadataPath); - writeNotNull('TranscodingTempPath', instance.transcodingTempPath); - writeNotNull('CastReceiverApplications', - instance.castReceiverApplications?.map((e) => e.toJson()).toList()); - writeNotNull('HasUpdateAvailable', instance.hasUpdateAvailable); - writeNotNull('EncoderLocation', instance.encoderLocation); - writeNotNull('SystemArchitecture', instance.systemArchitecture); - return val; -} +Map _$SystemInfoToJson(SystemInfo instance) => + { + if (instance.localAddress case final value?) 'LocalAddress': value, + if (instance.serverName case final value?) 'ServerName': value, + if (instance.version case final value?) 'Version': value, + if (instance.productName case final value?) 'ProductName': value, + if (instance.operatingSystem case final value?) 'OperatingSystem': value, + if (instance.id case final value?) 'Id': value, + if (instance.startupWizardCompleted case final value?) + 'StartupWizardCompleted': value, + if (instance.operatingSystemDisplayName case final value?) + 'OperatingSystemDisplayName': value, + if (instance.packageName case final value?) 'PackageName': value, + if (instance.hasPendingRestart case final value?) + 'HasPendingRestart': value, + if (instance.isShuttingDown case final value?) 'IsShuttingDown': value, + if (instance.supportsLibraryMonitor case final value?) + 'SupportsLibraryMonitor': value, + if (instance.webSocketPortNumber case final value?) + 'WebSocketPortNumber': value, + if (instance.completedInstallations?.map((e) => e.toJson()).toList() + case final value?) + 'CompletedInstallations': value, + if (instance.canSelfRestart case final value?) 'CanSelfRestart': value, + if (instance.canLaunchWebBrowser case final value?) + 'CanLaunchWebBrowser': value, + if (instance.programDataPath case final value?) 'ProgramDataPath': value, + if (instance.webPath case final value?) 'WebPath': value, + if (instance.itemsByNamePath case final value?) 'ItemsByNamePath': value, + if (instance.cachePath case final value?) 'CachePath': value, + if (instance.logPath case final value?) 'LogPath': value, + if (instance.internalMetadataPath case final value?) + 'InternalMetadataPath': value, + if (instance.transcodingTempPath case final value?) + 'TranscodingTempPath': value, + if (instance.castReceiverApplications?.map((e) => e.toJson()).toList() + case final value?) + 'CastReceiverApplications': value, + if (instance.hasUpdateAvailable case final value?) + 'HasUpdateAvailable': value, + if (instance.encoderLocation case final value?) 'EncoderLocation': value, + if (instance.systemArchitecture case final value?) + 'SystemArchitecture': value, + }; TaskInfo _$TaskInfoFromJson(Map json) => TaskInfo( name: json['Name'] as String?, @@ -7441,27 +6360,22 @@ TaskInfo _$TaskInfoFromJson(Map json) => TaskInfo( key: json['Key'] as String?, ); -Map _$TaskInfoToJson(TaskInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('State', taskStateNullableToJson(instance.state)); - writeNotNull('CurrentProgressPercentage', instance.currentProgressPercentage); - writeNotNull('Id', instance.id); - writeNotNull('LastExecutionResult', instance.lastExecutionResult?.toJson()); - writeNotNull('Triggers', instance.triggers?.map((e) => e.toJson()).toList()); - writeNotNull('Description', instance.description); - writeNotNull('Category', instance.category); - writeNotNull('IsHidden', instance.isHidden); - writeNotNull('Key', instance.key); - return val; -} +Map _$TaskInfoToJson(TaskInfo instance) => { + if (instance.name case final value?) 'Name': value, + if (taskStateNullableToJson(instance.state) case final value?) + 'State': value, + if (instance.currentProgressPercentage case final value?) + 'CurrentProgressPercentage': value, + if (instance.id case final value?) 'Id': value, + if (instance.lastExecutionResult?.toJson() case final value?) + 'LastExecutionResult': value, + if (instance.triggers?.map((e) => e.toJson()).toList() case final value?) + 'Triggers': value, + if (instance.description case final value?) 'Description': value, + if (instance.category case final value?) 'Category': value, + if (instance.isHidden case final value?) 'IsHidden': value, + if (instance.key case final value?) 'Key': value, + }; TaskResult _$TaskResultFromJson(Map json) => TaskResult( startTimeUtc: json['StartTimeUtc'] == null @@ -7478,25 +6392,21 @@ TaskResult _$TaskResultFromJson(Map json) => TaskResult( longErrorMessage: json['LongErrorMessage'] as String?, ); -Map _$TaskResultToJson(TaskResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('StartTimeUtc', instance.startTimeUtc?.toIso8601String()); - writeNotNull('EndTimeUtc', instance.endTimeUtc?.toIso8601String()); - writeNotNull('Status', taskCompletionStatusNullableToJson(instance.status)); - writeNotNull('Name', instance.name); - writeNotNull('Key', instance.key); - writeNotNull('Id', instance.id); - writeNotNull('ErrorMessage', instance.errorMessage); - writeNotNull('LongErrorMessage', instance.longErrorMessage); - return val; -} +Map _$TaskResultToJson(TaskResult instance) => + { + if (instance.startTimeUtc?.toIso8601String() case final value?) + 'StartTimeUtc': value, + if (instance.endTimeUtc?.toIso8601String() case final value?) + 'EndTimeUtc': value, + if (taskCompletionStatusNullableToJson(instance.status) case final value?) + 'Status': value, + if (instance.name case final value?) 'Name': value, + if (instance.key case final value?) 'Key': value, + if (instance.id case final value?) 'Id': value, + if (instance.errorMessage case final value?) 'ErrorMessage': value, + if (instance.longErrorMessage case final value?) + 'LongErrorMessage': value, + }; TaskTriggerInfo _$TaskTriggerInfoFromJson(Map json) => TaskTriggerInfo( @@ -7507,22 +6417,15 @@ TaskTriggerInfo _$TaskTriggerInfoFromJson(Map json) => maxRuntimeTicks: (json['MaxRuntimeTicks'] as num?)?.toInt(), ); -Map _$TaskTriggerInfoToJson(TaskTriggerInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Type', instance.type); - writeNotNull('TimeOfDayTicks', instance.timeOfDayTicks); - writeNotNull('IntervalTicks', instance.intervalTicks); - writeNotNull('DayOfWeek', dayOfWeekNullableToJson(instance.dayOfWeek)); - writeNotNull('MaxRuntimeTicks', instance.maxRuntimeTicks); - return val; -} +Map _$TaskTriggerInfoToJson(TaskTriggerInfo instance) => + { + if (instance.type case final value?) 'Type': value, + if (instance.timeOfDayTicks case final value?) 'TimeOfDayTicks': value, + if (instance.intervalTicks case final value?) 'IntervalTicks': value, + if (dayOfWeekNullableToJson(instance.dayOfWeek) case final value?) + 'DayOfWeek': value, + if (instance.maxRuntimeTicks case final value?) 'MaxRuntimeTicks': value, + }; ThemeMediaResult _$ThemeMediaResultFromJson(Map json) => ThemeMediaResult( @@ -7535,21 +6438,15 @@ ThemeMediaResult _$ThemeMediaResultFromJson(Map json) => ownerId: json['OwnerId'] as String?, ); -Map _$ThemeMediaResultToJson(ThemeMediaResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - writeNotNull('OwnerId', instance.ownerId); - return val; -} +Map _$ThemeMediaResultToJson(ThemeMediaResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + if (instance.ownerId case final value?) 'OwnerId': value, + }; TimerCancelledMessage _$TimerCancelledMessageFromJson( Map json) => @@ -7564,21 +6461,14 @@ TimerCancelledMessage _$TimerCancelledMessageFromJson( ); Map _$TimerCancelledMessageToJson( - TimerCancelledMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + TimerCancelledMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; TimerCreatedMessage _$TimerCreatedMessageFromJson(Map json) => TimerCreatedMessage( @@ -7591,21 +6481,15 @@ TimerCreatedMessage _$TimerCreatedMessageFromJson(Map json) => json['MessageType']), ); -Map _$TimerCreatedMessageToJson(TimerCreatedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$TimerCreatedMessageToJson( + TimerCreatedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; TimerEventInfo _$TimerEventInfoFromJson(Map json) => TimerEventInfo( @@ -7613,19 +6497,11 @@ TimerEventInfo _$TimerEventInfoFromJson(Map json) => programId: json['ProgramId'] as String?, ); -Map _$TimerEventInfoToJson(TimerEventInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('ProgramId', instance.programId); - return val; -} +Map _$TimerEventInfoToJson(TimerEventInfo instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.programId case final value?) 'ProgramId': value, + }; TimerInfoDto _$TimerInfoDtoFromJson(Map json) => TimerInfoDto( id: json['Id'] as String?, @@ -7668,45 +6544,52 @@ TimerInfoDto _$TimerInfoDtoFromJson(Map json) => TimerInfoDto( : BaseItemDto.fromJson(json['ProgramInfo'] as Map), ); -Map _$TimerInfoDtoToJson(TimerInfoDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('Type', instance.type); - writeNotNull('ServerId', instance.serverId); - writeNotNull('ExternalId', instance.externalId); - writeNotNull('ChannelId', instance.channelId); - writeNotNull('ExternalChannelId', instance.externalChannelId); - writeNotNull('ChannelName', instance.channelName); - writeNotNull('ChannelPrimaryImageTag', instance.channelPrimaryImageTag); - writeNotNull('ProgramId', instance.programId); - writeNotNull('ExternalProgramId', instance.externalProgramId); - writeNotNull('Name', instance.name); - writeNotNull('Overview', instance.overview); - writeNotNull('StartDate', instance.startDate?.toIso8601String()); - writeNotNull('EndDate', instance.endDate?.toIso8601String()); - writeNotNull('ServiceName', instance.serviceName); - writeNotNull('Priority', instance.priority); - writeNotNull('PrePaddingSeconds', instance.prePaddingSeconds); - writeNotNull('PostPaddingSeconds', instance.postPaddingSeconds); - writeNotNull('IsPrePaddingRequired', instance.isPrePaddingRequired); - writeNotNull('ParentBackdropItemId', instance.parentBackdropItemId); - writeNotNull('ParentBackdropImageTags', instance.parentBackdropImageTags); - writeNotNull('IsPostPaddingRequired', instance.isPostPaddingRequired); - writeNotNull('KeepUntil', keepUntilNullableToJson(instance.keepUntil)); - writeNotNull('Status', recordingStatusNullableToJson(instance.status)); - writeNotNull('SeriesTimerId', instance.seriesTimerId); - writeNotNull('ExternalSeriesTimerId', instance.externalSeriesTimerId); - writeNotNull('RunTimeTicks', instance.runTimeTicks); - writeNotNull('ProgramInfo', instance.programInfo?.toJson()); - return val; -} +Map _$TimerInfoDtoToJson(TimerInfoDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.type case final value?) 'Type': value, + if (instance.serverId case final value?) 'ServerId': value, + if (instance.externalId case final value?) 'ExternalId': value, + if (instance.channelId case final value?) 'ChannelId': value, + if (instance.externalChannelId case final value?) + 'ExternalChannelId': value, + if (instance.channelName case final value?) 'ChannelName': value, + if (instance.channelPrimaryImageTag case final value?) + 'ChannelPrimaryImageTag': value, + if (instance.programId case final value?) 'ProgramId': value, + if (instance.externalProgramId case final value?) + 'ExternalProgramId': value, + if (instance.name case final value?) 'Name': value, + if (instance.overview case final value?) 'Overview': value, + if (instance.startDate?.toIso8601String() case final value?) + 'StartDate': value, + if (instance.endDate?.toIso8601String() case final value?) + 'EndDate': value, + if (instance.serviceName case final value?) 'ServiceName': value, + if (instance.priority case final value?) 'Priority': value, + if (instance.prePaddingSeconds case final value?) + 'PrePaddingSeconds': value, + if (instance.postPaddingSeconds case final value?) + 'PostPaddingSeconds': value, + if (instance.isPrePaddingRequired case final value?) + 'IsPrePaddingRequired': value, + if (instance.parentBackdropItemId case final value?) + 'ParentBackdropItemId': value, + if (instance.parentBackdropImageTags case final value?) + 'ParentBackdropImageTags': value, + if (instance.isPostPaddingRequired case final value?) + 'IsPostPaddingRequired': value, + if (keepUntilNullableToJson(instance.keepUntil) case final value?) + 'KeepUntil': value, + if (recordingStatusNullableToJson(instance.status) case final value?) + 'Status': value, + if (instance.seriesTimerId case final value?) 'SeriesTimerId': value, + if (instance.externalSeriesTimerId case final value?) + 'ExternalSeriesTimerId': value, + if (instance.runTimeTicks case final value?) 'RunTimeTicks': value, + if (instance.programInfo?.toJson() case final value?) + 'ProgramInfo': value, + }; TimerInfoDtoQueryResult _$TimerInfoDtoQueryResultFromJson( Map json) => @@ -7720,20 +6603,14 @@ TimerInfoDtoQueryResult _$TimerInfoDtoQueryResultFromJson( ); Map _$TimerInfoDtoQueryResultToJson( - TimerInfoDtoQueryResult instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Items', instance.items?.map((e) => e.toJson()).toList()); - writeNotNull('TotalRecordCount', instance.totalRecordCount); - writeNotNull('StartIndex', instance.startIndex); - return val; -} + TimerInfoDtoQueryResult instance) => + { + if (instance.items?.map((e) => e.toJson()).toList() case final value?) + 'Items': value, + if (instance.totalRecordCount case final value?) + 'TotalRecordCount': value, + if (instance.startIndex case final value?) 'StartIndex': value, + }; TrailerInfo _$TrailerInfoFromJson(Map json) => TrailerInfo( name: json['Name'] as String?, @@ -7751,28 +6628,24 @@ TrailerInfo _$TrailerInfoFromJson(Map json) => TrailerInfo( isAutomated: json['IsAutomated'] as bool?, ); -Map _$TrailerInfoToJson(TrailerInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('OriginalTitle', instance.originalTitle); - writeNotNull('Path', instance.path); - writeNotNull('MetadataLanguage', instance.metadataLanguage); - writeNotNull('MetadataCountryCode', instance.metadataCountryCode); - writeNotNull('ProviderIds', instance.providerIds); - writeNotNull('Year', instance.year); - writeNotNull('IndexNumber', instance.indexNumber); - writeNotNull('ParentIndexNumber', instance.parentIndexNumber); - writeNotNull('PremiereDate', instance.premiereDate?.toIso8601String()); - writeNotNull('IsAutomated', instance.isAutomated); - return val; -} +Map _$TrailerInfoToJson(TrailerInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.originalTitle case final value?) 'OriginalTitle': value, + if (instance.path case final value?) 'Path': value, + if (instance.metadataLanguage case final value?) + 'MetadataLanguage': value, + if (instance.metadataCountryCode case final value?) + 'MetadataCountryCode': value, + if (instance.providerIds case final value?) 'ProviderIds': value, + if (instance.year case final value?) 'Year': value, + if (instance.indexNumber case final value?) 'IndexNumber': value, + if (instance.parentIndexNumber case final value?) + 'ParentIndexNumber': value, + if (instance.premiereDate?.toIso8601String() case final value?) + 'PremiereDate': value, + if (instance.isAutomated case final value?) 'IsAutomated': value, + }; TrailerInfoRemoteSearchQuery _$TrailerInfoRemoteSearchQueryFromJson( Map json) => @@ -7786,21 +6659,15 @@ TrailerInfoRemoteSearchQuery _$TrailerInfoRemoteSearchQueryFromJson( ); Map _$TrailerInfoRemoteSearchQueryToJson( - TrailerInfoRemoteSearchQuery instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('SearchInfo', instance.searchInfo?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('SearchProviderName', instance.searchProviderName); - writeNotNull('IncludeDisabledProviders', instance.includeDisabledProviders); - return val; -} + TrailerInfoRemoteSearchQuery instance) => + { + if (instance.searchInfo?.toJson() case final value?) 'SearchInfo': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.searchProviderName case final value?) + 'SearchProviderName': value, + if (instance.includeDisabledProviders case final value?) + 'IncludeDisabledProviders': value, + }; TranscodingInfo _$TranscodingInfoFromJson(Map json) => TranscodingInfo( @@ -7821,34 +6688,26 @@ TranscodingInfo _$TranscodingInfoFromJson(Map json) => transcodeReasonListFromJson(json['TranscodeReasons'] as List?), ); -Map _$TranscodingInfoToJson(TranscodingInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('AudioCodec', instance.audioCodec); - writeNotNull('VideoCodec', instance.videoCodec); - writeNotNull('Container', instance.container); - writeNotNull('IsVideoDirect', instance.isVideoDirect); - writeNotNull('IsAudioDirect', instance.isAudioDirect); - writeNotNull('Bitrate', instance.bitrate); - writeNotNull('Framerate', instance.framerate); - writeNotNull('CompletionPercentage', instance.completionPercentage); - writeNotNull('Width', instance.width); - writeNotNull('Height', instance.height); - writeNotNull('AudioChannels', instance.audioChannels); - writeNotNull( - 'HardwareAccelerationType', - hardwareAccelerationTypeNullableToJson( - instance.hardwareAccelerationType)); - val['TranscodeReasons'] = - transcodeReasonListToJson(instance.transcodeReasons); - return val; -} +Map _$TranscodingInfoToJson(TranscodingInfo instance) => + { + if (instance.audioCodec case final value?) 'AudioCodec': value, + if (instance.videoCodec case final value?) 'VideoCodec': value, + if (instance.container case final value?) 'Container': value, + if (instance.isVideoDirect case final value?) 'IsVideoDirect': value, + if (instance.isAudioDirect case final value?) 'IsAudioDirect': value, + if (instance.bitrate case final value?) 'Bitrate': value, + if (instance.framerate case final value?) 'Framerate': value, + if (instance.completionPercentage case final value?) + 'CompletionPercentage': value, + if (instance.width case final value?) 'Width': value, + if (instance.height case final value?) 'Height': value, + if (instance.audioChannels case final value?) 'AudioChannels': value, + if (hardwareAccelerationTypeNullableToJson( + instance.hardwareAccelerationType) + case final value?) + 'HardwareAccelerationType': value, + 'TranscodeReasons': transcodeReasonListToJson(instance.transcodeReasons), + }; TranscodingProfile _$TranscodingProfileFromJson(Map json) => TranscodingProfile( @@ -7878,37 +6737,40 @@ TranscodingProfile _$TranscodingProfileFromJson(Map json) => enableAudioVbrEncoding: json['EnableAudioVbrEncoding'] as bool? ?? true, ); -Map _$TranscodingProfileToJson(TranscodingProfile instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Container', instance.container); - writeNotNull('Type', dlnaProfileTypeNullableToJson(instance.type)); - writeNotNull('VideoCodec', instance.videoCodec); - writeNotNull('AudioCodec', instance.audioCodec); - writeNotNull( - 'Protocol', mediaStreamProtocolNullableToJson(instance.protocol)); - writeNotNull('EstimateContentLength', instance.estimateContentLength); - writeNotNull('EnableMpegtsM2TsMode', instance.enableMpegtsM2TsMode); - writeNotNull('TranscodeSeekInfo', - transcodeSeekInfoNullableToJson(instance.transcodeSeekInfo)); - writeNotNull('CopyTimestamps', instance.copyTimestamps); - writeNotNull('Context', encodingContextNullableToJson(instance.context)); - writeNotNull('EnableSubtitlesInManifest', instance.enableSubtitlesInManifest); - writeNotNull('MaxAudioChannels', instance.maxAudioChannels); - writeNotNull('MinSegments', instance.minSegments); - writeNotNull('SegmentLength', instance.segmentLength); - writeNotNull('BreakOnNonKeyFrames', instance.breakOnNonKeyFrames); - writeNotNull( - 'Conditions', instance.conditions?.map((e) => e.toJson()).toList()); - writeNotNull('EnableAudioVbrEncoding', instance.enableAudioVbrEncoding); - return val; -} +Map _$TranscodingProfileToJson(TranscodingProfile instance) => + { + if (instance.container case final value?) 'Container': value, + if (dlnaProfileTypeNullableToJson(instance.type) case final value?) + 'Type': value, + if (instance.videoCodec case final value?) 'VideoCodec': value, + if (instance.audioCodec case final value?) 'AudioCodec': value, + if (mediaStreamProtocolNullableToJson(instance.protocol) + case final value?) + 'Protocol': value, + if (instance.estimateContentLength case final value?) + 'EstimateContentLength': value, + if (instance.enableMpegtsM2TsMode case final value?) + 'EnableMpegtsM2TsMode': value, + if (transcodeSeekInfoNullableToJson(instance.transcodeSeekInfo) + case final value?) + 'TranscodeSeekInfo': value, + if (instance.copyTimestamps case final value?) 'CopyTimestamps': value, + if (encodingContextNullableToJson(instance.context) case final value?) + 'Context': value, + if (instance.enableSubtitlesInManifest case final value?) + 'EnableSubtitlesInManifest': value, + if (instance.maxAudioChannels case final value?) + 'MaxAudioChannels': value, + if (instance.minSegments case final value?) 'MinSegments': value, + if (instance.segmentLength case final value?) 'SegmentLength': value, + if (instance.breakOnNonKeyFrames case final value?) + 'BreakOnNonKeyFrames': value, + if (instance.conditions?.map((e) => e.toJson()).toList() + case final value?) + 'Conditions': value, + if (instance.enableAudioVbrEncoding case final value?) + 'EnableAudioVbrEncoding': value, + }; TrickplayInfo _$TrickplayInfoFromJson(Map json) => TrickplayInfo( @@ -7921,24 +6783,16 @@ TrickplayInfo _$TrickplayInfoFromJson(Map json) => bandwidth: (json['Bandwidth'] as num?)?.toInt(), ); -Map _$TrickplayInfoToJson(TrickplayInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Width', instance.width); - writeNotNull('Height', instance.height); - writeNotNull('TileWidth', instance.tileWidth); - writeNotNull('TileHeight', instance.tileHeight); - writeNotNull('ThumbnailCount', instance.thumbnailCount); - writeNotNull('Interval', instance.interval); - writeNotNull('Bandwidth', instance.bandwidth); - return val; -} +Map _$TrickplayInfoToJson(TrickplayInfo instance) => + { + if (instance.width case final value?) 'Width': value, + if (instance.height case final value?) 'Height': value, + if (instance.tileWidth case final value?) 'TileWidth': value, + if (instance.tileHeight case final value?) 'TileHeight': value, + if (instance.thumbnailCount case final value?) 'ThumbnailCount': value, + if (instance.interval case final value?) 'Interval': value, + if (instance.bandwidth case final value?) 'Bandwidth': value, + }; TrickplayOptions _$TrickplayOptionsFromJson(Map json) => TrickplayOptions( @@ -7961,32 +6815,29 @@ TrickplayOptions _$TrickplayOptionsFromJson(Map json) => processThreads: (json['ProcessThreads'] as num?)?.toInt(), ); -Map _$TrickplayOptionsToJson(TrickplayOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('EnableHwAcceleration', instance.enableHwAcceleration); - writeNotNull('EnableHwEncoding', instance.enableHwEncoding); - writeNotNull( - 'EnableKeyFrameOnlyExtraction', instance.enableKeyFrameOnlyExtraction); - writeNotNull('ScanBehavior', - trickplayScanBehaviorNullableToJson(instance.scanBehavior)); - writeNotNull('ProcessPriority', - processPriorityClassNullableToJson(instance.processPriority)); - writeNotNull('Interval', instance.interval); - writeNotNull('WidthResolutions', instance.widthResolutions); - writeNotNull('TileWidth', instance.tileWidth); - writeNotNull('TileHeight', instance.tileHeight); - writeNotNull('Qscale', instance.qscale); - writeNotNull('JpegQuality', instance.jpegQuality); - writeNotNull('ProcessThreads', instance.processThreads); - return val; -} +Map _$TrickplayOptionsToJson(TrickplayOptions instance) => + { + if (instance.enableHwAcceleration case final value?) + 'EnableHwAcceleration': value, + if (instance.enableHwEncoding case final value?) + 'EnableHwEncoding': value, + if (instance.enableKeyFrameOnlyExtraction case final value?) + 'EnableKeyFrameOnlyExtraction': value, + if (trickplayScanBehaviorNullableToJson(instance.scanBehavior) + case final value?) + 'ScanBehavior': value, + if (processPriorityClassNullableToJson(instance.processPriority) + case final value?) + 'ProcessPriority': value, + if (instance.interval case final value?) 'Interval': value, + if (instance.widthResolutions case final value?) + 'WidthResolutions': value, + if (instance.tileWidth case final value?) 'TileWidth': value, + if (instance.tileHeight case final value?) 'TileHeight': value, + if (instance.qscale case final value?) 'Qscale': value, + if (instance.jpegQuality case final value?) 'JpegQuality': value, + if (instance.processThreads case final value?) 'ProcessThreads': value, + }; TunerChannelMapping _$TunerChannelMappingFromJson(Map json) => TunerChannelMapping( @@ -7996,21 +6847,16 @@ TunerChannelMapping _$TunerChannelMappingFromJson(Map json) => id: json['Id'] as String?, ); -Map _$TunerChannelMappingToJson(TunerChannelMapping instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('ProviderChannelName', instance.providerChannelName); - writeNotNull('ProviderChannelId', instance.providerChannelId); - writeNotNull('Id', instance.id); - return val; -} +Map _$TunerChannelMappingToJson( + TunerChannelMapping instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.providerChannelName case final value?) + 'ProviderChannelName': value, + if (instance.providerChannelId case final value?) + 'ProviderChannelId': value, + if (instance.id case final value?) 'Id': value, + }; TunerHostInfo _$TunerHostInfoFromJson(Map json) => TunerHostInfo( @@ -8033,34 +6879,30 @@ TunerHostInfo _$TunerHostInfoFromJson(Map json) => ignoreDts: json['IgnoreDts'] as bool?, ); -Map _$TunerHostInfoToJson(TunerHostInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('Url', instance.url); - writeNotNull('Type', instance.type); - writeNotNull('DeviceId', instance.deviceId); - writeNotNull('FriendlyName', instance.friendlyName); - writeNotNull('ImportFavoritesOnly', instance.importFavoritesOnly); - writeNotNull('AllowHWTranscoding', instance.allowHWTranscoding); - writeNotNull( - 'AllowFmp4TranscodingContainer', instance.allowFmp4TranscodingContainer); - writeNotNull('AllowStreamSharing', instance.allowStreamSharing); - writeNotNull( - 'FallbackMaxStreamingBitrate', instance.fallbackMaxStreamingBitrate); - writeNotNull('EnableStreamLooping', instance.enableStreamLooping); - writeNotNull('Source', instance.source); - writeNotNull('TunerCount', instance.tunerCount); - writeNotNull('UserAgent', instance.userAgent); - writeNotNull('IgnoreDts', instance.ignoreDts); - return val; -} +Map _$TunerHostInfoToJson(TunerHostInfo instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.url case final value?) 'Url': value, + if (instance.type case final value?) 'Type': value, + if (instance.deviceId case final value?) 'DeviceId': value, + if (instance.friendlyName case final value?) 'FriendlyName': value, + if (instance.importFavoritesOnly case final value?) + 'ImportFavoritesOnly': value, + if (instance.allowHWTranscoding case final value?) + 'AllowHWTranscoding': value, + if (instance.allowFmp4TranscodingContainer case final value?) + 'AllowFmp4TranscodingContainer': value, + if (instance.allowStreamSharing case final value?) + 'AllowStreamSharing': value, + if (instance.fallbackMaxStreamingBitrate case final value?) + 'FallbackMaxStreamingBitrate': value, + if (instance.enableStreamLooping case final value?) + 'EnableStreamLooping': value, + if (instance.source case final value?) 'Source': value, + if (instance.tunerCount case final value?) 'TunerCount': value, + if (instance.userAgent case final value?) 'UserAgent': value, + if (instance.ignoreDts case final value?) 'IgnoreDts': value, + }; TypeOptions _$TypeOptionsFromJson(Map json) => TypeOptions( type: json['Type'] as String?, @@ -8086,24 +6928,20 @@ TypeOptions _$TypeOptionsFromJson(Map json) => TypeOptions( [], ); -Map _$TypeOptionsToJson(TypeOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Type', instance.type); - writeNotNull('MetadataFetchers', instance.metadataFetchers); - writeNotNull('MetadataFetcherOrder', instance.metadataFetcherOrder); - writeNotNull('ImageFetchers', instance.imageFetchers); - writeNotNull('ImageFetcherOrder', instance.imageFetcherOrder); - writeNotNull( - 'ImageOptions', instance.imageOptions?.map((e) => e.toJson()).toList()); - return val; -} +Map _$TypeOptionsToJson(TypeOptions instance) => + { + if (instance.type case final value?) 'Type': value, + if (instance.metadataFetchers case final value?) + 'MetadataFetchers': value, + if (instance.metadataFetcherOrder case final value?) + 'MetadataFetcherOrder': value, + if (instance.imageFetchers case final value?) 'ImageFetchers': value, + if (instance.imageFetcherOrder case final value?) + 'ImageFetcherOrder': value, + if (instance.imageOptions?.map((e) => e.toJson()).toList() + case final value?) + 'ImageOptions': value, + }; UpdateLibraryOptionsDto _$UpdateLibraryOptionsDtoFromJson( Map json) => @@ -8116,19 +6954,12 @@ UpdateLibraryOptionsDto _$UpdateLibraryOptionsDtoFromJson( ); Map _$UpdateLibraryOptionsDtoToJson( - UpdateLibraryOptionsDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Id', instance.id); - writeNotNull('LibraryOptions', instance.libraryOptions?.toJson()); - return val; -} + UpdateLibraryOptionsDto instance) => + { + if (instance.id case final value?) 'Id': value, + if (instance.libraryOptions?.toJson() case final value?) + 'LibraryOptions': value, + }; UpdateMediaPathRequestDto _$UpdateMediaPathRequestDtoFromJson( Map json) => @@ -8158,21 +6989,14 @@ UpdatePlaylistDto _$UpdatePlaylistDtoFromJson(Map json) => isPublic: json['IsPublic'] as bool?, ); -Map _$UpdatePlaylistDtoToJson(UpdatePlaylistDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Ids', instance.ids); - writeNotNull('Users', instance.users?.map((e) => e.toJson()).toList()); - writeNotNull('IsPublic', instance.isPublic); - return val; -} +Map _$UpdatePlaylistDtoToJson(UpdatePlaylistDto instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.ids case final value?) 'Ids': value, + if (instance.users?.map((e) => e.toJson()).toList() case final value?) + 'Users': value, + if (instance.isPublic case final value?) 'IsPublic': value, + }; UpdatePlaylistUserDto _$UpdatePlaylistUserDtoFromJson( Map json) => @@ -8181,18 +7005,10 @@ UpdatePlaylistUserDto _$UpdatePlaylistUserDtoFromJson( ); Map _$UpdatePlaylistUserDtoToJson( - UpdatePlaylistUserDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('CanEdit', instance.canEdit); - return val; -} + UpdatePlaylistUserDto instance) => + { + if (instance.canEdit case final value?) 'CanEdit': value, + }; UpdateUserItemDataDto _$UpdateUserItemDataDtoFromJson( Map json) => @@ -8213,28 +7029,24 @@ UpdateUserItemDataDto _$UpdateUserItemDataDtoFromJson( ); Map _$UpdateUserItemDataDtoToJson( - UpdateUserItemDataDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Rating', instance.rating); - writeNotNull('PlayedPercentage', instance.playedPercentage); - writeNotNull('UnplayedItemCount', instance.unplayedItemCount); - writeNotNull('PlaybackPositionTicks', instance.playbackPositionTicks); - writeNotNull('PlayCount', instance.playCount); - writeNotNull('IsFavorite', instance.isFavorite); - writeNotNull('Likes', instance.likes); - writeNotNull('LastPlayedDate', instance.lastPlayedDate?.toIso8601String()); - writeNotNull('Played', instance.played); - writeNotNull('Key', instance.key); - writeNotNull('ItemId', instance.itemId); - return val; -} + UpdateUserItemDataDto instance) => + { + if (instance.rating case final value?) 'Rating': value, + if (instance.playedPercentage case final value?) + 'PlayedPercentage': value, + if (instance.unplayedItemCount case final value?) + 'UnplayedItemCount': value, + if (instance.playbackPositionTicks case final value?) + 'PlaybackPositionTicks': value, + if (instance.playCount case final value?) 'PlayCount': value, + if (instance.isFavorite case final value?) 'IsFavorite': value, + if (instance.likes case final value?) 'Likes': value, + if (instance.lastPlayedDate?.toIso8601String() case final value?) + 'LastPlayedDate': value, + if (instance.played case final value?) 'Played': value, + if (instance.key case final value?) 'Key': value, + if (instance.itemId case final value?) 'ItemId': value, + }; UpdateUserPassword _$UpdateUserPasswordFromJson(Map json) => UpdateUserPassword( @@ -8244,21 +7056,13 @@ UpdateUserPassword _$UpdateUserPasswordFromJson(Map json) => resetPassword: json['ResetPassword'] as bool?, ); -Map _$UpdateUserPasswordToJson(UpdateUserPassword instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('CurrentPassword', instance.currentPassword); - writeNotNull('CurrentPw', instance.currentPw); - writeNotNull('NewPw', instance.newPw); - writeNotNull('ResetPassword', instance.resetPassword); - return val; -} +Map _$UpdateUserPasswordToJson(UpdateUserPassword instance) => + { + if (instance.currentPassword case final value?) 'CurrentPassword': value, + if (instance.currentPw case final value?) 'CurrentPw': value, + if (instance.newPw case final value?) 'NewPw': value, + if (instance.resetPassword case final value?) 'ResetPassword': value, + }; UploadSubtitleDto _$UploadSubtitleDtoFromJson(Map json) => UploadSubtitleDto( @@ -8310,36 +7114,38 @@ UserConfiguration _$UserConfigurationFromJson(Map json) => castReceiverId: json['CastReceiverId'] as String?, ); -Map _$UserConfigurationToJson(UserConfiguration instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('AudioLanguagePreference', instance.audioLanguagePreference); - writeNotNull('PlayDefaultAudioTrack', instance.playDefaultAudioTrack); - writeNotNull( - 'SubtitleLanguagePreference', instance.subtitleLanguagePreference); - writeNotNull('DisplayMissingEpisodes', instance.displayMissingEpisodes); - writeNotNull('GroupedFolders', instance.groupedFolders); - writeNotNull('SubtitleMode', - subtitlePlaybackModeNullableToJson(instance.subtitleMode)); - writeNotNull('DisplayCollectionsView', instance.displayCollectionsView); - writeNotNull('EnableLocalPassword', instance.enableLocalPassword); - writeNotNull('OrderedViews', instance.orderedViews); - writeNotNull('LatestItemsExcludes', instance.latestItemsExcludes); - writeNotNull('MyMediaExcludes', instance.myMediaExcludes); - writeNotNull('HidePlayedInLatest', instance.hidePlayedInLatest); - writeNotNull('RememberAudioSelections', instance.rememberAudioSelections); - writeNotNull( - 'RememberSubtitleSelections', instance.rememberSubtitleSelections); - writeNotNull('EnableNextEpisodeAutoPlay', instance.enableNextEpisodeAutoPlay); - writeNotNull('CastReceiverId', instance.castReceiverId); - return val; -} +Map _$UserConfigurationToJson(UserConfiguration instance) => + { + if (instance.audioLanguagePreference case final value?) + 'AudioLanguagePreference': value, + if (instance.playDefaultAudioTrack case final value?) + 'PlayDefaultAudioTrack': value, + if (instance.subtitleLanguagePreference case final value?) + 'SubtitleLanguagePreference': value, + if (instance.displayMissingEpisodes case final value?) + 'DisplayMissingEpisodes': value, + if (instance.groupedFolders case final value?) 'GroupedFolders': value, + if (subtitlePlaybackModeNullableToJson(instance.subtitleMode) + case final value?) + 'SubtitleMode': value, + if (instance.displayCollectionsView case final value?) + 'DisplayCollectionsView': value, + if (instance.enableLocalPassword case final value?) + 'EnableLocalPassword': value, + if (instance.orderedViews case final value?) 'OrderedViews': value, + if (instance.latestItemsExcludes case final value?) + 'LatestItemsExcludes': value, + if (instance.myMediaExcludes case final value?) 'MyMediaExcludes': value, + if (instance.hidePlayedInLatest case final value?) + 'HidePlayedInLatest': value, + if (instance.rememberAudioSelections case final value?) + 'RememberAudioSelections': value, + if (instance.rememberSubtitleSelections case final value?) + 'RememberSubtitleSelections': value, + if (instance.enableNextEpisodeAutoPlay case final value?) + 'EnableNextEpisodeAutoPlay': value, + if (instance.castReceiverId case final value?) 'CastReceiverId': value, + }; UserDataChangedMessage _$UserDataChangedMessageFromJson( Map json) => @@ -8354,21 +7160,14 @@ UserDataChangedMessage _$UserDataChangedMessageFromJson( ); Map _$UserDataChangedMessageToJson( - UserDataChangedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} + UserDataChangedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; UserDataChangeInfo _$UserDataChangeInfoFromJson(Map json) => UserDataChangeInfo( @@ -8379,20 +7178,13 @@ UserDataChangeInfo _$UserDataChangeInfoFromJson(Map json) => [], ); -Map _$UserDataChangeInfoToJson(UserDataChangeInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UserId', instance.userId); - writeNotNull( - 'UserDataList', instance.userDataList?.map((e) => e.toJson()).toList()); - return val; -} +Map _$UserDataChangeInfoToJson(UserDataChangeInfo instance) => + { + if (instance.userId case final value?) 'UserId': value, + if (instance.userDataList?.map((e) => e.toJson()).toList() + case final value?) + 'UserDataList': value, + }; UserDeletedMessage _$UserDeletedMessageFromJson(Map json) => UserDeletedMessage( @@ -8403,21 +7195,14 @@ UserDeletedMessage _$UserDeletedMessageFromJson(Map json) => json['MessageType']), ); -Map _$UserDeletedMessageToJson(UserDeletedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$UserDeletedMessageToJson(UserDeletedMessage instance) => + { + if (instance.data case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; UserDto _$UserDtoFromJson(Map json) => UserDto( name: json['Name'] as String?, @@ -8446,32 +7231,28 @@ UserDto _$UserDtoFromJson(Map json) => UserDto( (json['PrimaryImageAspectRatio'] as num?)?.toDouble(), ); -Map _$UserDtoToJson(UserDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('ServerId', instance.serverId); - writeNotNull('ServerName', instance.serverName); - writeNotNull('Id', instance.id); - writeNotNull('PrimaryImageTag', instance.primaryImageTag); - writeNotNull('HasPassword', instance.hasPassword); - writeNotNull('HasConfiguredPassword', instance.hasConfiguredPassword); - writeNotNull('HasConfiguredEasyPassword', instance.hasConfiguredEasyPassword); - writeNotNull('EnableAutoLogin', instance.enableAutoLogin); - writeNotNull('LastLoginDate', instance.lastLoginDate?.toIso8601String()); - writeNotNull( - 'LastActivityDate', instance.lastActivityDate?.toIso8601String()); - writeNotNull('Configuration', instance.configuration?.toJson()); - writeNotNull('Policy', instance.policy?.toJson()); - writeNotNull('PrimaryImageAspectRatio', instance.primaryImageAspectRatio); - return val; -} +Map _$UserDtoToJson(UserDto instance) => { + if (instance.name case final value?) 'Name': value, + if (instance.serverId case final value?) 'ServerId': value, + if (instance.serverName case final value?) 'ServerName': value, + if (instance.id case final value?) 'Id': value, + if (instance.primaryImageTag case final value?) 'PrimaryImageTag': value, + if (instance.hasPassword case final value?) 'HasPassword': value, + if (instance.hasConfiguredPassword case final value?) + 'HasConfiguredPassword': value, + if (instance.hasConfiguredEasyPassword case final value?) + 'HasConfiguredEasyPassword': value, + if (instance.enableAutoLogin case final value?) 'EnableAutoLogin': value, + if (instance.lastLoginDate?.toIso8601String() case final value?) + 'LastLoginDate': value, + if (instance.lastActivityDate?.toIso8601String() case final value?) + 'LastActivityDate': value, + if (instance.configuration?.toJson() case final value?) + 'Configuration': value, + if (instance.policy?.toJson() case final value?) 'Policy': value, + if (instance.primaryImageAspectRatio case final value?) + 'PrimaryImageAspectRatio': value, + }; UserItemDataDto _$UserItemDataDtoFromJson(Map json) => UserItemDataDto( @@ -8490,28 +7271,24 @@ UserItemDataDto _$UserItemDataDtoFromJson(Map json) => itemId: json['ItemId'] as String?, ); -Map _$UserItemDataDtoToJson(UserItemDataDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Rating', instance.rating); - writeNotNull('PlayedPercentage', instance.playedPercentage); - writeNotNull('UnplayedItemCount', instance.unplayedItemCount); - writeNotNull('PlaybackPositionTicks', instance.playbackPositionTicks); - writeNotNull('PlayCount', instance.playCount); - writeNotNull('IsFavorite', instance.isFavorite); - writeNotNull('Likes', instance.likes); - writeNotNull('LastPlayedDate', instance.lastPlayedDate?.toIso8601String()); - writeNotNull('Played', instance.played); - writeNotNull('Key', instance.key); - writeNotNull('ItemId', instance.itemId); - return val; -} +Map _$UserItemDataDtoToJson(UserItemDataDto instance) => + { + if (instance.rating case final value?) 'Rating': value, + if (instance.playedPercentage case final value?) + 'PlayedPercentage': value, + if (instance.unplayedItemCount case final value?) + 'UnplayedItemCount': value, + if (instance.playbackPositionTicks case final value?) + 'PlaybackPositionTicks': value, + if (instance.playCount case final value?) 'PlayCount': value, + if (instance.isFavorite case final value?) 'IsFavorite': value, + if (instance.likes case final value?) 'Likes': value, + if (instance.lastPlayedDate?.toIso8601String() case final value?) + 'LastPlayedDate': value, + if (instance.played case final value?) 'Played': value, + if (instance.key case final value?) 'Key': value, + if (instance.itemId case final value?) 'ItemId': value, + }; UserPolicy _$UserPolicyFromJson(Map json) => UserPolicy( isAdministrator: json['IsAdministrator'] as bool?, @@ -8598,70 +7375,85 @@ UserPolicy _$UserPolicyFromJson(Map json) => UserPolicy( syncPlayUserAccessTypeNullableFromJson(json['SyncPlayAccess']), ); -Map _$UserPolicyToJson(UserPolicy instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('IsAdministrator', instance.isAdministrator); - writeNotNull('IsHidden', instance.isHidden); - writeNotNull( - 'EnableCollectionManagement', instance.enableCollectionManagement); - writeNotNull('EnableSubtitleManagement', instance.enableSubtitleManagement); - writeNotNull('EnableLyricManagement', instance.enableLyricManagement); - writeNotNull('IsDisabled', instance.isDisabled); - writeNotNull('MaxParentalRating', instance.maxParentalRating); - writeNotNull('BlockedTags', instance.blockedTags); - writeNotNull('AllowedTags', instance.allowedTags); - writeNotNull( - 'EnableUserPreferenceAccess', instance.enableUserPreferenceAccess); - writeNotNull('AccessSchedules', - instance.accessSchedules?.map((e) => e.toJson()).toList()); - val['BlockUnratedItems'] = unratedItemListToJson(instance.blockUnratedItems); - writeNotNull('EnableRemoteControlOfOtherUsers', - instance.enableRemoteControlOfOtherUsers); - writeNotNull('EnableSharedDeviceControl', instance.enableSharedDeviceControl); - writeNotNull('EnableRemoteAccess', instance.enableRemoteAccess); - writeNotNull('EnableLiveTvManagement', instance.enableLiveTvManagement); - writeNotNull('EnableLiveTvAccess', instance.enableLiveTvAccess); - writeNotNull('EnableMediaPlayback', instance.enableMediaPlayback); - writeNotNull('EnableAudioPlaybackTranscoding', - instance.enableAudioPlaybackTranscoding); - writeNotNull('EnableVideoPlaybackTranscoding', - instance.enableVideoPlaybackTranscoding); - writeNotNull('EnablePlaybackRemuxing', instance.enablePlaybackRemuxing); - writeNotNull( - 'ForceRemoteSourceTranscoding', instance.forceRemoteSourceTranscoding); - writeNotNull('EnableContentDeletion', instance.enableContentDeletion); - writeNotNull('EnableContentDeletionFromFolders', - instance.enableContentDeletionFromFolders); - writeNotNull('EnableContentDownloading', instance.enableContentDownloading); - writeNotNull('EnableSyncTranscoding', instance.enableSyncTranscoding); - writeNotNull('EnableMediaConversion', instance.enableMediaConversion); - writeNotNull('EnabledDevices', instance.enabledDevices); - writeNotNull('EnableAllDevices', instance.enableAllDevices); - writeNotNull('EnabledChannels', instance.enabledChannels); - writeNotNull('EnableAllChannels', instance.enableAllChannels); - writeNotNull('EnabledFolders', instance.enabledFolders); - writeNotNull('EnableAllFolders', instance.enableAllFolders); - writeNotNull('InvalidLoginAttemptCount', instance.invalidLoginAttemptCount); - writeNotNull( - 'LoginAttemptsBeforeLockout', instance.loginAttemptsBeforeLockout); - writeNotNull('MaxActiveSessions', instance.maxActiveSessions); - writeNotNull('EnablePublicSharing', instance.enablePublicSharing); - writeNotNull('BlockedMediaFolders', instance.blockedMediaFolders); - writeNotNull('BlockedChannels', instance.blockedChannels); - writeNotNull('RemoteClientBitrateLimit', instance.remoteClientBitrateLimit); - val['AuthenticationProviderId'] = instance.authenticationProviderId; - val['PasswordResetProviderId'] = instance.passwordResetProviderId; - writeNotNull('SyncPlayAccess', - syncPlayUserAccessTypeNullableToJson(instance.syncPlayAccess)); - return val; -} +Map _$UserPolicyToJson(UserPolicy instance) => + { + if (instance.isAdministrator case final value?) 'IsAdministrator': value, + if (instance.isHidden case final value?) 'IsHidden': value, + if (instance.enableCollectionManagement case final value?) + 'EnableCollectionManagement': value, + if (instance.enableSubtitleManagement case final value?) + 'EnableSubtitleManagement': value, + if (instance.enableLyricManagement case final value?) + 'EnableLyricManagement': value, + if (instance.isDisabled case final value?) 'IsDisabled': value, + if (instance.maxParentalRating case final value?) + 'MaxParentalRating': value, + if (instance.blockedTags case final value?) 'BlockedTags': value, + if (instance.allowedTags case final value?) 'AllowedTags': value, + if (instance.enableUserPreferenceAccess case final value?) + 'EnableUserPreferenceAccess': value, + if (instance.accessSchedules?.map((e) => e.toJson()).toList() + case final value?) + 'AccessSchedules': value, + 'BlockUnratedItems': unratedItemListToJson(instance.blockUnratedItems), + if (instance.enableRemoteControlOfOtherUsers case final value?) + 'EnableRemoteControlOfOtherUsers': value, + if (instance.enableSharedDeviceControl case final value?) + 'EnableSharedDeviceControl': value, + if (instance.enableRemoteAccess case final value?) + 'EnableRemoteAccess': value, + if (instance.enableLiveTvManagement case final value?) + 'EnableLiveTvManagement': value, + if (instance.enableLiveTvAccess case final value?) + 'EnableLiveTvAccess': value, + if (instance.enableMediaPlayback case final value?) + 'EnableMediaPlayback': value, + if (instance.enableAudioPlaybackTranscoding case final value?) + 'EnableAudioPlaybackTranscoding': value, + if (instance.enableVideoPlaybackTranscoding case final value?) + 'EnableVideoPlaybackTranscoding': value, + if (instance.enablePlaybackRemuxing case final value?) + 'EnablePlaybackRemuxing': value, + if (instance.forceRemoteSourceTranscoding case final value?) + 'ForceRemoteSourceTranscoding': value, + if (instance.enableContentDeletion case final value?) + 'EnableContentDeletion': value, + if (instance.enableContentDeletionFromFolders case final value?) + 'EnableContentDeletionFromFolders': value, + if (instance.enableContentDownloading case final value?) + 'EnableContentDownloading': value, + if (instance.enableSyncTranscoding case final value?) + 'EnableSyncTranscoding': value, + if (instance.enableMediaConversion case final value?) + 'EnableMediaConversion': value, + if (instance.enabledDevices case final value?) 'EnabledDevices': value, + if (instance.enableAllDevices case final value?) + 'EnableAllDevices': value, + if (instance.enabledChannels case final value?) 'EnabledChannels': value, + if (instance.enableAllChannels case final value?) + 'EnableAllChannels': value, + if (instance.enabledFolders case final value?) 'EnabledFolders': value, + if (instance.enableAllFolders case final value?) + 'EnableAllFolders': value, + if (instance.invalidLoginAttemptCount case final value?) + 'InvalidLoginAttemptCount': value, + if (instance.loginAttemptsBeforeLockout case final value?) + 'LoginAttemptsBeforeLockout': value, + if (instance.maxActiveSessions case final value?) + 'MaxActiveSessions': value, + if (instance.enablePublicSharing case final value?) + 'EnablePublicSharing': value, + if (instance.blockedMediaFolders case final value?) + 'BlockedMediaFolders': value, + if (instance.blockedChannels case final value?) 'BlockedChannels': value, + if (instance.remoteClientBitrateLimit case final value?) + 'RemoteClientBitrateLimit': value, + 'AuthenticationProviderId': instance.authenticationProviderId, + 'PasswordResetProviderId': instance.passwordResetProviderId, + if (syncPlayUserAccessTypeNullableToJson(instance.syncPlayAccess) + case final value?) + 'SyncPlayAccess': value, + }; UserUpdatedMessage _$UserUpdatedMessageFromJson(Map json) => UserUpdatedMessage( @@ -8674,21 +7466,14 @@ UserUpdatedMessage _$UserUpdatedMessageFromJson(Map json) => json['MessageType']), ); -Map _$UserUpdatedMessageToJson(UserUpdatedMessage instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Data', instance.data?.toJson()); - writeNotNull('MessageId', instance.messageId); - writeNotNull( - 'MessageType', sessionMessageTypeNullableToJson(instance.messageType)); - return val; -} +Map _$UserUpdatedMessageToJson(UserUpdatedMessage instance) => + { + if (instance.data?.toJson() case final value?) 'Data': value, + if (instance.messageId case final value?) 'MessageId': value, + if (sessionMessageTypeNullableToJson(instance.messageType) + case final value?) + 'MessageType': value, + }; UtcTimeResponse _$UtcTimeResponseFromJson(Map json) => UtcTimeResponse( @@ -8700,21 +7485,14 @@ UtcTimeResponse _$UtcTimeResponseFromJson(Map json) => : DateTime.parse(json['ResponseTransmissionTime'] as String), ); -Map _$UtcTimeResponseToJson(UtcTimeResponse instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'RequestReceptionTime', instance.requestReceptionTime?.toIso8601String()); - writeNotNull('ResponseTransmissionTime', - instance.responseTransmissionTime?.toIso8601String()); - return val; -} +Map _$UtcTimeResponseToJson(UtcTimeResponse instance) => + { + if (instance.requestReceptionTime?.toIso8601String() case final value?) + 'RequestReceptionTime': value, + if (instance.responseTransmissionTime?.toIso8601String() + case final value?) + 'ResponseTransmissionTime': value, + }; ValidatePathDto _$ValidatePathDtoFromJson(Map json) => ValidatePathDto( @@ -8723,20 +7501,13 @@ ValidatePathDto _$ValidatePathDtoFromJson(Map json) => isFile: json['IsFile'] as bool?, ); -Map _$ValidatePathDtoToJson(ValidatePathDto instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ValidateWritable', instance.validateWritable); - writeNotNull('Path', instance.path); - writeNotNull('IsFile', instance.isFile); - return val; -} +Map _$ValidatePathDtoToJson(ValidatePathDto instance) => + { + if (instance.validateWritable case final value?) + 'ValidateWritable': value, + if (instance.path case final value?) 'Path': value, + if (instance.isFile case final value?) 'IsFile': value, + }; VersionInfo _$VersionInfoFromJson(Map json) => VersionInfo( version: json['version'] as String?, @@ -8750,26 +7521,18 @@ VersionInfo _$VersionInfoFromJson(Map json) => VersionInfo( repositoryUrl: json['repositoryUrl'] as String?, ); -Map _$VersionInfoToJson(VersionInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('version', instance.version); - writeNotNull('VersionNumber', instance.versionNumber); - writeNotNull('changelog', instance.changelog); - writeNotNull('targetAbi', instance.targetAbi); - writeNotNull('sourceUrl', instance.sourceUrl); - writeNotNull('checksum', instance.checksum); - writeNotNull('timestamp', instance.timestamp); - writeNotNull('repositoryName', instance.repositoryName); - writeNotNull('repositoryUrl', instance.repositoryUrl); - return val; -} +Map _$VersionInfoToJson(VersionInfo instance) => + { + if (instance.version case final value?) 'version': value, + if (instance.versionNumber case final value?) 'VersionNumber': value, + if (instance.changelog case final value?) 'changelog': value, + if (instance.targetAbi case final value?) 'targetAbi': value, + if (instance.sourceUrl case final value?) 'sourceUrl': value, + if (instance.checksum case final value?) 'checksum': value, + if (instance.timestamp case final value?) 'timestamp': value, + if (instance.repositoryName case final value?) 'repositoryName': value, + if (instance.repositoryUrl case final value?) 'repositoryUrl': value, + }; VirtualFolderInfo _$VirtualFolderInfoFromJson(Map json) => VirtualFolderInfo( @@ -8790,26 +7553,21 @@ VirtualFolderInfo _$VirtualFolderInfoFromJson(Map json) => refreshStatus: json['RefreshStatus'] as String?, ); -Map _$VirtualFolderInfoToJson(VirtualFolderInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Name', instance.name); - writeNotNull('Locations', instance.locations); - writeNotNull('CollectionType', - collectionTypeOptionsNullableToJson(instance.collectionType)); - writeNotNull('LibraryOptions', instance.libraryOptions?.toJson()); - writeNotNull('ItemId', instance.itemId); - writeNotNull('PrimaryImageItemId', instance.primaryImageItemId); - writeNotNull('RefreshProgress', instance.refreshProgress); - writeNotNull('RefreshStatus', instance.refreshStatus); - return val; -} +Map _$VirtualFolderInfoToJson(VirtualFolderInfo instance) => + { + if (instance.name case final value?) 'Name': value, + if (instance.locations case final value?) 'Locations': value, + if (collectionTypeOptionsNullableToJson(instance.collectionType) + case final value?) + 'CollectionType': value, + if (instance.libraryOptions?.toJson() case final value?) + 'LibraryOptions': value, + if (instance.itemId case final value?) 'ItemId': value, + if (instance.primaryImageItemId case final value?) + 'PrimaryImageItemId': value, + if (instance.refreshProgress case final value?) 'RefreshProgress': value, + if (instance.refreshStatus case final value?) 'RefreshStatus': value, + }; WakeOnLanInfo _$WakeOnLanInfoFromJson(Map json) => WakeOnLanInfo( @@ -8817,19 +7575,11 @@ WakeOnLanInfo _$WakeOnLanInfoFromJson(Map json) => port: (json['Port'] as num?)?.toInt(), ); -Map _$WakeOnLanInfoToJson(WakeOnLanInfo instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('MacAddress', instance.macAddress); - writeNotNull('Port', instance.port); - return val; -} +Map _$WakeOnLanInfoToJson(WakeOnLanInfo instance) => + { + if (instance.macAddress case final value?) 'MacAddress': value, + if (instance.port case final value?) 'Port': value, + }; WebSocketMessage _$WebSocketMessageFromJson(Map json) => WebSocketMessage(); @@ -8847,23 +7597,19 @@ XbmcMetadataOptions _$XbmcMetadataOptionsFromJson(Map json) => json['EnableExtraThumbsDuplication'] as bool?, ); -Map _$XbmcMetadataOptionsToJson(XbmcMetadataOptions instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('UserId', instance.userId); - writeNotNull('ReleaseDateFormat', instance.releaseDateFormat); - writeNotNull('SaveImagePathsInNfo', instance.saveImagePathsInNfo); - writeNotNull('EnablePathSubstitution', instance.enablePathSubstitution); - writeNotNull( - 'EnableExtraThumbsDuplication', instance.enableExtraThumbsDuplication); - return val; -} +Map _$XbmcMetadataOptionsToJson( + XbmcMetadataOptions instance) => + { + if (instance.userId case final value?) 'UserId': value, + if (instance.releaseDateFormat case final value?) + 'ReleaseDateFormat': value, + if (instance.saveImagePathsInNfo case final value?) + 'SaveImagePathsInNfo': value, + if (instance.enablePathSubstitution case final value?) + 'EnablePathSubstitution': value, + if (instance.enableExtraThumbsDuplication case final value?) + 'EnableExtraThumbsDuplication': value, + }; BaseItemDto$ImageBlurHashes _$BaseItemDto$ImageBlurHashesFromJson( Map json) => @@ -8884,30 +7630,22 @@ BaseItemDto$ImageBlurHashes _$BaseItemDto$ImageBlurHashesFromJson( ); Map _$BaseItemDto$ImageBlurHashesToJson( - BaseItemDto$ImageBlurHashes instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Primary', instance.primary); - writeNotNull('Art', instance.art); - writeNotNull('Backdrop', instance.backdrop); - writeNotNull('Banner', instance.banner); - writeNotNull('Logo', instance.logo); - writeNotNull('Thumb', instance.thumb); - writeNotNull('Disc', instance.disc); - writeNotNull('Box', instance.box); - writeNotNull('Screenshot', instance.screenshot); - writeNotNull('Menu', instance.menu); - writeNotNull('Chapter', instance.chapter); - writeNotNull('BoxRear', instance.boxRear); - writeNotNull('Profile', instance.profile); - return val; -} + BaseItemDto$ImageBlurHashes instance) => + { + if (instance.primary case final value?) 'Primary': value, + if (instance.art case final value?) 'Art': value, + if (instance.backdrop case final value?) 'Backdrop': value, + if (instance.banner case final value?) 'Banner': value, + if (instance.logo case final value?) 'Logo': value, + if (instance.thumb case final value?) 'Thumb': value, + if (instance.disc case final value?) 'Disc': value, + if (instance.box case final value?) 'Box': value, + if (instance.screenshot case final value?) 'Screenshot': value, + if (instance.menu case final value?) 'Menu': value, + if (instance.chapter case final value?) 'Chapter': value, + if (instance.boxRear case final value?) 'BoxRear': value, + if (instance.profile case final value?) 'Profile': value, + }; BaseItemPerson$ImageBlurHashes _$BaseItemPerson$ImageBlurHashesFromJson( Map json) => @@ -8928,27 +7666,19 @@ BaseItemPerson$ImageBlurHashes _$BaseItemPerson$ImageBlurHashesFromJson( ); Map _$BaseItemPerson$ImageBlurHashesToJson( - BaseItemPerson$ImageBlurHashes instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('Primary', instance.primary); - writeNotNull('Art', instance.art); - writeNotNull('Backdrop', instance.backdrop); - writeNotNull('Banner', instance.banner); - writeNotNull('Logo', instance.logo); - writeNotNull('Thumb', instance.thumb); - writeNotNull('Disc', instance.disc); - writeNotNull('Box', instance.box); - writeNotNull('Screenshot', instance.screenshot); - writeNotNull('Menu', instance.menu); - writeNotNull('Chapter', instance.chapter); - writeNotNull('BoxRear', instance.boxRear); - writeNotNull('Profile', instance.profile); - return val; -} + BaseItemPerson$ImageBlurHashes instance) => + { + if (instance.primary case final value?) 'Primary': value, + if (instance.art case final value?) 'Art': value, + if (instance.backdrop case final value?) 'Backdrop': value, + if (instance.banner case final value?) 'Banner': value, + if (instance.logo case final value?) 'Logo': value, + if (instance.thumb case final value?) 'Thumb': value, + if (instance.disc case final value?) 'Disc': value, + if (instance.box case final value?) 'Box': value, + if (instance.screenshot case final value?) 'Screenshot': value, + if (instance.menu case final value?) 'Menu': value, + if (instance.chapter case final value?) 'Chapter': value, + if (instance.boxRear case final value?) 'BoxRear': value, + if (instance.profile case final value?) 'Profile': value, + }; diff --git a/lib/providers/api_provider.dart b/lib/providers/api_provider.dart index 8bd63f3..3430657 100644 --- a/lib/providers/api_provider.dart +++ b/lib/providers/api_provider.dart @@ -1,12 +1,13 @@ import 'dart:developer'; import 'package:chopper/chopper.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart'; import 'package:fladder/providers/auth_provider.dart'; import 'package:fladder/providers/service_provider.dart'; import 'package:fladder/providers/user_provider.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'api_provider.g.dart'; @@ -26,37 +27,40 @@ class JellyApi extends _$JellyApi { } } -class JellyRequest implements RequestInterceptor { +class JellyRequest implements Interceptor { JellyRequest(this.ref); final Ref ref; @override - FutureOr onRequest(Request request) async { - if (request.method == HttpMethod.Post) { - chopperLogger.info('Performed a POST request'); - } - + FutureOr> intercept(Chain chain) async { final serverUrl = Uri.parse(ref.read(userProvider)?.server ?? ref.read(authProvider).tempCredentials.server); //Use current logged in user otherwise use the authprovider var loginModel = ref.read(userProvider)?.credentials ?? ref.read(authProvider).tempCredentials; var headers = loginModel.header(ref); - return request.copyWith( - baseUri: serverUrl, - headers: request.headers..addAll(headers), + final Response response = await chain.proceed( + applyHeaders( + chain.request.copyWith( + baseUri: serverUrl, + ), + headers), ); + + return response; } } -class JellyResponse implements ResponseInterceptor { +class JellyResponse implements Interceptor { JellyResponse(this.ref); final Ref ref; @override - FutureOr> onResponse(Response response) { + FutureOr> intercept(Chain chain) async { + final Response response = await chain.proceed(chain.request); + if (!response.isSuccessful) { log('x- ${response.base.statusCode} - ${response.base.reasonPhrase} - ${response.error} - ${response.base.request?.method} ${response.base.request?.url.toString()}'); } diff --git a/lib/providers/api_provider.g.dart b/lib/providers/api_provider.g.dart index 79eb549..f085299 100644 --- a/lib/providers/api_provider.g.dart +++ b/lib/providers/api_provider.g.dart @@ -22,4 +22,4 @@ final jellyApiProvider = typedef _$JellyApi = AutoDisposeNotifier; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/book_viewer_provider.dart b/lib/providers/book_viewer_provider.dart index e5c2812..8b0188e 100644 --- a/lib/providers/book_viewer_provider.dart +++ b/lib/providers/book_viewer_provider.dart @@ -1,17 +1,18 @@ import 'dart:developer'; import 'dart:io'; +import 'package:flutter/widgets.dart'; + import 'package:archive/archive_io.dart'; import 'package:chopper/chopper.dart'; -import 'package:fladder/providers/service_provider.dart'; -import 'package:fladder/providers/user_provider.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart'; import 'package:fladder/models/book_model.dart'; import 'package:fladder/providers/api_provider.dart'; -import 'package:path_provider/path_provider.dart'; +import 'package:fladder/providers/service_provider.dart'; +import 'package:fladder/providers/user_provider.dart'; class BookViewerModel { final BookModel? book; @@ -75,7 +76,7 @@ class BookViewerNotifier extends StateNotifier { await bookFile.writeAsBytes(response.bodyBytes); final inputStream = InputFileStream(bookFile.path); - final archive = ZipDecoder().decodeBuffer(inputStream); + final archive = ZipDecoder().decodeStream(inputStream); final List imagesPath = []; for (var file in archive.files) { diff --git a/lib/providers/discovery_provider.g.dart b/lib/providers/discovery_provider.g.dart index 128468b..5a43da7 100644 --- a/lib/providers/discovery_provider.g.dart +++ b/lib/providers/discovery_provider.g.dart @@ -23,4 +23,4 @@ final serverDiscoveryProvider = AutoDisposeStreamNotifierProvider< typedef _$ServerDiscovery = AutoDisposeStreamNotifier>; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/items/movies_details_provider.g.dart b/lib/providers/items/movies_details_provider.g.dart index 2a04780..ab84be2 100644 --- a/lib/providers/items/movies_details_provider.g.dart +++ b/lib/providers/items/movies_details_provider.g.dart @@ -157,6 +157,8 @@ class MovieDetailsProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin MovieDetailsRef on AutoDisposeNotifierProviderRef { /// The parameter `arg` of this provider. String get arg; @@ -171,4 +173,4 @@ class _MovieDetailsProviderElement String get arg => (origin as MovieDetailsProvider).arg; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/library_filters_provider.g.dart b/lib/providers/library_filters_provider.g.dart index 9a87aaa..35e2992 100644 --- a/lib/providers/library_filters_provider.g.dart +++ b/lib/providers/library_filters_provider.g.dart @@ -157,6 +157,8 @@ class LibraryFiltersProvider extends AutoDisposeNotifierProviderImpl< } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin LibraryFiltersRef on AutoDisposeNotifierProviderRef> { /// The parameter `ids` of this provider. @@ -171,4 +173,4 @@ class _LibraryFiltersProviderElement extends AutoDisposeNotifierProviderElement< List get ids => (origin as LibraryFiltersProvider).ids; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/session_info_provider.g.dart b/lib/providers/session_info_provider.g.dart index f59414e..fc0616e 100644 --- a/lib/providers/session_info_provider.g.dart +++ b/lib/providers/session_info_provider.g.dart @@ -43,4 +43,4 @@ final sessionInfoProvider = typedef _$SessionInfo = AutoDisposeNotifier; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/sync/background_download_provider.g.dart b/lib/providers/sync/background_download_provider.g.dart index 32097e1..580e81c 100644 --- a/lib/providers/sync/background_download_provider.g.dart +++ b/lib/providers/sync/background_download_provider.g.dart @@ -21,6 +21,8 @@ final backgroundDownloaderProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef BackgroundDownloaderRef = ProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/sync/sync_provider_helpers.g.dart b/lib/providers/sync/sync_provider_helpers.g.dart index a3bbe28..deb128b 100644 --- a/lib/providers/sync/sync_provider_helpers.g.dart +++ b/lib/providers/sync/sync_provider_helpers.g.dart @@ -157,6 +157,8 @@ class SyncChildrenProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin SyncChildrenRef on AutoDisposeNotifierProviderRef> { /// The parameter `arg` of this provider. SyncedItem get arg; @@ -302,6 +304,8 @@ class SyncDownloadStatusProvider extends AutoDisposeNotifierProviderImpl< } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin SyncDownloadStatusRef on AutoDisposeNotifierProviderRef { /// The parameter `arg` of this provider. SyncedItem get arg; @@ -446,6 +450,8 @@ class SyncStatusesProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin SyncStatusesRef on AutoDisposeAsyncNotifierProviderRef { /// The parameter `arg` of this provider. SyncedItem get arg; @@ -586,6 +592,8 @@ class SyncSizeProvider extends AutoDisposeNotifierProviderImpl { } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin SyncSizeRef on AutoDisposeNotifierProviderRef { /// The parameter `arg` of this provider. SyncedItem get arg; @@ -600,4 +608,4 @@ class _SyncSizeProviderElement SyncedItem get arg => (origin as SyncSizeProvider).arg; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/providers/user_provider.g.dart b/lib/providers/user_provider.g.dart index ac9b451..81782fc 100644 --- a/lib/providers/user_provider.g.dart +++ b/lib/providers/user_provider.g.dart @@ -21,6 +21,8 @@ final showSyncButtonProviderProvider = AutoDisposeProvider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef ShowSyncButtonProviderRef = AutoDisposeProviderRef; String _$userHash() => r'e83369c0d569d5a862aa1b92f3f0a45a9d1fe446'; @@ -37,4 +39,4 @@ final userProvider = NotifierProvider.internal( typedef _$User = Notifier; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/screens/book_viewer/book_viewer_reader.dart b/lib/screens/book_viewer/book_viewer_reader.dart index a59a879..635241b 100644 --- a/lib/screens/book_viewer/book_viewer_reader.dart +++ b/lib/screens/book_viewer/book_viewer_reader.dart @@ -1,11 +1,13 @@ import 'dart:io'; import 'dart:math' as math; +import 'package:flutter/material.dart'; + import 'package:extended_image/extended_image.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + import 'package:fladder/providers/settings/book_viewer_settings_provider.dart'; import 'package:fladder/screens/book_viewer/book_viewer_controls.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; class BookViewerReader extends ConsumerWidget { final int index; @@ -112,7 +114,6 @@ class BookViewerReader extends ConsumerWidget { ); }, File(pages[index - 1]), - enableMemoryCache: true, ), ); } diff --git a/lib/screens/shared/media/external_urls.dart b/lib/screens/shared/media/external_urls.dart index 359eb09..b796bcc 100644 --- a/lib/screens/shared/media/external_urls.dart +++ b/lib/screens/shared/media/external_urls.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as customtab; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:url_launcher/url_launcher.dart' as urllauncher; +import 'package:url_launcher/url_launcher.dart' as urilauncher; import 'package:url_launcher/url_launcher_string.dart'; import 'package:fladder/models/items/item_shared_models.dart'; @@ -49,26 +49,22 @@ Future launchUrl(BuildContext context, String link) async { final Uri url = Uri.parse(link); if (AdaptiveLayout.of(context).isDesktop) { - if (!await urllauncher.launchUrl(url, mode: LaunchMode.externalApplication)) { + if (!await urilauncher.launchUrl(url, mode: LaunchMode.externalApplication)) { throw Exception('Could not launch $url'); } } else { try { - await customtab.launch( - link, - customTabsOption: customtab.CustomTabsOption( - toolbarColor: Theme.of(context).primaryColor, - enableDefaultShare: true, - enableUrlBarHiding: true, - showPageTitle: true, - extraCustomTabs: const [ - // ref. https://play.google.com/store/apps/details?id=org.mozilla.firefox - 'org.mozilla.firefox', - // ref. https://play.google.com/store/apps/details?id=com.microsoft.emmx - 'com.microsoft.emmx', - ], + await customtab.launchUrl( + Uri.parse(link), + customTabsOptions: customtab.CustomTabsOptions( + colorSchemes: customtab.CustomTabsColorSchemes.defaults( + toolbarColor: Theme.of(context).primaryColor, + ), + urlBarHidingEnabled: true, + shareState: customtab.CustomTabsShareState.browserDefault, + showTitle: true, ), - safariVCOption: customtab.SafariViewControllerOption( + safariVCOptions: customtab.SafariViewControllerOptions( preferredBarTintColor: Theme.of(context).primaryColor, preferredControlTintColor: Colors.white, barCollapsingEnabled: true, diff --git a/lib/wrappers/media_control_wrapper.dart b/lib/wrappers/media_control_wrapper.dart index fe14d67..c93a4cb 100644 --- a/lib/wrappers/media_control_wrapper.dart +++ b/lib/wrappers/media_control_wrapper.dart @@ -149,7 +149,7 @@ class MediaControlsWrapper extends BaseAudioHandler { playbackState.add(playbackState.value.copyWith( playing: value.playing, )); - smtc?.setPlaybackStatus(value.playing ? PlaybackStatus.Playing : PlaybackStatus.Paused); + smtc?.setPlaybackStatus(value.playing ? PlaybackStatus.playing : PlaybackStatus.paused); })); } @@ -212,7 +212,7 @@ class MediaControlsWrapper extends BaseAudioHandler { ); smtc?.enableSmtc(); - smtc?.setPlaybackStatus(PlaybackStatus.Playing); + smtc?.setPlaybackStatus(PlaybackStatus.playing); } @override @@ -225,7 +225,7 @@ class MediaControlsWrapper extends BaseAudioHandler { ref.read(playBackModel)?.playbackStopped(position ?? Duration.zero, totalDuration, ref); ref.read(mediaPlaybackProvider.notifier).update((state) => state.copyWith(position: Duration.zero)); - smtc?.setPlaybackStatus(PlaybackStatus.Stopped); + smtc?.setPlaybackStatus(PlaybackStatus.stopped); smtc?.clearMetadata(); smtc?.disableSmtc(); playbackState.add( diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 4f69b99..c3f0eb4 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -35,9 +35,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) media_kit_video_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin"); media_kit_video_plugin_register_with_registrar(media_kit_video_registrar); - g_autoptr(FlPluginRegistrar) screen_retriever_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); - screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); + g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); + screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index d4ad224..38a1bfc 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -9,7 +9,7 @@ list(APPEND FLUTTER_PLUGIN_LIST isar_flutter_libs media_kit_libs_linux media_kit_video - screen_retriever + screen_retriever_linux url_launcher_linux window_manager ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 21390d6..e9963b2 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -18,7 +18,7 @@ import media_kit_video import package_info_plus import path_provider_foundation import screen_brightness_macos -import screen_retriever +import screen_retriever_macos import share_plus import shared_preferences_foundation import sqflite_darwin @@ -42,7 +42,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin")) - ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin")) + ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/pubspec.lock b/pubspec.lock index e011959..49fa2a0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "72.0.0" + version: "76.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" analyzer_plugin: dependency: transitive description: @@ -50,10 +50,10 @@ packages: dependency: "direct main" description: name: archive - sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + sha256: "6199c74e3db4fbfbd04f66d739e72fe11c8a8957d5f219f1f4482dbde6420b5a" url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "4.0.2" args: dependency: transitive description: @@ -74,18 +74,18 @@ packages: dependency: "direct main" description: name: audio_service - sha256: "9dd5ba7e77567b290c35908b1950d61485b4dfdd3a0ac398e98cfeec04651b75" + sha256: f6c8191bef6b843da34675dd0731ad11d06094c36b691ffcf3148a4feb2e585f url: "https://pub.dev" source: hosted - version: "0.18.15" + version: "0.18.16" audio_service_platform_interface: dependency: transitive description: name: audio_service_platform_interface - sha256: "8431a455dac9916cc9ee6f7da5620a666436345c906ad2ebb7fa41d18b3c1bf4" + sha256: "6283782851f6c8b501b60904a32fc7199dc631172da0629d7301e66f672ab777" url: "https://pub.dev" source: hosted - version: "0.1.1" + version: "0.1.3" audio_service_web: dependency: transitive description: @@ -98,10 +98,10 @@ packages: dependency: transitive description: name: audio_session - sha256: "343e83bc7809fbda2591a49e525d6b63213ade10c76f15813be9aed6657b3261" + sha256: b2a26ba8b7efa1790d6460e82971fde3e398cfbe2295df9dea22f3499d2c12a7 url: "https://pub.dev" source: hosted - version: "0.1.21" + version: "0.1.23" auto_route: dependency: "direct main" description: @@ -130,10 +130,10 @@ packages: dependency: "direct main" description: name: background_downloader - sha256: "6b73fa5d20c47e855f6ef3ed6fb3e0d164141d8ae7d43ca0a42c78f90eaa15e7" + sha256: "8178f005574922941034b4a95c0721bc1ecdc4c9f040e310b108bc3d59a5e919" url: "https://pub.dev" source: hosted - version: "8.5.6" + version: "8.8.1" boolean_selector: dependency: transitive description: @@ -146,10 +146,10 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" build_cli_annotations: dependency: transitive description: @@ -162,42 +162,42 @@ packages: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.3" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" url: "https://pub.dev" source: hosted - version: "2.4.13" + version: "2.4.14" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" url: "https://pub.dev" source: hosted - version: "7.3.2" + version: "8.0.0" built_collection: dependency: transitive description: @@ -210,10 +210,10 @@ packages: dependency: transitive description: name: built_value - sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" url: "https://pub.dev" source: hosted - version: "8.9.2" + version: "8.9.3" cached_network_image: dependency: "direct main" description: @@ -250,10 +250,10 @@ packages: dependency: transitive description: name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -274,18 +274,18 @@ packages: dependency: "direct main" description: name: chopper - sha256: "1b6280ec22841b844448bec8ef2644d9cbe9ea8dfce13ec9cab9e8d3aac3830d" + sha256: "40899b729fb6d8969d967264b189efaf2452bc3ccf6ed0782d00f1d8a6161c31" url: "https://pub.dev" source: hosted - version: "7.4.0" + version: "8.0.3" chopper_generator: dependency: "direct dev" description: name: chopper_generator - sha256: "2984ed8589132aa8fd8225482038cad2bd576405e3751aa237d466870f5dad42" + sha256: de438569cba1e2a2888e8d91e3c2ac60106574eea7f36823ed0334e96146328a url: "https://pub.dev" source: hosted - version: "7.4.0" + version: "8.0.3" ci: dependency: transitive description: @@ -298,10 +298,10 @@ packages: dependency: transitive description: name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c url: "https://pub.dev" source: hosted - version: "0.4.1" + version: "0.4.2" clock: dependency: transitive description: @@ -314,26 +314,26 @@ packages: dependency: transitive description: name: code_builder - sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.10.1" collection: dependency: "direct main" description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" cross_file: dependency: transitive description: @@ -346,18 +346,18 @@ packages: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" csslib: dependency: transitive description: name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.2" cupertino_icons: dependency: "direct main" description: @@ -370,34 +370,42 @@ packages: dependency: "direct dev" description: name: custom_lint - sha256: "832fcdc676171205201c9cffafd6b5add19393962f6598af8472b48b413026e6" + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" url: "https://pub.dev" source: hosted - version: "0.6.8" + version: "0.7.0" custom_lint_core: dependency: transitive description: name: custom_lint_core - sha256: "4ddbbdaa774265de44c97054dcec058a83d9081d071785ece601e348c18c267d" + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: bfe9b7a09c4775a587b58d10ebb871d4fe618237639b1e84d5ec62d7dfef25f9 + url: "https://pub.dev" + source: hosted + version: "1.0.0+6.11.0" dart_mappable: dependency: "direct main" description: name: dart_mappable - sha256: "47269caf2060533c29b823ff7fa9706502355ffcb61e7f2a374e3a0fb2f2c3f0" + sha256: f69a961ae8589724ebb542e588f228ae844c5f78028899cbe2cc718977c1b382 url: "https://pub.dev" source: hosted - version: "4.2.2" + version: "4.3.0" dart_mappable_builder: dependency: "direct dev" description: name: dart_mappable_builder - sha256: ab5cf9086862d3fceb9773e945b5f95cc5471a28c782a4fc451bd400a4e0c64e + sha256: "04a6e7117382f8a8689b3e363bee6c3de8c9ea4332e664148fe01bd576eb1126" url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.3.0" dart_style: dependency: transitive description: @@ -418,10 +426,10 @@ packages: dependency: "direct main" description: name: desktop_drop - sha256: ebba9c9cb0b54385998a977d741cc06fd8324878c08d5a36e9da61cd56b04cc6 + sha256: "03abf1c0443afdd1d65cf8fa589a2f01c67a11da56bbb06f6ea1de79d5628e94" url: "https://pub.dev" source: hosted - version: "0.4.3" + version: "0.5.0" diffutil_dart: dependency: transitive description: @@ -450,18 +458,18 @@ packages: dependency: transitive description: name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.7" extended_image: dependency: "direct main" description: name: extended_image - sha256: "69d4299043334ecece679996e47d0b0891cd8c29d8da0034868443506f1d9a78" + sha256: "85199f9233e03abc2ce2e68cbb2991648666af4a527ae4e6250935be8edfddae" url: "https://pub.dev" source: hosted - version: "8.3.1" + version: "9.1.0" extended_image_library: dependency: transitive description: @@ -506,18 +514,18 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "1bbf65dd997458a08b531042ec3794112a6c39c07c37ff22113d2e7e4f81d4e4" + sha256: c904b4ab56d53385563c7c39d8e9fa9af086f91495dfc48717ad84a42c3cf204 url: "https://pub.dev" source: hosted - version: "6.2.1" + version: "8.1.7" fixnum: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flexible_scrollbar: dependency: "direct main" description: @@ -551,26 +559,42 @@ packages: dependency: "direct main" description: name: flutter_custom_tabs - sha256: e90e5b7cad5648aeb0e1ed04aa3c0cada62d86f3b5d4aaef488ab7de61ec2a9f + sha256: "34167bd15fa3479855c011f868e0789c9569c12b64358ca7250accc5a24c3312" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.1.0" + flutter_custom_tabs_android: + dependency: transitive + description: + name: flutter_custom_tabs_android + sha256: cf06fde8c002f326dc6cbf69ee3f97c3feead4436229da02d2e2aa39d5a5dbf4 + url: "https://pub.dev" + source: hosted + version: "2.1.0" + flutter_custom_tabs_ios: + dependency: transitive + description: + name: flutter_custom_tabs_ios + sha256: ef2de533bc45fb84fefc3854bc8b1e43001671c6bc6bc55faa57942eecd3f70a + url: "https://pub.dev" + source: hosted + version: "2.1.0" flutter_custom_tabs_platform_interface: dependency: transitive description: name: flutter_custom_tabs_platform_interface - sha256: "1d6b9eb6c5671b21511fdb47babf18aa65982784373986c003aaf67ca78798ad" + sha256: e18e9b08f92582123bdb84fb6e4c91804b0579700fed6f887d32fd9a1e96a5d5 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.1.0" flutter_custom_tabs_web: dependency: transitive description: name: flutter_custom_tabs_web - sha256: dbb5689a97c2398aa5dbcfc9cd59cffea5518ec815e9d23def448dc143cb02be + sha256: "08ae322b11e1972a233d057542279873d0f9d1d5f8159c2c741457239d9d562c" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.1.0" flutter_keyboard_visibility: dependency: transitive description: @@ -623,10 +647,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -636,26 +660,26 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398" + sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" url: "https://pub.dev" source: hosted - version: "2.0.23" + version: "2.0.24" flutter_riverpod: dependency: "direct main" description: name: flutter_riverpod - sha256: "711d916456563f715bde1e139d7cfdca009f8264befab3ac9f8ded8b6ec26405" + sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.6.1" flutter_rust_bridge: dependency: transitive description: name: flutter_rust_bridge - sha256: "02720226035257ad0b571c1256f43df3e1556a499f6bcb004849a0faaa0e87f0" + sha256: "0ad5079de35d317650fec59b26cb4d0c116ebc2ce703a29f9367513b8a91c287" url: "https://pub.dev" source: hosted - version: "1.82.6" + version: "2.5.0" flutter_staggered_animations: dependency: "direct main" description: @@ -676,10 +700,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "578bd8c508144fdaffd4f77b8ef2d8c523602275cd697cc3db284dbd762ef4ce" + sha256: "54900a1a1243f3c4a5506d853a2b5c2dbc38d5f27e52a52618a8054401431123" url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.0.16" flutter_test: dependency: "direct dev" description: flutter @@ -702,26 +726,26 @@ packages: dependency: "direct main" description: name: flutter_widget_from_html - sha256: "22c911b6ccf82b83e0c457d987bac4e703440fea0fc88dab24f4dfe995a5f33f" + sha256: f3967a5b42896662efdd420b5adaf8a7d3692b0f44462a07c80e3b4c173b1a02 url: "https://pub.dev" source: hosted - version: "0.14.11" + version: "0.15.3" flutter_widget_from_html_core: dependency: transitive description: name: flutter_widget_from_html_core - sha256: cc1d9be3d187ce668ee02091cd5442dfb050cdaf98e0ab9a4d12ad008f966979 + sha256: b1048fd119a14762e2361bd057da608148a895477846d6149109b2151d2f7abf url: "https://pub.dev" source: hosted - version: "0.14.12" + version: "0.15.2" font_awesome_flutter: dependency: "direct main" description: name: font_awesome_flutter - sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f" + sha256: d3a89184101baec7f4600d58840a764d2ef760fe1c5a20ef9e6b0e9b24a07a3a url: "https://pub.dev" source: hosted - version: "10.7.0" + version: "10.8.0" freezed: dependency: "direct dev" description: @@ -774,10 +798,10 @@ packages: dependency: transitive description: name: fwfh_just_audio - sha256: "209cf9644599e37b0edb6961c4f30ce80d156f5a53a50355f75fb4a22f9fdb0a" + sha256: "38dc2c55803bd3cef33042c473e0c40b891ad4548078424641a32032f6a1245f" url: "https://pub.dev" source: hosted - version: "0.14.3" + version: "0.15.2" fwfh_svg: dependency: transitive description: @@ -798,10 +822,10 @@ packages: dependency: transitive description: name: fwfh_webview - sha256: b828bb5ddd4361a866cdb8f1b0de4f3348f332915ecf2f4215ba17e46c656adc + sha256: c0a8b664b642f40f4c252a0ab4e72c22dcd97c7fb3a7e50a6b4bdb6f63afca19 url: "https://pub.dev" source: hosted - version: "0.14.8" + version: "0.15.3" glob: dependency: transitive description: @@ -822,10 +846,10 @@ packages: dependency: transitive description: name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" url: "https://pub.dev" source: hosted - version: "0.15.4" + version: "0.15.5" http: dependency: "direct main" description: @@ -846,18 +870,18 @@ packages: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" icons_launcher: dependency: "direct main" description: @@ -870,10 +894,10 @@ packages: dependency: transitive description: name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + sha256: "8346ad4b5173924b5ddddab782fc7d8a6300178c8b1dc427775405a01701c4a6" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.5.2" intl: dependency: "direct main" description: @@ -886,10 +910,10 @@ packages: dependency: transitive description: name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" isar: dependency: "direct main" description: @@ -926,18 +950,18 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: ea1432d167339ea9b5bb153f0571d0039607a873d6e04e0117af043f14a1fd4b + sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c url: "https://pub.dev" source: hosted - version: "6.8.0" + version: "6.9.0" just_audio: dependency: transitive description: name: just_audio - sha256: b41646a8241688f1d99c2e69c4da2bb26aa4b3a99795f6ff205c2a165e033fda + sha256: a49e7120b95600bd357f37a2bb04cd1e88252f7cdea8f3368803779b925b1049 url: "https://pub.dev" source: hosted - version: "0.9.41" + version: "0.9.42" just_audio_platform_interface: dependency: transitive description: @@ -958,18 +982,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -982,10 +1006,10 @@ packages: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "5.1.1" local_auth: dependency: "direct main" description: @@ -1006,10 +1030,10 @@ packages: dependency: transitive description: name: local_auth_darwin - sha256: "6d2950da311d26d492a89aeb247c72b4653ddc93601ea36a84924a396806d49c" + sha256: "5c5127061107278ab4cafa1ac51b3b6760282bf1a2abf011270908a429d1634b" url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" local_auth_platform_interface: dependency: transitive description: @@ -1030,18 +1054,18 @@ packages: dependency: "direct main" description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" macros: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" markdown: dependency: transitive description: @@ -1071,7 +1095,7 @@ packages: description: path: media_kit ref: HEAD - resolved-ref: "4afa396e89543141bc9c72e643981ada67aae232" + resolved-ref: "32948df24ba70d9d9a7626667d29a493850d8aed" url: "https://github.com/DonutWare/media-kit" source: git version: "1.1.11" @@ -1112,7 +1136,7 @@ packages: description: path: "libs/universal/media_kit_libs_video" ref: HEAD - resolved-ref: "4afa396e89543141bc9c72e643981ada67aae232" + resolved-ref: "32948df24ba70d9d9a7626667d29a493850d8aed" url: "https://github.com/DonutWare/media-kit" source: git version: "1.0.5" @@ -1129,7 +1153,7 @@ packages: description: path: media_kit_video ref: HEAD - resolved-ref: "4afa396e89543141bc9c72e643981ada67aae232" + resolved-ref: "32948df24ba70d9d9a7626667d29a493850d8aed" url: "https://github.com/DonutWare/media-kit" source: git version: "1.2.5" @@ -1145,10 +1169,10 @@ packages: dependency: transitive description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "2.0.0" nested: dependency: transitive description: @@ -1177,34 +1201,34 @@ packages: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: "894f37107424311bdae3e476552229476777b8752c5a2a2369c0cb9a2d5442ef" + sha256: "70c421fe9d9cc1a9a7f3b05ae56befd469fe4f8daa3b484823141a55442d858d" url: "https://pub.dev" source: hosted - version: "8.0.3" + version: "8.1.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" page_transition: dependency: "direct main" description: name: page_transition - sha256: dee976b1f23de9bbef5cd512fe567e9f6278caee11f5eaca9a2115c19dc49ef6 + sha256: "9d2a780d7d68b53ae82fbcc43e06a16195e6775e9aae40e55dc0cbb593460f9d" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.1" path: dependency: "direct main" description: @@ -1217,34 +1241,34 @@ packages: dependency: transitive description: name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" path_provider: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a + sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" url: "https://pub.dev" source: hosted - version: "2.2.12" + version: "2.2.15" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" path_provider_linux: dependency: transitive description: @@ -1281,10 +1305,10 @@ packages: dependency: transitive description: name: permission_handler_android - sha256: "76e4ab092c1b240d31177bb64d2b0bea43f43d0e23541ec866151b9f7b2490fa" + sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1" url: "https://pub.dev" source: hosted - version: "12.0.12" + version: "12.0.13" permission_handler_apple: dependency: transitive description: @@ -1297,10 +1321,10 @@ packages: dependency: transitive description: name: permission_handler_html - sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851 + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" url: "https://pub.dev" source: hosted - version: "0.1.3+2" + version: "0.1.3+5" permission_handler_platform_interface: dependency: transitive description: @@ -1329,10 +1353,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -1381,6 +1405,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a + url: "https://pub.dev" + source: hosted + version: "6.0.1" provider: dependency: transitive description: @@ -1393,34 +1425,26 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" url: "https://pub.dev" source: hosted - version: "1.3.0" - puppeteer: - dependency: transitive - description: - name: puppeteer - sha256: fc33b2a12731e0b9e16c40cd91ea2b6886bcc24037a435fceb59b786d4074f2b - url: "https://pub.dev" - source: hosted - version: "3.15.0" + version: "1.4.0" qs_dart: dependency: transitive description: name: qs_dart - sha256: be73d060d29c0716ded88380ba32e87ce8105f0ba234edb3edefa0d74d47d64b + sha256: "56734fa99a8cc43d72b7396f26c0dad7d1a4ae4bfedc614e94e07ae7a833a179" url: "https://pub.dev" source: hosted - version: "1.2.4" + version: "1.3.0" recase: dependency: transitive description: @@ -1449,34 +1473,34 @@ packages: dependency: transitive description: name: riverpod - sha256: c86fedfb45dd1da98ee6493dd9374325cdf494e7d523ebfb0c387eecc5f7b5c9 + sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.6.1" riverpod_analyzer_utils: dependency: transitive description: name: riverpod_analyzer_utils - sha256: ac28d7bc678471ec986b42d88e5a0893513382ff7542c7ac9634463b044ac72c + sha256: c6b8222b2b483cb87ae77ad147d6408f400c64f060df7a225b127f4afef4f8c8 url: "https://pub.dev" source: hosted - version: "0.5.4" + version: "0.5.8" riverpod_annotation: dependency: "direct main" description: name: riverpod_annotation - sha256: "77fdedb87d09344809e8b514ab864d0537b1cb580a93d09bf579b0403aa6203a" + sha256: e14b0bf45b71326654e2705d462f21b958f987087be850afd60578fcd502d1b8 url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.6.1" riverpod_generator: dependency: "direct dev" description: name: riverpod_generator - sha256: "63311e361ffc578d655dfc31b48dfa4ed3bc76fd06f9be845e9bf97c5c11a429" + sha256: "63546d70952015f0981361636bf8f356d9cfd9d7f6f0815e3c07789a41233188" url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.6.3" rxdart: dependency: transitive description: @@ -1497,58 +1521,90 @@ packages: dependency: "direct main" description: name: screen_brightness - sha256: "7d4ac84ae26b37c01d6f5db7123a72db7933e1f2a2a8c369a51e08f81b3178d8" + sha256: a9a98666045ad4ea0d82bca09fe5f007b8440e315075dc948c1507a9b72ee41f url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" screen_brightness_android: dependency: transitive description: name: screen_brightness_android - sha256: "8c69d3ac475e4d625e7fa682a3a51a69ff59abe5b4a9e57f6ec7d830a6c69bd6" + sha256: "74455f9901ab8a1a45c9097b83855dbbb7498110cc2bc249cb5a86570dd1cf7c" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" screen_brightness_ios: dependency: transitive description: name: screen_brightness_ios - sha256: f08f70ca1ac3e30719764b5cfb8b3fe1e28163065018a41b3e6f243ab146c2f1 + sha256: caee02b34e0089b138a7aee35c461bd2d7c78446dd417f07613def192598ca08 url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" screen_brightness_macos: dependency: transitive description: name: screen_brightness_macos - sha256: "70c2efa4534e22b927e82693488f127dd4a0f008469fccf4f0eefe9061bbdd6a" + sha256: "84fc8ffcbcf19c03d76b7673b0f2c2a2663c09aa2bc37c76ea83ab049294a97a" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" screen_brightness_platform_interface: dependency: transitive description: name: screen_brightness_platform_interface - sha256: "9f3ebf7f22d5487e7676fe9ddaf3fc55b6ff8057707cf6dc0121c7dfda346a16" + sha256: "321e9455b0057e3647fd37700931e063739d94a8aa1b094f98133c01cb56c27b" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" screen_brightness_windows: dependency: transitive description: name: screen_brightness_windows - sha256: c8e12a91cf6dd912a48bd41fcf749282a51afa17f536c3460d8d05702fb89ffa + sha256: "5edbfb1dcaedf960f6858efac8ca45d6c18faae17df86e2c03137d3a563ea155" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" screen_retriever: dependency: transitive description: name: screen_retriever - sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" url: "https://pub.dev" source: hosted - version: "0.1.9" + version: "0.2.0" + screen_retriever_linux: + dependency: transitive + description: + name: screen_retriever_linux + sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_macos: + dependency: transitive + description: + name: screen_retriever_macos + sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_platform_interface: + dependency: transitive + description: + name: screen_retriever_platform_interface + sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_windows: + dependency: transitive + description: + name: screen_retriever_windows + sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" + url: "https://pub.dev" + source: hosted + version: "0.2.0" scrollable_positioned_list: dependency: "direct main" description: @@ -1561,42 +1617,42 @@ packages: dependency: "direct main" description: name: share_plus - sha256: "3ef39599b00059db0990ca2e30fca0a29d8b37aae924d60063f8e0184cf20900" + sha256: "6327c3f233729374d0abaafd61f6846115b2a481b4feddd8534211dc10659400" url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "10.1.3" share_plus_platform_interface: dependency: transitive description: name: share_plus_platform_interface - sha256: "251eb156a8b5fa9ce033747d73535bf53911071f8d3b6f4f0b578505ce0d4496" + sha256: cc012a23fc2d479854e6c80150696c4a5f5bb62cb89af4de1c505cf78d0a5d0b url: "https://pub.dev" source: hosted - version: "3.4.0" + version: "5.0.2" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" + sha256: a752ce92ea7540fc35a0d19722816e04d0e72828a4200e83a98cf1a1eb524c9a url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.5" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab" + sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.0" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d" + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.5.4" shared_preferences_linux: dependency: transitive description: @@ -1633,31 +1689,23 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 - url: "https://pub.dev" - source: hosted - version: "1.1.3" + version: "1.4.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" sliver_tools: dependency: "direct main" description: @@ -1670,10 +1718,10 @@ packages: dependency: "direct main" description: name: smtc_windows - sha256: "0fd64d0c6a0c8ea4ea7908d31195eadc8f6d45d5245159fc67259e9e8704100f" + sha256: "80f7c10867da485ffdf87f842bf27e6763589933c18c11af5dc1cd1e158c3154" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "1.0.0" source_gen: dependency: transitive description: @@ -1686,10 +1734,10 @@ packages: dependency: transitive description: name: source_helper - sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" url: "https://pub.dev" source: hosted - version: "1.3.4" + version: "1.3.5" source_span: dependency: transitive description: @@ -1710,10 +1758,10 @@ packages: dependency: transitive description: name: sqflite - sha256: "79a297dc3cc137e758c6a4baf83342b039e5a6d2436fcdf3f96a00adaaf2ad62" + sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" sqflite_android: dependency: transitive description: @@ -1726,18 +1774,18 @@ packages: dependency: transitive description: name: sqflite_common - sha256: "4468b24876d673418a7b7147e5a08a715b4998a7ae69227acafaab762e0e5490" + sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709" url: "https://pub.dev" source: hosted - version: "2.5.4+5" + version: "2.5.4+6" sqflite_darwin: dependency: transitive description: name: sqflite_darwin - sha256: "769733dddf94622d5541c73e4ddc6aa7b252d865285914b6fcd54a63c4b4f027" + sha256: "22adfd9a2c7d634041e96d6241e6e1c8138ca6817018afc5d443fef91dcefa9c" url: "https://pub.dev" source: hosted - version: "2.4.1-1" + version: "2.4.1+1" sqflite_platform_interface: dependency: transitive description: @@ -1758,10 +1806,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" state_notifier: dependency: transitive description: @@ -1790,26 +1838,26 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" swagger_dart_code_generator: dependency: "direct dev" description: name: swagger_dart_code_generator - sha256: "73dedc94da13ee4c7259cb60411ccf699789eeceb842a493e025afbca808bb99" + sha256: e6fab279c2adb3f91aa170c9126601d22e1485217dddc1443cf3c05eb6480d45 url: "https://pub.dev" source: hosted - version: "2.15.2" + version: "3.0.1" synchronized: dependency: transitive description: @@ -1830,18 +1878,18 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" timing: dependency: transitive description: name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" transparent_image: dependency: "direct main" description: @@ -1850,14 +1898,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" - tuple: - dependency: transitive - description: - name: tuple - sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" - source: hosted - version: "2.0.2" type_plus: dependency: transitive description: @@ -1870,10 +1910,10 @@ packages: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" universal_html: dependency: "direct main" description: @@ -1918,34 +1958,34 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "8fc3bae0b68c02c47c5c86fa8bfa74471d42687b0eded01b78de87872db745e2" + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" url: "https://pub.dev" source: hosted - version: "6.3.12" + version: "6.3.14" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "769549c999acdb42b8bcfa7c43d72bf79a382ca7441ab18a808e101149daf672" + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" url_launcher_platform_interface: dependency: transitive description: @@ -1966,10 +2006,10 @@ packages: dependency: transitive description: name: url_launcher_windows - sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" uuid: dependency: transitive description: @@ -1990,26 +2030,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "773c9522d66d523e1c7b25dfb95cc91c26a1e17b107039cfe147285e92de7878" + sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7" url: "https://pub.dev" source: hosted - version: "1.1.14" + version: "1.1.15" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + sha256: "2430b973a4ca3c4dbc9999b62b8c719a160100dcbae5c819bae0cacce32c9cdb" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.12" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: ab9ff38fc771e9ee1139320adbe3d18a60327370c218c60752068ebee4b49ab1 + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" url: "https://pub.dev" source: hosted - version: "1.1.15" + version: "1.1.16" vector_math: dependency: transitive description: @@ -2030,18 +2070,18 @@ packages: dependency: transitive description: name: video_player_android - sha256: "340b29bc38b2c341ed3afa08148f3d9f351220403cdd2b3a9eb38b71a4be1a9d" + sha256: "391e092ba4abe2f93b3e625bd6b6a6ec7d7414279462c1c0ee42b5ab8d0a0898" url: "https://pub.dev" source: hosted - version: "2.7.12" + version: "2.7.16" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - sha256: cd5ab8a8bc0eab65ab0cea40304097edc46da574c8c1ecdee96f28cd8ef3792f + sha256: "33224c19775fd244be2d6e3dbd8e1826ab162877bd61123bf71890772119a2b7" url: "https://pub.dev" source: hosted - version: "2.6.2" + version: "2.6.5" video_player_platform_interface: dependency: transitive description: @@ -2054,18 +2094,18 @@ packages: dependency: transitive description: name: video_player_web - sha256: "6dcdd298136523eaf7dfc31abaf0dfba9aa8a8dbc96670e87e9d42b6f2caf774" + sha256: "881b375a934d8ebf868c7fb1423b2bfaa393a0a265fa3f733079a86536064a10" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" vm_service: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" volume_controller: dependency: transitive description: @@ -2078,34 +2118,34 @@ packages: dependency: "direct main" description: name: wakelock_plus - sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484 + sha256: "36c88af0b930121941345306d259ec4cc4ecca3b151c02e3a9e71aede83c615e" url: "https://pub.dev" source: hosted - version: "1.2.8" + version: "1.2.10" wakelock_plus_platform_interface: dependency: transitive description: name: wakelock_plus_platform_interface - sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16" + sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" watcher: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" weak_map: dependency: transitive description: name: weak_map - sha256: "95ca338f0cdf5f0022cc283dfa4d97f6f6b03752f67eca85ebe6d7a679ffe3ed" + sha256: bf2cd4bbdba35cf407c41a290085240715ecfba82ea553e78fdeab6fe56d915e url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "4.0.0" web: dependency: transitive description: @@ -2114,30 +2154,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "3.0.1" webview_flutter: dependency: transitive description: name: webview_flutter - sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736 + sha256: "889a0a678e7c793c308c68739996227c9661590605e70b1f6cf6b9a6634f7aec" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.10.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "47a8da40d02befda5b151a26dba71f47df471cddd91dfdb7802d0a87c5442558" + sha256: "3d535126f7244871542b2f0b0fcf94629c9a14883250461f9abe1a6644c1c379" url: "https://pub.dev" source: hosted - version: "3.16.9" + version: "4.2.0" webview_flutter_platform_interface: dependency: transitive description: @@ -2150,26 +2198,26 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: d4034901d96357beb1b6717ebf7d583c88e40cfc6eb85fe76dd1bf0979a9f251 + sha256: b7e92f129482460951d96ef9a46b49db34bd2e1621685de26e9eaafd9674e7eb url: "https://pub.dev" source: hosted - version: "3.16.0" + version: "3.16.3" win32: dependency: transitive description: name: win32 - sha256: e5c39a90447e7c81cfec14b041cdbd0d0916bd9ebbc7fe02ab69568be703b9bd + sha256: "154360849a56b7b67331c21f09a386562d88903f90a1099c5987afc1912e1f29" url: "https://pub.dev" source: hosted - version: "5.6.0" + version: "5.10.0" window_manager: dependency: "direct main" description: name: window_manager - sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" + sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059" url: "https://pub.dev" source: hosted - version: "0.3.9" + version: "0.4.3" xdg_directories: dependency: transitive description: @@ -2198,10 +2246,10 @@ packages: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.6.0 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 86eb184..fc6823b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,7 +41,7 @@ dependencies: icons_launcher: ^3.0.0 # Network and HTTP - chopper: ^7.0.4 + chopper: ^8.0.3 cached_network_image: ^3.2.3 http: ^1.1.0 flutter_cache_manager: ^3.3.0 @@ -86,19 +86,19 @@ dependencies: sliver_tools: ^0.2.10 square_progress_indicator: ^0.0.7 flutter_blurhash: ^0.8.2 - extended_image: ^8.1.1 - flutter_widget_from_html: ^0.14.11 + extended_image: ^9.1.0 + flutter_widget_from_html: ^0.15.3 font_awesome_flutter: ^10.7.0 # Navigation auto_route: ^9.2.2 url_launcher: ^6.3.1 - flutter_custom_tabs: ^1.0.4 + flutter_custom_tabs: ^2.1.0 # Utility path: ^1.8.3 validators: ^3.0.0 - file_picker: ^6.1.1 + file_picker: ^8.1.7 transparent_image: ^2.0.1 universal_html: ^2.2.4 collection: ^1.17.0 @@ -109,9 +109,9 @@ dependencies: package_info_plus: ^8.0.0 open_app_file: ^4.0.2 wakelock_plus: ^1.1.4 - screen_brightness: ^1.0.1 - window_manager: ^0.3.9 - smtc_windows: ^0.1.1 + screen_brightness: ^2.0.1 + window_manager: ^0.4.3 + smtc_windows: ^1.0.0 background_downloader: ^8.5.2 # Data @@ -121,11 +121,11 @@ dependencies: # Other async: ^2.10.0 xid: ^1.0.12 - desktop_drop: 0.4.3 + desktop_drop: ^0.5.0 flexible_scrollbar: ^0.1.3 flutter_typeahead: ^5.0.2 - share_plus: ^7.1.0 - archive: ^3.4.10 + share_plus: ^10.1.3 + archive: ^4.0.2 dart_mappable: ^4.2.2 reorderable_grid: ^1.0.10 @@ -138,13 +138,13 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^3.0.0 + flutter_lints: ^5.0.0 build_runner: ^2.4.11 - chopper_generator: ^7.4.0 + chopper_generator: ^8.0.3 json_serializable: ^6.8.0 - custom_lint: ^0.6.4 + custom_lint: ^0.7.0 freezed: ^2.5.2 - swagger_dart_code_generator: ^2.15.2 + swagger_dart_code_generator: ^3.0.1 riverpod_generator: ^2.4.0 dart_mappable_builder: ^4.2.3 auto_route_generator: ^9.0.0 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index bf950b5..220f14d 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,8 +39,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); ScreenBrightnessWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin")); - ScreenRetrieverPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); + ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); SharePlusWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 5eecdec..8749a06 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -12,7 +12,7 @@ list(APPEND FLUTTER_PLUGIN_LIST media_kit_video permission_handler_windows screen_brightness_windows - screen_retriever + screen_retriever_windows share_plus url_launcher_windows window_manager From e3882bba3d2092f3461f7632d1b5c5630f485613 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 10:57:48 +0100 Subject: [PATCH 03/12] chore: Build now uses fvm as flutter version --- .github/workflows/build.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 323ac2e..fe3182b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: runs-on: ubuntu-latest outputs: version_name: ${{ steps.fetch.outputs.version_name }} + flutter_version: ${{ steps.fetch.outputs.flutter_version }} steps: - name: Checkout repository uses: actions/checkout@v4.1.1 @@ -27,8 +28,13 @@ jobs: - name: Fetch version name id: fetch run: | + # Extract version_name from pubspec.yaml VERSION_NAME=$(grep '^version:' pubspec.yaml | cut -d ':' -f2 | cut -d '+' -f1 | tr -d ' ') echo "version_name=${VERSION_NAME}" >> "$GITHUB_OUTPUT" + + # Extract flutter_version from .fvmrc + FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc) + echo "flutter_version=${FLUTTER_VERSION}" >> "$GITHUB_OUTPUT" shell: bash build-android: @@ -67,7 +73,7 @@ jobs: uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{needs.fetch-info.outputs.flutter-version}} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" @@ -104,7 +110,7 @@ jobs: uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{needs.fetch-info.outputs.flutter-version}} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path @@ -133,7 +139,7 @@ jobs: uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{needs.fetch-info.outputs.flutter-version}} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to specify the cache path cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path @@ -169,7 +175,7 @@ jobs: uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{needs.fetch-info.outputs.flutter-version}} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path @@ -201,7 +207,7 @@ jobs: uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{needs.fetch-info.outputs.flutter-version}} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path @@ -274,7 +280,7 @@ jobs: uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{needs.fetch-info.outputs.flutter-version}} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path From 1857cfdb8c18ad4d00664cd4d181ae0c207b6b36 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 11:26:01 +0100 Subject: [PATCH 04/12] Fixed web stub_stmc --- lib/stubs/web/smtc_web.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/stubs/web/smtc_web.dart b/lib/stubs/web/smtc_web.dart index d358b1a..85d3076 100644 --- a/lib/stubs/web/smtc_web.dart +++ b/lib/stubs/web/smtc_web.dart @@ -90,11 +90,12 @@ class MusicMetadata { } enum PlaybackStatus { - Closed, - Changing, - Stopped, - Playing, - Paused, + closed, + changing, + stopped, + playing, + paused, + ; } enum PressedButton { From 607dea3de1a978e3e3855a720d7bfd1dbae8d3d6 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 11:26:19 +0100 Subject: [PATCH 05/12] chore: Pubspec cleanup --- pubspec.lock | 82 +------------------ pubspec.yaml | 7 +- .../flutter/generated_plugin_registrant.cc | 3 - windows/flutter/generated_plugins.cmake | 1 - 4 files changed, 2 insertions(+), 91 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 49fa2a0..34261e8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -438,14 +438,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" - drop_shadow: - dependency: "direct main" - description: - name: drop_shadow - sha256: "1fa552baeb7c6a3c36a7ff77186a2302a7bf53c93914f46328a9c4eb68ec6b08" - url: "https://pub.dev" - source: hosted - version: "0.1.0" dynamic_color: dependency: "direct main" description: @@ -680,14 +672,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.5.0" - flutter_staggered_animations: - dependency: "direct main" - description: - name: flutter_staggered_animations - sha256: "81d3c816c9bb0dca9e8a5d5454610e21ffb068aedb2bde49d2f8d04f75538351" - url: "https://pub.dev" - source: hosted - version: "1.1.1" flutter_staggered_grid_view: dependency: "direct main" description: @@ -883,7 +867,7 @@ packages: source: hosted version: "4.1.2" icons_launcher: - dependency: "direct main" + dependency: "direct dev" description: name: icons_launcher sha256: a7c83fbc837dc6f81944ef35c3756f533bb2aba32fcca5cbcdb2dbcd877d5ae9 @@ -1189,14 +1173,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" - open_app_file: - dependency: "direct main" - description: - name: open_app_file - sha256: "5dd0af054364c12093947ad3e69370bb22ca535ca17f81f7b72444c7be18cc01" - url: "https://pub.dev" - source: hosted - version: "4.0.2" package_config: dependency: transitive description: @@ -1293,54 +1269,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.0" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb" - url: "https://pub.dev" - source: hosted - version: "11.3.1" - permission_handler_android: - dependency: transitive - description: - name: permission_handler_android - sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1" - url: "https://pub.dev" - source: hosted - version: "12.0.13" - permission_handler_apple: - dependency: transitive - description: - name: permission_handler_apple - sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0 - url: "https://pub.dev" - source: hosted - version: "9.4.5" - permission_handler_html: - dependency: transitive - description: - name: permission_handler_html - sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" - url: "https://pub.dev" - source: hosted - version: "0.1.3+5" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9 - url: "https://pub.dev" - source: hosted - version: "4.2.3" - permission_handler_windows: - dependency: transitive - description: - name: permission_handler_windows - sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" - url: "https://pub.dev" - source: hosted - version: "0.2.1" petitparser: dependency: transitive description: @@ -2018,14 +1946,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.5.1" - validators: - dependency: "direct main" - description: - name: validators - sha256: "884515951f831a9c669a41ed6c4d3c61c2a0e8ec6bca761a4480b28e99cecf5d" - url: "https://pub.dev" - source: hosted - version: "3.0.0" vector_graphics: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index fc6823b..429091a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,6 @@ dependencies: # Icons cupertino_icons: ^1.0.2 ficonsax: ^0.0.3 - icons_launcher: ^3.0.0 # Network and HTTP chopper: ^8.0.3 @@ -75,13 +74,11 @@ dependencies: # UI Components dynamic_color: ^1.7.0 flutter_svg: ^2.0.14 - drop_shadow: ^0.1.0 animations: ^2.0.7 automatic_animated_list: ^1.1.0 page_transition: ^2.0.9 sticky_headers: ^0.3.0+2 flutter_staggered_grid_view: ^0.7.0 - flutter_staggered_animations: ^1.1.1 scrollable_positioned_list: ^0.3.8 sliver_tools: ^0.2.10 square_progress_indicator: ^0.0.7 @@ -97,7 +94,6 @@ dependencies: # Utility path: ^1.8.3 - validators: ^3.0.0 file_picker: ^8.1.7 transparent_image: ^2.0.1 universal_html: ^2.2.4 @@ -105,9 +101,7 @@ dependencies: # Device and System local_auth: ^2.1.6 - permission_handler: ^11.3.0 package_info_plus: ^8.0.0 - open_app_file: ^4.0.2 wakelock_plus: ^1.1.4 screen_brightness: ^2.0.1 window_manager: ^0.4.3 @@ -148,6 +142,7 @@ dev_dependencies: riverpod_generator: ^2.4.0 dart_mappable_builder: ^4.2.3 auto_route_generator: ^9.0.0 + icons_launcher: ^3.0.0 dependency_overrides: js: ^0.7.1 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 220f14d..bebddaf 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -35,8 +34,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("MediaKitLibsWindowsVideoPluginCApi")); MediaKitVideoPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi")); - PermissionHandlerWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); ScreenBrightnessWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin")); ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 8749a06..0abcce9 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -10,7 +10,6 @@ list(APPEND FLUTTER_PLUGIN_LIST local_auth_windows media_kit_libs_windows_video media_kit_video - permission_handler_windows screen_brightness_windows screen_retriever_windows share_plus From 39a753711646cb15208025f079698058f9ec37ba Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 13:53:59 +0100 Subject: [PATCH 06/12] chore: Fix dart deprecation messages --- lib/main.dart | 3 +- lib/models/error_log_model.dart | 2 +- lib/models/item_editing_model.dart | 8 ++--- lib/models/items/media_streams_model.dart | 2 +- lib/models/playback/playback_model.dart | 2 +- .../settings/subtitle_settings_model.dart | 18 +++++------ .../items/book_details_provider.dart | 4 +-- .../items/episode_details_provider.dart | 2 +- .../items/series_details_provider.dart | 3 +- lib/providers/library_search_provider.dart | 20 ++++++------ .../book_viewer_settings_provider.dart | 9 +++--- .../settings/subtitle_settings_provider.dart | 2 +- .../video_player_settings_provider.dart | 6 ++-- .../sync/background_download_provider.dart | 3 +- lib/providers/sync_provider.dart | 4 +-- lib/providers/user_provider.dart | 3 +- lib/routes/nested_details_screen.dart | 2 +- .../book_viewer/book_viewer_controls.dart | 16 +++++----- lib/screens/crash_screen/crash_screen.dart | 4 +-- lib/screens/dashboard/dashboard_screen.dart | 3 +- .../details_screens/book_detail_screen.dart | 2 +- .../components/label_title_item.dart | 3 +- lib/screens/details_screens/empty_item.dart | 2 +- .../details_screens/person_detail_screen.dart | 19 +++++++----- lib/screens/home_screen.dart | 3 +- .../library_search/library_search_screen.dart | 2 +- .../widgets/library_saved_filters.dart | 6 +++- lib/screens/login/login_edit_user.dart | 1 + .../photo_viewer/photo_viewer_controls.dart | 17 +++++----- .../photo_viewer/photo_viewer_screen.dart | 4 +-- .../photo_viewer/simple_video_player.dart | 3 +- lib/screens/settings/settings_list_tile.dart | 2 +- lib/screens/settings/settings_screen.dart | 3 +- lib/screens/shared/default_alert_dialog.dart | 2 ++ lib/screens/shared/default_title_bar.dart | 19 ++++++------ lib/screens/shared/detail_scaffold.dart | 12 +++---- lib/screens/shared/file_picker.dart | 2 +- lib/screens/shared/flat_button.dart | 2 +- lib/screens/shared/input_fields.dart | 2 +- lib/screens/shared/media/carousel_banner.dart | 4 +-- lib/screens/shared/media/chapter_row.dart | 2 +- .../shared/media/components/chip_button.dart | 2 +- .../shared/media/components/media_header.dart | 2 +- .../media/components/media_play_button.dart | 1 + .../shared/media/components/poster_image.dart | 8 ++--- lib/screens/shared/media/episode_posters.dart | 4 +-- .../shared/media/expanding_overview.dart | 9 +++--- lib/screens/shared/media/media_banner.dart | 7 +++-- .../shared/media/poster_list_item.dart | 2 +- lib/screens/shared/media/season_row.dart | 4 +-- lib/screens/shared/outlined_text_field.dart | 12 +++---- lib/screens/syncing/sync_item_details.dart | 3 +- lib/screens/syncing/sync_list_item.dart | 2 +- lib/screens/syncing/sync_widgets.dart | 5 +-- .../syncing/widgets/sync_status_overlay.dart | 4 +-- .../components/video_player_next_wrapper.dart | 4 +-- .../video_player_options_sheet.dart | 4 +-- .../video_player_seek_indicator.dart | 2 +- .../components/video_progress_bar.dart | 9 +++--- .../components/video_subtitle_controls.dart | 12 +++---- .../video_player/video_player_controls.dart | 17 +++++----- lib/theme.dart | 2 +- lib/util/absorb_events.dart | 2 +- lib/util/color_extensions.dart | 31 +++++++++++++++++++ lib/util/debug_banner.dart | 2 +- lib/util/fab_extended_anim.dart | 1 + lib/util/humanize_duration.dart | 6 ++-- lib/util/keyed_list_view.dart | 8 +++-- lib/util/mouse_parking.dart | 2 +- lib/util/string_extensions.dart | 4 +-- .../components/fladder_app_bar.dart | 2 +- .../components/floating_player_bar.dart | 4 +-- .../components/navigation_button.dart | 13 ++++++-- lib/widgets/pop_up/delete_file.dart | 7 +++-- lib/widgets/shared/animated_icon.dart | 2 +- lib/widgets/shared/elevated_icon.dart | 8 ++--- lib/widgets/shared/fladder_carousel.dart | 6 ++-- lib/widgets/shared/fladder_scrollbar.dart | 2 +- lib/widgets/shared/item_actions.dart | 1 + lib/widgets/shared/modal_side_sheet.dart | 2 +- .../shared/selectable_icon_button.dart | 7 +++-- 81 files changed, 258 insertions(+), 195 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 66e46f4..57e6d57 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:collection/collection.dart'; import 'package:dynamic_color/dynamic_color.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -276,7 +275,7 @@ class _MainState extends ConsumerState
with WindowListener, WidgetsBinding dragDevices: { ...scrollBehaviour.dragDevices, mouseDrag ? PointerDeviceKind.mouse : null, - }.whereNotNull().toSet(), + }.nonNulls.toSet(), ), localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, diff --git a/lib/models/error_log_model.dart b/lib/models/error_log_model.dart index 7c334e0..de2272c 100644 --- a/lib/models/error_log_model.dart +++ b/lib/models/error_log_model.dart @@ -62,7 +62,7 @@ class ErrorLogModel { "\n", "\n", stackTrace, - ].whereNotNull().join(); + ].nonNulls.join(); String get clipBoard => [_label, content].toString(); diff --git a/lib/models/item_editing_model.dart b/lib/models/item_editing_model.dart index 2c65493..fbbb280 100644 --- a/lib/models/item_editing_model.dart +++ b/lib/models/item_editing_model.dart @@ -1,14 +1,14 @@ import 'dart:typed_data'; -import 'package:collection/collection.dart'; -import 'package:fladder/models/items/series_model.dart'; import 'package:flutter/widgets.dart'; + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:fladder/jellyfin/jellyfin_open_api.enums.swagger.dart'; import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart' as jelly; import 'package:fladder/models/item_base_model.dart'; import 'package:fladder/models/items/item_shared_models.dart'; +import 'package:fladder/models/items/series_model.dart'; import 'package:fladder/providers/image_provider.dart'; class EditItemsProvider { @@ -118,7 +118,7 @@ class ItemEditingModel { "OfficialRating": { for (String element in (editorInfo?.parentalRatingOptions?.map((e) => e.name).toSet() ?..add(json?["OfficialRating"] as String?)) - ?.whereNotNull() + ?.nonNulls .toList() ?? []) element: (editedJson?["OfficialRating"] as String?) == element @@ -126,7 +126,7 @@ class ItemEditingModel { "CustomRating": { for (String element in (editorInfo?.parentalRatingOptions?.map((e) => e.name).toSet() ?..add(json?["CustomRating"] as String?)) - ?.whereNotNull() + ?.nonNulls .toList() ?? []) element: (editedJson?["CustomRating"] as String?) == element diff --git a/lib/models/items/media_streams_model.dart b/lib/models/items/media_streams_model.dart index 28e2281..d677d3f 100644 --- a/lib/models/items/media_streams_model.dart +++ b/lib/models/items/media_streams_model.dart @@ -243,7 +243,7 @@ class AudioStreamModel extends StreamModel { } String get title => - [name, language, codec, channelLayout].whereNotNull().where((element) => element.isNotEmpty).join(' - '); + [name, language, codec, channelLayout].nonNulls.where((element) => element.isNotEmpty).join(' - '); AudioStreamModel.no({ super.name = 'Off', diff --git a/lib/models/playback/playback_model.dart b/lib/models/playback/playback_model.dart index 6a38a49..16cbdb1 100644 --- a/lib/models/playback/playback_model.dart +++ b/lib/models/playback/playback_model.dart @@ -132,7 +132,7 @@ class PlaybackModelHelper { trickPlay: syncedItem.trickPlayModel, mediaSegments: syncedItem.mediaSegments, media: Media(url: syncedItem.videoFile.path), - queue: itemQueue.whereNotNull().toList(), + queue: itemQueue.nonNulls.toList(), syncedQueue: children, mediaStreams: item.streamModel ?? syncedItemModel.streamModel, ); diff --git a/lib/models/settings/subtitle_settings_model.dart b/lib/models/settings/subtitle_settings_model.dart index 7ef4db6..e186ba1 100644 --- a/lib/models/settings/subtitle_settings_model.dart +++ b/lib/models/settings/subtitle_settings_model.dart @@ -1,4 +1,3 @@ -// ignore_for_file: public_member_api_docs, sort_constructors_first import 'dart:convert'; import 'dart:math' as math; @@ -9,6 +8,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:fladder/providers/settings/subtitle_settings_provider.dart'; import 'package:fladder/providers/settings/video_player_settings_provider.dart'; +import 'package:fladder/util/color_extensions.dart'; class SubtitleSettingsModel { final double fontSize; @@ -58,11 +58,11 @@ class SubtitleSettingsModel { ? [ Shadow( blurRadius: 16, - color: Colors.black.withOpacity(shadow), + color: Colors.black.withValues(alpha: shadow), ), Shadow( blurRadius: 8, - color: Colors.black.withOpacity(shadow), + color: Colors.black.withValues(alpha: shadow), ), ] : null, @@ -92,10 +92,10 @@ class SubtitleSettingsModel { 'fontSize': fontSize, 'fontWeight': fontWeight.value, 'verticalOffset': verticalOffset, - 'color': color.value, - 'outlineColor': outlineColor.value, + 'color': color.toMap, + 'outlineColor': outlineColor.toMap, 'outlineSize': outlineSize, - 'backGroundColor': backGroundColor.value, + 'backGroundColor': backGroundColor.toMap, 'shadow': shadow, }; } @@ -109,10 +109,10 @@ class SubtitleSettingsModel { fontSize: map['fontSize'] as double?, fontWeight: FontWeight.values.firstWhereOrNull((element) => element.index == map['fontWeight'] as int?), verticalOffset: map['verticalOffset'] as double?, - color: map['color'] != null ? Color(map['color'] as int) : null, - outlineColor: map['outlineColor'] != null ? Color(map['outlineColor'] as int) : null, + color: colorFromJson(map['color']), + outlineColor: colorFromJson(map['outlineColor']), outlineSize: map['outlineSize'] as double?, - backGroundColor: map['backGroundColor'] != null ? Color(map['backGroundColor'] as int) : null, + backGroundColor: colorFromJson(map['backGroundColor']), shadow: map['shadow'] as double?, ); } diff --git a/lib/providers/items/book_details_provider.dart b/lib/providers/items/book_details_provider.dart index 05d5094..4109879 100644 --- a/lib/providers/items/book_details_provider.dart +++ b/lib/providers/items/book_details_provider.dart @@ -26,7 +26,7 @@ class BookProviderModel { ImagesData? get cover => parentModel?.getPosters ?? book?.getPosters; List get allBooks { - if (chapters.isEmpty) return [book].whereNotNull().toList(); + if (chapters.isEmpty) return [book].nonNulls.toList(); return chapters; } @@ -141,7 +141,7 @@ class BookDetailsProviderNotifier extends StateNotifier { state = state.copyWith( parentModel: !parentIsView ? () => parentResponse.bodyOrThrow : null, - chapters: (siblingsResponse?.body?.items ?? [openedBook]).whereType().whereNotNull().toList(), + chapters: (siblingsResponse?.body?.items ?? [openedBook]).whereType().nonNulls.toList(), ); return response; diff --git a/lib/providers/items/episode_details_provider.dart b/lib/providers/items/episode_details_provider.dart index 5c4b6da..6b84223 100644 --- a/lib/providers/items/episode_details_provider.dart +++ b/lib/providers/items/episode_details_provider.dart @@ -80,7 +80,7 @@ class EpisodeDetailsProvider extends StateNotifier { .map( (e) => e.createItemModel(ref), ) - .whereNotNull() + .nonNulls .whereType() .toList(); state = state.copyWith( diff --git a/lib/providers/items/series_details_provider.dart b/lib/providers/items/series_details_provider.dart index f39e25f..3bec5cb 100644 --- a/lib/providers/items/series_details_provider.dart +++ b/lib/providers/items/series_details_provider.dart @@ -1,5 +1,4 @@ import 'package:chopper/chopper.dart'; -import 'package:collection/collection.dart'; import 'package:fladder/models/item_base_model.dart'; import 'package:fladder/providers/service_provider.dart'; import 'package:fladder/providers/sync_provider.dart'; @@ -68,7 +67,7 @@ class SeriesDetailViewNotifier extends StateNotifier { .map( (e) => e.createItemModel(ref), ) - .whereNotNull() + .nonNulls .toList(); state = seriesModel.copyWith( availableEpisodes: allChildren.whereType().toList(), diff --git a/lib/providers/library_search_provider.dart b/lib/providers/library_search_provider.dart index ad23fdb..934c5e9 100644 --- a/lib/providers/library_search_provider.dart +++ b/lib/providers/library_search_provider.dart @@ -120,10 +120,10 @@ class LibrarySearchNotifier extends StateNotifier { newLastIndices[viewModel.id] = (lastIndices ?? 0) + libraryItems.items.length; } return libraryItems; - }).whereNotNull(), + }).nonNulls, ); - List newPosters = results.whereNotNull().expand((element) => element.items).toList(); + List newPosters = results.nonNulls.expand((element) => element.items).toList(); if (state.views.included.length > 1) { if (state.sortingOption == SortingOptions.random) { newPosters = newPosters.random(); @@ -220,7 +220,7 @@ class LibrarySearchNotifier extends StateNotifier { var tempState = state.copyWith(); final genres = mappedList .expand((element) => element?.genres ?? []) - .whereNotNull() + .nonNulls .sorted((a, b) => a.name!.toLowerCase().compareTo(b.name!.toLowerCase())); final tags = mappedList .expand((element) => element?.tags ?? []) @@ -437,7 +437,7 @@ class LibrarySearchNotifier extends StateNotifier { final response = await api.collectionsCollectionIdItemsDelete( collectionId: state.nestedCurrentItem?.id, ids: state.selectedPosters.map((e) => e.id).toList()); if (response.isSuccessful) { - removeFromPosters([state.nestedCurrentItem?.id].whereNotNull().toList()); + removeFromPosters([state.nestedCurrentItem?.id].nonNulls.toList()); } return response; } @@ -445,9 +445,9 @@ class LibrarySearchNotifier extends StateNotifier { Future removeSelectedFromPlaylist() async { final response = await api.playlistsPlaylistIdItemsDelete( playlistId: state.nestedCurrentItem?.id, - entryIds: state.selectedPosters.map((e) => e.playlistId).whereNotNull().toList()); + entryIds: state.selectedPosters.map((e) => e.playlistId).nonNulls.toList()); if (response.isSuccessful) { - removeFromPosters([state.nestedCurrentItem?.id].whereNotNull().toList()); + removeFromPosters([state.nestedCurrentItem?.id].nonNulls.toList()); } return response; } @@ -463,7 +463,7 @@ class LibrarySearchNotifier extends StateNotifier { Future removeFromPlaylist({required List items}) async { final response = await api.playlistsPlaylistIdItemsDelete( - playlistId: state.nestedCurrentItem?.id, entryIds: items.map((e) => e.playlistId).whereNotNull().toList()); + playlistId: state.nestedCurrentItem?.id, entryIds: items.map((e) => e.playlistId).nonNulls.toList()); if (response.isSuccessful) { removeFromPosters(items.map((e) => e.id).toList()); } @@ -489,7 +489,7 @@ class LibrarySearchNotifier extends StateNotifier { void updateUserDataMain(UserData? userData) { state = state.copyWith( - folderOverwrite: [state.folderOverwrite.lastOrNull?.copyWith(userData: userData)].whereNotNull().toList(), + folderOverwrite: [state.folderOverwrite.lastOrNull?.copyWith(userData: userData)].nonNulls.toList(), ); } @@ -529,10 +529,10 @@ class LibrarySearchNotifier extends StateNotifier { limit: limit, ); return libraryItems; - }).whereNotNull(), + }).nonNulls, ); - List newPosters = results.whereNotNull().expand((element) => element.items).toList(); + List newPosters = results.nonNulls.expand((element) => element.items).toList(); if (state.views.included.length > 1) { if (shuffle || state.sortingOption == SortingOptions.random) { newPosters = newPosters.random(); diff --git a/lib/providers/settings/book_viewer_settings_provider.dart b/lib/providers/settings/book_viewer_settings_provider.dart index a16bf56..c5eb4b3 100644 --- a/lib/providers/settings/book_viewer_settings_provider.dart +++ b/lib/providers/settings/book_viewer_settings_provider.dart @@ -1,7 +1,8 @@ import 'dart:convert'; -import 'package:collection/collection.dart'; import 'package:flutter/widgets.dart'; + +import 'package:collection/collection.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:screen_brightness/screen_brightness.dart'; @@ -124,15 +125,15 @@ class BookViewerSettingsNotifier extends StateNotifier screenBrightness: () => value, ); if (state.screenBrightness != null) { - ScreenBrightness().setScreenBrightness(state.screenBrightness!); + ScreenBrightness().setSystemScreenBrightness(state.screenBrightness!); } else { - ScreenBrightness().resetScreenBrightness(); + ScreenBrightness().resetApplicationScreenBrightness(); } } void setSavedBrightness() { if (state.screenBrightness != null) { - ScreenBrightness().setScreenBrightness(state.screenBrightness!); + ScreenBrightness().setSystemScreenBrightness(state.screenBrightness!); } } diff --git a/lib/providers/settings/subtitle_settings_provider.dart b/lib/providers/settings/subtitle_settings_provider.dart index b3271d0..98bf569 100644 --- a/lib/providers/settings/subtitle_settings_provider.dart +++ b/lib/providers/settings/subtitle_settings_provider.dart @@ -34,7 +34,7 @@ class SubtitleSettingsNotifier extends StateNotifier { void setFontWeight(FontWeight? value) => state = state.copyWith(fontWeight: value); SubtitleSettingsModel setBackGroundOpacity(double value) => - state = state.copyWith(backGroundColor: state.backGroundColor.withOpacity(value)); + state = state.copyWith(backGroundColor: state.backGroundColor.withValues(alpha: value)); SubtitleSettingsModel setShadowIntensity(double value) => state = state.copyWith(shadow: value); } diff --git a/lib/providers/settings/video_player_settings_provider.dart b/lib/providers/settings/video_player_settings_provider.dart index 0d7e7e5..eb691d3 100644 --- a/lib/providers/settings/video_player_settings_provider.dart +++ b/lib/providers/settings/video_player_settings_provider.dart @@ -33,15 +33,15 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier { return data.copyWith( primary: () => primary, logo: () => logo, - backDrop: () => backdrops.whereNotNull().toList(), + backDrop: () => backdrops.nonNulls.toList(), ); } @@ -381,7 +381,7 @@ class SyncNotifier extends StateNotifier { imageUrl: path.joinAll(["Chapters", fileName]), ); }).toList(); - return saveChapters.whereNotNull().toList(); + return saveChapters.nonNulls.toList(); } Future urlDataToFileData(ImageData? data, Directory directory, String fileName) async { diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index 112e403..2735e37 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -1,5 +1,6 @@ import 'package:chopper/chopper.dart'; import 'package:collection/collection.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:fladder/jellyfin/enum_models.dart'; @@ -14,7 +15,7 @@ import 'package:fladder/providers/sync_provider.dart'; part 'user_provider.g.dart'; @riverpod -bool showSyncButtonProvider(ShowSyncButtonProviderRef ref) { +bool showSyncButtonProvider(Ref ref) { final userCanSync = ref.watch(userProvider.select((value) => value?.canDownload ?? false)); final hasSyncedItems = ref.watch(syncProvider.select((value) => value.items.isNotEmpty)); return userCanSync || hasSyncedItems; diff --git a/lib/routes/nested_details_screen.dart b/lib/routes/nested_details_screen.dart index e545855..d037e3d 100644 --- a/lib/routes/nested_details_screen.dart +++ b/lib/routes/nested_details_screen.dart @@ -69,7 +69,7 @@ class _DetailsScreenState extends ConsumerState { tag: widget.id, child: Container( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface.withOpacity(1.0), + color: Theme.of(context).colorScheme.surface.withValues(alpha: 1.0), ), //Small offset to match detailscaffold child: Transform.translate( diff --git a/lib/screens/book_viewer/book_viewer_controls.dart b/lib/screens/book_viewer/book_viewer_controls.dart index dd1d121..f2a9ead 100644 --- a/lib/screens/book_viewer/book_viewer_controls.dart +++ b/lib/screens/book_viewer/book_viewer_controls.dart @@ -81,7 +81,7 @@ class _BookViewerControlsState extends ConsumerState { @override void dispose() { WakelockPlus.disable(); - ScreenBrightness().resetScreenBrightness(); + ScreenBrightness().resetApplicationScreenBrightness(); SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: []); SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarColor: Colors.transparent, @@ -150,9 +150,9 @@ class _BookViewerControlsState extends ConsumerState { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - overlayColor.withOpacity(1), - overlayColor.withOpacity(0.65), - overlayColor.withOpacity(0), + overlayColor.withValues(alpha: 1), + overlayColor.withValues(alpha: 0.65), + overlayColor.withValues(alpha: 0), ], ), ), @@ -198,9 +198,9 @@ class _BookViewerControlsState extends ConsumerState { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - overlayColor.withOpacity(0), - overlayColor.withOpacity(0.65), - overlayColor.withOpacity(1), + overlayColor.withValues(alpha: 0), + overlayColor.withValues(alpha: 0.65), + overlayColor.withValues(alpha: 1), ], ), ), @@ -236,7 +236,7 @@ class _BookViewerControlsState extends ConsumerState { Flexible( child: Container( decoration: BoxDecoration( - color: Colors.black.withOpacity(0.7), + color: Colors.black.withValues(alpha: 0.7), borderRadius: BorderRadius.circular(60), ), child: Padding( diff --git a/lib/screens/crash_screen/crash_screen.dart b/lib/screens/crash_screen/crash_screen.dart index 88cfcfa..3ebfa1e 100644 --- a/lib/screens/crash_screen/crash_screen.dart +++ b/lib/screens/crash_screen/crash_screen.dart @@ -78,7 +78,7 @@ class CrashScreen extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Card( - color: e.color.withOpacity(0.1), + color: e.color.withValues(alpha: 0.1), margin: const EdgeInsets.symmetric(vertical: 12), child: Padding( padding: const EdgeInsets.all(8), @@ -90,7 +90,7 @@ class CrashScreen extends ConsumerWidget { children: [ Expanded( child: Card( - color: e.color.withOpacity(0.2), + color: e.color.withValues(alpha: 0.2), child: Padding( padding: const EdgeInsets.all(4.0), child: Text( diff --git a/lib/screens/dashboard/dashboard_screen.dart b/lib/screens/dashboard/dashboard_screen.dart index 927d66e..459b246 100644 --- a/lib/screens/dashboard/dashboard_screen.dart +++ b/lib/screens/dashboard/dashboard_screen.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:auto_route/auto_route.dart'; -import 'package:collection/collection.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:fladder/jellyfin/jellyfin_open_api.enums.swagger.dart'; @@ -179,7 +178,7 @@ class _DashboardScreenState extends ConsumerState { posters: view.recentlyAdded, ), )), - ].whereNotNull().toList().addInBetween(const SliverToBoxAdapter(child: SizedBox(height: 16))), + ].nonNulls.toList().addInBetween(const SliverToBoxAdapter(child: SizedBox(height: 16))), const DefautlSliverBottomPadding(), ], ), diff --git a/lib/screens/details_screens/book_detail_screen.dart b/lib/screens/details_screens/book_detail_screen.dart index 286229c..78fe3f6 100644 --- a/lib/screens/details_screens/book_detail_screen.dart +++ b/lib/screens/details_screens/book_detail_screen.dart @@ -56,7 +56,7 @@ class _BookDetailScreenState extends ConsumerState { } }, ), - backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.8), + backgroundColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0.8), onRefresh: () async => await ref.read(provider.notifier).fetchDetails(widget.item), backDrops: details.cover, content: (padding) => details.book != null diff --git a/lib/screens/details_screens/components/label_title_item.dart b/lib/screens/details_screens/components/label_title_item.dart index 69a7ebe..0c5f13e 100644 --- a/lib/screens/details_screens/components/label_title_item.dart +++ b/lib/screens/details_screens/components/label_title_item.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:collection/collection.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class LabelTitleItem extends ConsumerWidget { @@ -32,7 +31,7 @@ class LabelTitleItem extends ConsumerWidget { label!, ) : content!, - ].whereNotNull().toList(), + ].nonNulls.toList(), ), ); } diff --git a/lib/screens/details_screens/empty_item.dart b/lib/screens/details_screens/empty_item.dart index 53339b8..795a198 100644 --- a/lib/screens/details_screens/empty_item.dart +++ b/lib/screens/details_screens/empty_item.dart @@ -50,7 +50,7 @@ class EmptyItem extends ConsumerWidget { shape: RoundedRectangleBorder( side: BorderSide( width: 1.0, - color: Colors.white.withOpacity(0.10), + color: Colors.white.withValues(alpha: 0.10), ), borderRadius: FladderTheme.defaultShape.borderRadius, ), diff --git a/lib/screens/details_screens/person_detail_screen.dart b/lib/screens/details_screens/person_detail_screen.dart index d37c6c7..9ca4433 100644 --- a/lib/screens/details_screens/person_detail_screen.dart +++ b/lib/screens/details_screens/person_detail_screen.dart @@ -1,4 +1,9 @@ +import 'package:flutter/material.dart'; + import 'package:collection/collection.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:intl/intl.dart'; + import 'package:fladder/models/items/item_shared_models.dart'; import 'package:fladder/providers/items/person_details_provider.dart'; import 'package:fladder/providers/user_provider.dart'; @@ -11,9 +16,6 @@ import 'package:fladder/util/list_extensions.dart'; import 'package:fladder/util/string_extensions.dart'; import 'package:fladder/util/widget_extensions.dart'; import 'package:fladder/widgets/shared/selectable_icon_button.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:intl/intl.dart'; class PersonDetailScreen extends ConsumerStatefulWidget { final Person person; @@ -37,6 +39,7 @@ class _PersonDetailScreenState extends ConsumerState { backDrops: [...?details?.movies, ...?details?.series].random().firstOrNull?.images, content: (padding) => Column( mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: MediaQuery.of(context).size.height / 6), Padding( @@ -89,10 +92,6 @@ class _PersonDetailScreenState extends ConsumerState { Text("Birthday: ${DateFormat.yMEd().format(details?.dateOfBirth ?? DateTime.now()).toString()}"), if (details?.age != null) Text("Age: ${details?.age}"), if (details?.birthPlace.isEmpty == false) Text("Born in ${details?.birthPlace.join(",")}"), - if (details?.overview.externalUrls?.isNotEmpty ?? false) - ExternalUrlsRow( - urls: details?.overview.externalUrls, - ).padding(padding), ], ), ], @@ -102,7 +101,11 @@ class _PersonDetailScreenState extends ConsumerState { if (details?.movies.isNotEmpty ?? false) PosterRow(contentPadding: padding, posters: details?.movies ?? [], label: "Movies"), if (details?.series.isNotEmpty ?? false) - PosterRow(contentPadding: padding, posters: details?.series ?? [], label: "Series") + PosterRow(contentPadding: padding, posters: details?.series ?? [], label: "Series"), + if (details?.overview.externalUrls?.isNotEmpty ?? false) + ExternalUrlsRow( + urls: details?.overview.externalUrls, + ).padding(padding), ], ), ); diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 8db6f38..45e82e6 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:auto_route/auto_route.dart'; -import 'package:collection/collection.dart'; import 'package:ficonsax/ficonsax.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -76,7 +75,7 @@ class HomeScreen extends ConsumerWidget { child: AutoRouter( builder: (context, child) { return NavigationScaffold( - destinations: destinations.whereNotNull().toList(), + destinations: destinations.nonNulls.toList(), currentRouteName: context.router.current.name, nestedChild: child, ); diff --git a/lib/screens/library_search/library_search_screen.dart b/lib/screens/library_search/library_search_screen.dart index 473ddc3..0c66d16 100644 --- a/lib/screens/library_search/library_search_screen.dart +++ b/lib/screens/library_search/library_search_screen.dart @@ -515,7 +515,7 @@ class _LibrarySearchScreenState extends ConsumerState { ), if (librarySearchResults.fetchingItems) ...[ Container( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), ), Center( child: Container( diff --git a/lib/screens/library_search/widgets/library_saved_filters.dart b/lib/screens/library_search/widgets/library_saved_filters.dart index ad2db96..e19cb28 100644 --- a/lib/screens/library_search/widgets/library_saved_filters.dart +++ b/lib/screens/library_search/widgets/library_saved_filters.dart @@ -71,7 +71,9 @@ class LibrarySavedFiltersDialogue extends ConsumerWidget { tooltip: context.localized.defaultFilterForLibrary, style: ButtonStyle( backgroundColor: WidgetStatePropertyAll( - filter.isFavourite ? Colors.yellowAccent.shade700.withOpacity(0.5) : null, + filter.isFavourite + ? Colors.yellowAccent.shade700.withValues(alpha: 0.5) + : null, ), ), onPressed: () => @@ -107,6 +109,8 @@ class LibrarySavedFiltersDialogue extends ConsumerWidget { style: ButtonStyle( backgroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.errorContainer), + iconColor: + WidgetStatePropertyAll(Theme.of(context).colorScheme.onErrorContainer), foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onErrorContainer), ), diff --git a/lib/screens/login/login_edit_user.dart b/lib/screens/login/login_edit_user.dart index c5ea1bb..ac96135 100644 --- a/lib/screens/login/login_edit_user.dart +++ b/lib/screens/login/login_edit_user.dart @@ -80,6 +80,7 @@ class LoginEditUser extends ConsumerWidget { child: ElevatedButton.icon( style: ElevatedButton.styleFrom( backgroundColor: Colors.red, + iconColor: Colors.white, foregroundColor: Colors.white, ), onPressed: () async { diff --git a/lib/screens/photo_viewer/photo_viewer_controls.dart b/lib/screens/photo_viewer/photo_viewer_controls.dart index 92b060e..5b3db22 100644 --- a/lib/screens/photo_viewer/photo_viewer_controls.dart +++ b/lib/screens/photo_viewer/photo_viewer_controls.dart @@ -136,10 +136,10 @@ class _PhotoViewerControllsState extends ConsumerState with @override Widget build(BuildContext context) { final gradient = [ - Colors.black.withOpacity(0.6), - Colors.black.withOpacity(0.3), - Colors.black.withOpacity(0.1), - Colors.black.withOpacity(0.0), + Colors.black.withValues(alpha: 0.6), + Colors.black.withValues(alpha: 0.3), + Colors.black.withValues(alpha: 0.1), + Colors.black.withValues(alpha: 0.0), ]; final padding = MediaQuery.of(context).padding; @@ -188,9 +188,12 @@ class _PhotoViewerControllsState extends ConsumerState with .textTheme .titleMedium ?.copyWith(fontWeight: FontWeight.bold, shadows: [ - BoxShadow(blurRadius: 1, spreadRadius: 1, color: Colors.black.withOpacity(0.7)), - BoxShadow(blurRadius: 4, spreadRadius: 4, color: Colors.black.withOpacity(0.4)), - BoxShadow(blurRadius: 20, spreadRadius: 6, color: Colors.black.withOpacity(0.2)), + BoxShadow( + blurRadius: 1, spreadRadius: 1, color: Colors.black.withValues(alpha: 0.7)), + BoxShadow( + blurRadius: 4, spreadRadius: 4, color: Colors.black.withValues(alpha: 0.4)), + BoxShadow( + blurRadius: 20, spreadRadius: 6, color: Colors.black.withValues(alpha: 0.2)), ]), ), ), diff --git a/lib/screens/photo_viewer/photo_viewer_screen.dart b/lib/screens/photo_viewer/photo_viewer_screen.dart index 3aa22f2..577bd63 100644 --- a/lib/screens/photo_viewer/photo_viewer_screen.dart +++ b/lib/screens/photo_viewer/photo_viewer_screen.dart @@ -384,8 +384,8 @@ class _PhotoViewerScreenState extends ConsumerState with Widg begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Colors.black.withOpacity(0.5), - Colors.black.withOpacity(0), + Colors.black.withValues(alpha: 0.5), + Colors.black.withValues(alpha: 0), ], ), ), diff --git a/lib/screens/photo_viewer/simple_video_player.dart b/lib/screens/photo_viewer/simple_video_player.dart index 771745d..5e1edae 100644 --- a/lib/screens/photo_viewer/simple_video_player.dart +++ b/lib/screens/photo_viewer/simple_video_player.dart @@ -226,7 +226,8 @@ class _SimpleVideoPlayerState extends ConsumerState with Wind icon: Icon( player.lastState.playing ? IconsaxBold.pause_circle : IconsaxBold.play_circle, shadows: [ - BoxShadow(blurRadius: 16, spreadRadius: 2, color: Colors.black.withOpacity(0.15)) + BoxShadow( + blurRadius: 16, spreadRadius: 2, color: Colors.black.withValues(alpha: 0.15)) ], ), ) diff --git a/lib/screens/settings/settings_list_tile.dart b/lib/screens/settings/settings_list_tile.dart index 0490e3c..92f112c 100644 --- a/lib/screens/settings/settings_list_tile.dart +++ b/lib/screens/settings/settings_list_tile.dart @@ -47,7 +47,7 @@ class SettingsListTile extends StatelessWidget { child: AnimatedContainer( duration: const Duration(milliseconds: 125), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primaryContainer.withOpacity(selected ? 1 : 0), + color: Theme.of(context).colorScheme.primaryContainer.withValues(alpha: selected ? 1 : 0), borderRadius: BorderRadius.circular(selected ? 5 : 20), ), child: Padding( diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart index 0a6b52a..55fbce6 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/settings_screen.dart @@ -95,7 +95,7 @@ class _SettingsScreenState extends ConsumerState { padding: const EdgeInsets.all(16.0), child: IconButton.filledTonal( style: IconButton.styleFrom( - backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.8), + backgroundColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0.8), ), onPressed: () => context.router.popBack(), icon: Padding( @@ -188,6 +188,7 @@ class _SettingsScreenState extends ConsumerState { ), ElevatedButton( style: ElevatedButton.styleFrom().copyWith( + iconColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onErrorContainer), foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onErrorContainer), backgroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.errorContainer), ), diff --git a/lib/screens/shared/default_alert_dialog.dart b/lib/screens/shared/default_alert_dialog.dart index 5228bb3..74e07cd 100644 --- a/lib/screens/shared/default_alert_dialog.dart +++ b/lib/screens/shared/default_alert_dialog.dart @@ -27,6 +27,7 @@ Future showDefaultAlertDialog( style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.errorContainer, foregroundColor: Theme.of(context).colorScheme.onErrorContainer, + iconColor: Theme.of(context).colorScheme.onErrorContainer, ), onPressed: () => accept.call(context), child: Text(acceptTitle ?? "Accept"), @@ -61,6 +62,7 @@ Future showDefaultActionDialog( style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.primaryContainer, foregroundColor: Theme.of(context).colorScheme.onPrimaryContainer, + iconColor: Theme.of(context).colorScheme.onPrimaryContainer, ), onPressed: () => accept.call(context), child: Text(acceptTitle ?? "Accept"), diff --git a/lib/screens/shared/default_title_bar.dart b/lib/screens/shared/default_title_bar.dart index 620daa4..73fa6af 100644 --- a/lib/screens/shared/default_title_bar.dart +++ b/lib/screens/shared/default_title_bar.dart @@ -33,12 +33,13 @@ class _DefaultTitleBarState extends ConsumerState with WindowLi final brightness = widget.brightness ?? Theme.of(context).brightness; final shadows = brightness == Brightness.dark ? [ - BoxShadow(blurRadius: 1, spreadRadius: 1, color: Theme.of(context).colorScheme.surface.withOpacity(1)), - BoxShadow(blurRadius: 8, spreadRadius: 2, color: Colors.black.withOpacity(0.2)), - BoxShadow(blurRadius: 3, spreadRadius: 2, color: Colors.black.withOpacity(0.3)), + BoxShadow( + blurRadius: 1, spreadRadius: 1, color: Theme.of(context).colorScheme.surface.withValues(alpha: 1)), + BoxShadow(blurRadius: 8, spreadRadius: 2, color: Colors.black.withValues(alpha: 0.2)), + BoxShadow(blurRadius: 3, spreadRadius: 2, color: Colors.black.withValues(alpha: 0.3)), ] : []; - final iconColor = Theme.of(context).colorScheme.onSurface.withOpacity(0.65); + final iconColor = Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.65); return SizedBox( height: widget.height, child: switch (AdaptiveLayout.of(context).platform) { @@ -47,7 +48,7 @@ class _DefaultTitleBarState extends ConsumerState with WindowLi children: [ Expanded( child: Container( - color: Colors.black.withOpacity(0), + color: Colors.black.withValues(alpha: 0), child: DragToMoveArea( child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -77,8 +78,8 @@ class _DefaultTitleBarState extends ConsumerState with WindowLi return IconButton( style: IconButton.styleFrom( hoverColor: brightness == Brightness.light - ? Colors.black.withOpacity(0.1) - : Colors.white.withOpacity(0.2), + ? Colors.black.withValues(alpha: 0.1) + : Colors.white.withValues(alpha: 0.2), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2))), onPressed: () async { if (isMinimized) { @@ -110,8 +111,8 @@ class _DefaultTitleBarState extends ConsumerState with WindowLi return IconButton( style: IconButton.styleFrom( hoverColor: brightness == Brightness.light - ? Colors.black.withOpacity(0.1) - : Colors.white.withOpacity(0.2), + ? Colors.black.withValues(alpha: 0.1) + : Colors.white.withValues(alpha: 0.2), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)), ), onPressed: () async { diff --git a/lib/screens/shared/detail_scaffold.dart b/lib/screens/shared/detail_scaffold.dart index fed3e1b..59f99c7 100644 --- a/lib/screens/shared/detail_scaffold.dart +++ b/lib/screens/shared/detail_scaffold.dart @@ -62,7 +62,7 @@ class _DetailScaffoldState extends ConsumerState { @override Widget build(BuildContext context) { final padding = EdgeInsets.symmetric(horizontal: MediaQuery.sizeOf(context).width / 25); - final backGroundColor = Theme.of(context).colorScheme.surface.withOpacity(0.8); + final backGroundColor = Theme.of(context).colorScheme.surface.withValues(alpha: 0.8); final playerState = ref.watch(mediaPlaybackProvider.select((value) => value.state)); final minHeight = 450.0.clamp(0, MediaQuery.sizeOf(context).height).toDouble(); final maxHeight = MediaQuery.sizeOf(context).height - 10; @@ -114,7 +114,7 @@ class _DetailScaffoldState extends ConsumerState { Colors.white, Colors.white, Colors.white, - Colors.white.withOpacity(0), + Colors.white.withValues(alpha: 0), ], ).createShader(bounds), child: ConstrainedBox( @@ -145,10 +145,10 @@ class _DetailScaffoldState extends ConsumerState { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Theme.of(context).colorScheme.surface.withOpacity(0), - Theme.of(context).colorScheme.surface.withOpacity(0.10), - Theme.of(context).colorScheme.surface.withOpacity(0.35), - Theme.of(context).colorScheme.surface.withOpacity(0.85), + Theme.of(context).colorScheme.surface.withValues(alpha: 0), + Theme.of(context).colorScheme.surface.withValues(alpha: 0.10), + Theme.of(context).colorScheme.surface.withValues(alpha: 0.35), + Theme.of(context).colorScheme.surface.withValues(alpha: 0.85), Theme.of(context).colorScheme.surface, ], ), diff --git a/lib/screens/shared/file_picker.dart b/lib/screens/shared/file_picker.dart index c9d5622..659313e 100644 --- a/lib/screens/shared/file_picker.dart +++ b/lib/screens/shared/file_picker.dart @@ -59,7 +59,7 @@ class _FilePickerBarState extends ConsumerState { @override Widget build(BuildContext context) { final offColor = Theme.of(context).colorScheme.secondaryContainer; - final onColor = Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.7); + final onColor = Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.7); final contentColor = Theme.of(context).colorScheme.onSecondaryContainer; return DropTarget( enable: !inputField, diff --git a/lib/screens/shared/flat_button.dart b/lib/screens/shared/flat_button.dart index 633271f..c943d79 100644 --- a/lib/screens/shared/flat_button.dart +++ b/lib/screens/shared/flat_button.dart @@ -47,7 +47,7 @@ class FlatButton extends ConsumerWidget { onDoubleTap: onDoubleTap, onSecondaryTapDown: onSecondaryTapDown, borderRadius: borderRadiusGeometry ?? BorderRadius.circular(10), - splashColor: splashColor ?? Theme.of(context).colorScheme.primary.withOpacity(0.5), + splashColor: splashColor ?? Theme.of(context).colorScheme.primary.withValues(alpha: 0.5), hoverColor: showFeedback ? null : Colors.transparent, splashFactory: InkSparkle.splashFactory, ), diff --git a/lib/screens/shared/input_fields.dart b/lib/screens/shared/input_fields.dart index 30f9a39..315491e 100644 --- a/lib/screens/shared/input_fields.dart +++ b/lib/screens/shared/input_fields.dart @@ -20,7 +20,7 @@ class IntInputField extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return Card( - color: Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.25), + color: Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.25), elevation: 0, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 6), diff --git a/lib/screens/shared/media/carousel_banner.dart b/lib/screens/shared/media/carousel_banner.dart index d448c8b..7bcd8cc 100644 --- a/lib/screens/shared/media/carousel_banner.dart +++ b/lib/screens/shared/media/carousel_banner.dart @@ -69,7 +69,7 @@ class _CarouselBannerState extends ConsumerState { begin: Alignment.bottomLeft, end: Alignment.topCenter, colors: [ - ThemesData.of(context).dark.colorScheme.primaryContainer.withOpacity(0.85), + ThemesData.of(context).dark.colorScheme.primaryContainer.withValues(alpha: 0.85), Colors.transparent, ], ), @@ -144,7 +144,7 @@ class _CarouselBannerState extends ConsumerState { child: Container( decoration: BoxDecoration( border: Border.all( - color: Colors.white.withOpacity(0.1), + color: Colors.white.withValues(alpha: 0.1), width: 1.0, ), borderRadius: border), diff --git a/lib/screens/shared/media/chapter_row.dart b/lib/screens/shared/media/chapter_row.dart index 1e306da..83d0e48 100644 --- a/lib/screens/shared/media/chapter_row.dart +++ b/lib/screens/shared/media/chapter_row.dart @@ -52,7 +52,7 @@ class ChapterRow extends ConsumerWidget { child: Card( elevation: 0, shadowColor: Colors.transparent, - color: Theme.of(context).cardColor.withOpacity(0.4), + color: Theme.of(context).cardColor.withValues(alpha: 0.4), child: Padding( padding: const EdgeInsets.all(5), child: Text( diff --git a/lib/screens/shared/media/components/chip_button.dart b/lib/screens/shared/media/components/chip_button.dart index 13b5355..f515631 100644 --- a/lib/screens/shared/media/components/chip_button.dart +++ b/lib/screens/shared/media/components/chip_button.dart @@ -12,7 +12,7 @@ class ChipButton extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return Card( - color: Theme.of(context).colorScheme.onSurface.withOpacity(0.15), + color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.15), shadowColor: Colors.transparent, child: FlatButton( onTap: onPressed, diff --git a/lib/screens/shared/media/components/media_header.dart b/lib/screens/shared/media/components/media_header.dart index 48829e5..4562fbe 100644 --- a/lib/screens/shared/media/components/media_header.dart +++ b/lib/screens/shared/media/components/media_header.dart @@ -35,7 +35,7 @@ class MediaHeader extends ConsumerWidget { child: Material( elevation: 30, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(150)), - shadowColor: Colors.black.withOpacity(0.3), + shadowColor: Colors.black.withValues(alpha: 0.3), color: Colors.transparent, child: ConstrainedBox( constraints: BoxConstraints( diff --git a/lib/screens/shared/media/components/media_play_button.dart b/lib/screens/shared/media/components/media_play_button.dart index edba27a..78a45ec 100644 --- a/lib/screens/shared/media/components/media_play_button.dart +++ b/lib/screens/shared/media/components/media_play_button.dart @@ -67,6 +67,7 @@ class MediaPlayButton extends ConsumerWidget { ButtonStyle( backgroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.primary), foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onPrimary), + iconColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onPrimary), ), Theme.of(context).colorScheme.onPrimary, ), diff --git a/lib/screens/shared/media/components/poster_image.dart b/lib/screens/shared/media/components/poster_image.dart index 00ccefc..9cf1f22 100644 --- a/lib/screens/shared/media/components/poster_image.dart +++ b/lib/screens/shared/media/components/poster_image.dart @@ -99,7 +99,7 @@ class _PosterImageState extends ConsumerState { shape: RoundedRectangleBorder( side: BorderSide( width: 1.0, - color: Colors.white.withOpacity(0.10), + color: Colors.white.withValues(alpha: 0.10), ), borderRadius: FladderTheme.defaultShape.borderRadius, ), @@ -133,7 +133,7 @@ class _PosterImageState extends ConsumerState { if (widget.selected == true) Container( decoration: BoxDecoration( - color: Colors.black.withOpacity(0.15), + color: Colors.black.withValues(alpha: 0.15), border: Border.all(width: 3, color: Theme.of(context).colorScheme.primary), borderRadius: FladderTheme.defaultShape.borderRadius, ), @@ -191,7 +191,7 @@ class _PosterImageState extends ConsumerState { shadowColor: Colors.transparent, child: LinearProgressIndicator( minHeight: 7.5, - backgroundColor: Theme.of(context).colorScheme.onPrimary.withOpacity(0.5), + backgroundColor: Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.5), value: poster.userData.progress / 100, borderRadius: BorderRadius.circular(2), ), @@ -213,7 +213,7 @@ class _PosterImageState extends ConsumerState { //Hover color overlay Container( decoration: BoxDecoration( - color: Colors.black.withOpacity(0.55), + color: Colors.black.withValues(alpha: 0.55), border: Border.all(width: 3, color: Theme.of(context).colorScheme.primary), borderRadius: FladderTheme.defaultShape.borderRadius, )), diff --git a/lib/screens/shared/media/episode_posters.dart b/lib/screens/shared/media/episode_posters.dart index 24d1ee3..7e60d29 100644 --- a/lib/screens/shared/media/episode_posters.dart +++ b/lib/screens/shared/media/episode_posters.dart @@ -231,7 +231,7 @@ class EpisodePoster extends ConsumerWidget { alignment: Alignment.bottomCenter, child: LinearProgressIndicator( minHeight: 6, - backgroundColor: Colors.black.withOpacity(0.75), + backgroundColor: Colors.black.withValues(alpha: 0.75), value: episode.userData.progress / 100, ), ), @@ -260,7 +260,7 @@ class EpisodePoster extends ConsumerWidget { Icons.more_vert, color: Colors.white, shadows: [ - Shadow(color: Colors.black.withOpacity(0.45), blurRadius: 8.0), + Shadow(color: Colors.black.withValues(alpha: 0.45), blurRadius: 8.0), const Shadow(color: Colors.black, blurRadius: 16.0), const Shadow(color: Colors.black, blurRadius: 32.0), const Shadow(color: Colors.black, blurRadius: 64.0), diff --git a/lib/screens/shared/media/expanding_overview.dart b/lib/screens/shared/media/expanding_overview.dart index 1567e02..28b6503 100644 --- a/lib/screens/shared/media/expanding_overview.dart +++ b/lib/screens/shared/media/expanding_overview.dart @@ -44,11 +44,12 @@ class _ExpandingOverviewState extends ConsumerState { stops: const [0, 1], colors: [ color, - color.withOpacity(!canExpand - ? 1 - : expanded + color.withValues( + alpha: !canExpand ? 1 - : 0), + : expanded + ? 1 + : 0), ], ).createShader(bounds), child: HtmlWidget( diff --git a/lib/screens/shared/media/media_banner.dart b/lib/screens/shared/media/media_banner.dart index 9e9c897..d8e4ca7 100644 --- a/lib/screens/shared/media/media_banner.dart +++ b/lib/screens/shared/media/media_banner.dart @@ -141,12 +141,13 @@ class _MediaBannerState extends ConsumerState { foregroundDecoration: BoxDecoration( borderRadius: BorderRadius.circular(14), border: Border.all( - color: Colors.white.withOpacity(0.10), strokeAlign: BorderSide.strokeAlignInside), + color: Colors.white.withValues(alpha: 0.10), + strokeAlign: BorderSide.strokeAlignInside), gradient: LinearGradient( begin: Alignment.bottomLeft, end: Alignment.topCenter, colors: [ - overlayColor.withOpacity(0.85), + overlayColor.withValues(alpha: 0.85), Colors.transparent, ], ), @@ -238,7 +239,7 @@ class _MediaBannerState extends ConsumerState { maxLines: 2, style: Theme.of(context).textTheme.titleMedium?.copyWith( shadows: shadows, - color: Colors.white.withOpacity(0.75), + color: Colors.white.withValues(alpha: 0.75), ), ), ), diff --git a/lib/screens/shared/media/poster_list_item.dart b/lib/screens/shared/media/poster_list_item.dart index df4bdad..1305700 100644 --- a/lib/screens/shared/media/poster_list_item.dart +++ b/lib/screens/shared/media/poster_list_item.dart @@ -61,7 +61,7 @@ class PosterListItem extends ConsumerWidget { height: 75 * ref.read(clientSettingsProvider.select((value) => value.posterSize)), child: Container( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary.withOpacity(selected == true ? 0.25 : 0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: selected == true ? 0.25 : 0), borderRadius: BorderRadius.circular(6), ), child: FlatButton( diff --git a/lib/screens/shared/media/season_row.dart b/lib/screens/shared/media/season_row.dart index 0d51cd5..6e344c2 100644 --- a/lib/screens/shared/media/season_row.dart +++ b/lib/screens/shared/media/season_row.dart @@ -60,7 +60,7 @@ class SeasonPoster extends ConsumerWidget { padding: const EdgeInsets.all(4), child: Container( child: Card( - color: Theme.of(context).colorScheme.surface.withOpacity(0.65), + color: Theme.of(context).colorScheme.surface.withValues(alpha: 0.65), child: Padding( padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), child: Text( @@ -159,7 +159,7 @@ class SeasonPoster extends ConsumerWidget { Icons.more_vert, color: Colors.white, shadows: [ - Shadow(color: Colors.black.withOpacity(0.45), blurRadius: 8.0), + Shadow(color: Colors.black.withValues(alpha: 0.45), blurRadius: 8.0), const Shadow(color: Colors.black, blurRadius: 16.0), const Shadow(color: Colors.black, blurRadius: 32.0), const Shadow(color: Colors.black, blurRadius: 64.0), diff --git a/lib/screens/shared/outlined_text_field.dart b/lib/screens/shared/outlined_text_field.dart index 10a4e34..cf6c96f 100644 --- a/lib/screens/shared/outlined_text_field.dart +++ b/lib/screens/shared/outlined_text_field.dart @@ -63,7 +63,7 @@ class _OutlinedTextFieldState extends ConsumerState { Color getColor() { if (widget.errorText != null) return Theme.of(context).colorScheme.errorContainer; - return Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.25); + return Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.25); } @override @@ -112,31 +112,31 @@ class _OutlinedTextFieldState extends ConsumerState { decoration: InputDecoration( border: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).colorScheme.primary.withOpacity(0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: 0), width: widget.borderWidth, ), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).colorScheme.primary.withOpacity(0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: 0), width: widget.borderWidth, ), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).colorScheme.primary.withOpacity(0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: 0), width: widget.borderWidth, ), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).colorScheme.primary.withOpacity(0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: 0), width: widget.borderWidth, ), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).colorScheme.primary.withOpacity(0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: 0), width: widget.borderWidth, ), ), diff --git a/lib/screens/syncing/sync_item_details.dart b/lib/screens/syncing/sync_item_details.dart index d7df958..5f1c0a2 100644 --- a/lib/screens/syncing/sync_item_details.dart +++ b/lib/screens/syncing/sync_item_details.dart @@ -153,7 +153,7 @@ class _SyncItemDetailsState extends ConsumerState { CircularProgressIndicator( value: combinedStream.progress, strokeWidth: 8, - backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.5), + backgroundColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0.5), strokeCap: StrokeCap.round, color: combinedStream.status.color(context), ), @@ -212,6 +212,7 @@ class _SyncItemDetailsState extends ConsumerState { style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.errorContainer, foregroundColor: Theme.of(context).colorScheme.onErrorContainer, + iconColor: Theme.of(context).colorScheme.onErrorContainer, ), onPressed: () { showDefaultAlertDialog( diff --git a/lib/screens/syncing/sync_list_item.dart b/lib/screens/syncing/sync_list_item.dart index 1784706..ac5f3a8 100644 --- a/lib/screens/syncing/sync_list_item.dart +++ b/lib/screens/syncing/sync_list_item.dart @@ -35,7 +35,7 @@ class SyncListItemState extends ConsumerState { syncedItem: syncedItem, child: Card( elevation: 1, - color: Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.2), + color: Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.2), shadowColor: Colors.transparent, child: Dismissible( background: Container( diff --git a/lib/screens/syncing/sync_widgets.dart b/lib/screens/syncing/sync_widgets.dart index 2a461fb..4fbfd51 100644 --- a/lib/screens/syncing/sync_widgets.dart +++ b/lib/screens/syncing/sync_widgets.dart @@ -24,7 +24,7 @@ class SyncLabel extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { return Container( decoration: BoxDecoration( - color: status.color.withOpacity(0.15), + color: status.color.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(10), ), child: Padding( @@ -109,7 +109,8 @@ class SyncSubtitle extends ConsumerWidget { final children = syncItem.nestedChildren(ref); final syncStatus = ref.watch(syncStatusesProvider(syncItem)).value ?? SyncStatus.partially; return Container( - decoration: BoxDecoration(color: syncStatus.color.withOpacity(0.15), borderRadius: BorderRadius.circular(10)), + decoration: + BoxDecoration(color: syncStatus.color.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(10)), child: Material( color: const Color.fromARGB(0, 208, 130, 130), textStyle: diff --git a/lib/screens/syncing/widgets/sync_status_overlay.dart b/lib/screens/syncing/widgets/sync_status_overlay.dart index 04d80cf..c1884fd 100644 --- a/lib/screens/syncing/widgets/sync_status_overlay.dart +++ b/lib/screens/syncing/widgets/sync_status_overlay.dart @@ -22,7 +22,7 @@ class SyncStatusOverlay extends ConsumerWidget { child: Card( elevation: 0, semanticContainer: false, - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, @@ -44,7 +44,7 @@ class SyncStatusOverlay extends ConsumerWidget { child: Card( elevation: 0, semanticContainer: false, - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/screens/video_player/components/video_player_next_wrapper.dart b/lib/screens/video_player/components/video_player_next_wrapper.dart index 3928f0a..e8068a3 100644 --- a/lib/screens/video_player/components/video_player_next_wrapper.dart +++ b/lib/screens/video_player/components/video_player_next_wrapper.dart @@ -130,7 +130,7 @@ class _VideoPlayerNextWrapperState extends ConsumerState Future clearOverlaySettings() async { if (AdaptiveLayout.of(context).inputDevice != InputDevice.pointer) { - ScreenBrightness().resetScreenBrightness(); + ScreenBrightness().resetApplicationScreenBrightness(); } else { closeFullScreen(); } @@ -161,7 +161,7 @@ class _VideoPlayerNextWrapperState extends ConsumerState child: Stack( children: [ Container( - color: Theme.of(context).colorScheme.surfaceContainerLowest.withOpacity(0.2), + color: Theme.of(context).colorScheme.surfaceContainerLowest.withValues(alpha: 0.2), ), if (nextUp != null) AnimatedAlign( diff --git a/lib/screens/video_player/components/video_player_options_sheet.dart b/lib/screens/video_player/components/video_player_options_sheet.dart index 273890e..ab89962 100644 --- a/lib/screens/video_player/components/video_player_options_sheet.dart +++ b/lib/screens/video_player/components/video_player_options_sheet.dart @@ -393,7 +393,7 @@ Future showSubSelection(BuildContext context) { final selected = playbackModel.mediaStreams?.defaultSubStreamIndex == subModel.index; return ListTile( title: Text(subModel.label(context)), - tileColor: selected ? Theme.of(context).colorScheme.primary.withOpacity(0.3) : null, + tileColor: selected ? Theme.of(context).colorScheme.primary.withValues(alpha: 0.3) : null, subtitle: subModel.language.isNotEmpty ? Opacity(opacity: 0.6, child: Text(subModel.language.capitalize())) : null, @@ -434,7 +434,7 @@ Future showAudioSelection(BuildContext context) { final selected = playbackModel.mediaStreams?.defaultAudioStreamIndex == audioStream.index; return ListTile( title: Text(audioStream.label(context)), - tileColor: selected ? Theme.of(context).colorScheme.primary.withOpacity(0.3) : null, + tileColor: selected ? Theme.of(context).colorScheme.primary.withValues(alpha: 0.3) : null, subtitle: audioStream.language.isNotEmpty ? Opacity(opacity: 0.6, child: Text(audioStream.language.capitalize())) : null, diff --git a/lib/screens/video_player/components/video_player_seek_indicator.dart b/lib/screens/video_player/components/video_player_seek_indicator.dart index 365cbf9..82babbc 100644 --- a/lib/screens/video_player/components/video_player_seek_indicator.dart +++ b/lib/screens/video_player/components/video_player_seek_indicator.dart @@ -84,7 +84,7 @@ class _VideoPlayerSeekIndicatorState extends ConsumerState { .clamp(1, constraints.maxWidth), height: sliderHeight, child: GappedContainerShape( - activeColor: Theme.of(context).colorScheme.primary.withOpacity(0.5), - inActiveColor: Theme.of(context).colorScheme.primary.withOpacity(0.5), + activeColor: Theme.of(context).colorScheme.primary.withValues(alpha: 0.5), + inActiveColor: Theme.of(context).colorScheme.primary.withValues(alpha: 0.5), thumbPosition: bufferFraction, ), ), @@ -196,7 +195,7 @@ class _ChapterProgressSliderState extends ConsumerState { shape: BoxShape.circle, color: activePosition ? Theme.of(context).colorScheme.onPrimary - : Theme.of(context).colorScheme.onSurface.withOpacity(0.5), + : Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5), ), height: constraints.maxHeight, width: sliderHeight - (activePosition ? 2 : 4), @@ -204,7 +203,7 @@ class _ChapterProgressSliderState extends ConsumerState { ), ); }, - ).whereNotNull(), + ).nonNulls, }, ], ), diff --git a/lib/screens/video_player/components/video_subtitle_controls.dart b/lib/screens/video_player/components/video_subtitle_controls.dart index a9c1837..c881cf4 100644 --- a/lib/screens/video_player/components/video_subtitle_controls.dart +++ b/lib/screens/video_player/components/video_subtitle_controls.dart @@ -15,7 +15,7 @@ Future showSubtitleControls({ }) async { await showDialog( context: context, - barrierColor: Colors.black.withOpacity(0.1), + barrierColor: Colors.black.withValues(alpha: 0.1), builder: (context) => AlertDialog( backgroundColor: Colors.transparent, elevation: 0, @@ -60,7 +60,7 @@ class _VideoSubtitleControlsState extends ConsumerState { duration: const Duration(milliseconds: 250), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), - color: controlsHidden ? Theme.of(context).dialogBackgroundColor.withOpacity(0.75) : Colors.transparent, + color: controlsHidden ? Theme.of(context).dialogBackgroundColor.withValues(alpha: 0.75) : Colors.transparent, ), child: Padding( padding: const EdgeInsets.all(16), @@ -220,8 +220,8 @@ class _VideoSubtitleControlsState extends ConsumerState { const Icon(Icons.border_color_rounded), ...[Colors.white, Colors.yellow, Colors.black, Colors.grey, Colors.transparent].map( (e) => FlatButton( - onTap: () => - provider.setOutlineColor(e == Colors.transparent ? e : e.withOpacity(0.85)), + onTap: () => provider + .setOutlineColor(e == Colors.transparent ? e : e.withValues(alpha: 0.85)), borderRadiusGeometry: BorderRadius.circular(5), clipBehavior: Clip.antiAlias, child: Container( @@ -284,7 +284,7 @@ class _VideoSubtitleControlsState extends ConsumerState { divisions: 20, onChangeStart: (value) => setOpacity(const Key('backGroundOpacity')), onChangeEnd: (value) => setOpacity(null), - value: subSettings.backGroundColor.opacity.clamp(0, 1), + value: subSettings.backGroundColor.a.clamp(0, 1), onChanged: (value) => provider.setBackGroundOpacity(value), ), ), @@ -293,7 +293,7 @@ class _VideoSubtitleControlsState extends ConsumerState { minWidth: 35, ), child: Text( - subSettings.backGroundColor.opacity.toStringAsFixed(2), + subSettings.backGroundColor.a.toStringAsFixed(2), textAlign: TextAlign.center, ), ), diff --git a/lib/screens/video_player/video_player_controls.dart b/lib/screens/video_player/video_player_controls.dart index 1c45765..7a75714 100644 --- a/lib/screens/video_player/video_player_controls.dart +++ b/lib/screens/video_player/video_player_controls.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:async/async.dart'; -import 'package:collection/collection.dart'; import 'package:ficonsax/ficonsax.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:screen_brightness/screen_brightness.dart'; @@ -219,8 +218,8 @@ class _DesktopControlsState extends ConsumerState { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Colors.black.withOpacity(0.8), - Colors.black.withOpacity(0), + Colors.black.withValues(alpha: 0.8), + Colors.black.withValues(alpha: 0), ], )), child: Padding( @@ -276,8 +275,8 @@ class _DesktopControlsState extends ConsumerState { begin: Alignment.bottomCenter, end: Alignment.topCenter, colors: [ - Colors.black.withOpacity(0.8), - Colors.black.withOpacity(0), + Colors.black.withValues(alpha: 0.8), + Colors.black.withValues(alpha: 0), ], )), child: Padding( @@ -425,7 +424,7 @@ class _DesktopControlsState extends ConsumerState { children: [ Expanded( child: Text( - details.whereNotNull().join(' - '), + details.nonNulls.join(' - '), style: Theme.of(context).textTheme.titleMedium?.copyWith( fontWeight: FontWeight.bold, shadows: [ @@ -506,7 +505,7 @@ class _DesktopControlsState extends ConsumerState { textAlign: TextAlign.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - color: Theme.of(context).colorScheme.surface.withOpacity(0.95), + color: Theme.of(context).colorScheme.surface.withValues(alpha: 0.95), ), textStyle: Theme.of(context).textTheme.labelLarge, child: IconButton( @@ -533,7 +532,7 @@ class _DesktopControlsState extends ConsumerState { textAlign: TextAlign.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - color: Theme.of(context).colorScheme.surface.withOpacity(0.95), + color: Theme.of(context).colorScheme.surface.withValues(alpha: 0.95), ), textStyle: Theme.of(context).textTheme.labelLarge, child: IconButton( @@ -625,7 +624,7 @@ class _DesktopControlsState extends ConsumerState { Future clearOverlaySettings() async { toggleOverlay(value: true); if (AdaptiveLayout.of(context).inputDevice != InputDevice.pointer) { - ScreenBrightness().resetScreenBrightness(); + ScreenBrightness().resetApplicationScreenBrightness(); } else { disableFullScreen(); } diff --git a/lib/theme.dart b/lib/theme.dart index 4391ecf..f9b521d 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -114,7 +114,7 @@ class FladderTheme { ), buttonTheme: ButtonThemeData(shape: defaultShape), chipTheme: ChipThemeData( - side: BorderSide(width: 1, color: scheme?.onSurface.withOpacity(0.05) ?? Colors.white), + side: BorderSide(width: 1, color: scheme?.onSurface.withValues(alpha: 0.05) ?? Colors.white), shape: defaultShape, ), popupMenuTheme: PopupMenuThemeData( diff --git a/lib/util/absorb_events.dart b/lib/util/absorb_events.dart index 399c6ac..f17e784 100644 --- a/lib/util/absorb_events.dart +++ b/lib/util/absorb_events.dart @@ -13,7 +13,7 @@ class AbsorbEvents extends ConsumerWidget { onDoubleTap: () {}, onTap: () {}, onLongPress: () {}, - child: Container(color: Colors.black.withOpacity(0), child: child), + child: Container(color: Colors.black.withValues(alpha: 0), child: child), ); } else { return child; diff --git a/lib/util/color_extensions.dart b/lib/util/color_extensions.dart index e934e31..813cef5 100644 --- a/lib/util/color_extensions.dart +++ b/lib/util/color_extensions.dart @@ -2,6 +2,37 @@ import 'package:flutter/material.dart'; import 'package:fladder/util/localization_helper.dart'; +Color? colorFromJson(dynamic color) { + if (color == null) return null; + + if (color is Map) { + return Color.from( + alpha: color['alpha'] ?? 1.0, + red: color['red'] ?? 1.0, + green: color['green'] ?? 1.0, + blue: color['blue'] ?? 1.0, + ); + } + + // Deprecated format (integer value) + if (color is int) { + return Color(color); + } + + return null; +} + +extension ColorExtensions on Color { + Map get toMap { + return { + 'alpha': a, + 'red': r, + 'green': g, + 'blue': b, + }; + } +} + extension DynamicSchemeVariantExtension on DynamicSchemeVariant { String label(BuildContext context) => switch (this) { DynamicSchemeVariant.tonalSpot => context.localized.schemeSettingsTonalSpot, diff --git a/lib/util/debug_banner.dart b/lib/util/debug_banner.dart index 3e4be50..7cfa111 100644 --- a/lib/util/debug_banner.dart +++ b/lib/util/debug_banner.dart @@ -29,7 +29,7 @@ class DebugBanner extends ConsumerWidget { padding: const EdgeInsets.all(4.0), child: Card( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), - color: Colors.purpleAccent.withOpacity(0.8), + color: Colors.purpleAccent.withValues(alpha: 0.8), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), child: Text( diff --git a/lib/util/fab_extended_anim.dart b/lib/util/fab_extended_anim.dart index 920a0f1..dc7e73f 100644 --- a/lib/util/fab_extended_anim.dart +++ b/lib/util/fab_extended_anim.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'package:flutter_riverpod/flutter_riverpod.dart'; class FloatingActionButtonAnimated extends ConsumerWidget { diff --git a/lib/util/humanize_duration.dart b/lib/util/humanize_duration.dart index 64cad1d..d19fad9 100644 --- a/lib/util/humanize_duration.dart +++ b/lib/util/humanize_duration.dart @@ -1,5 +1,3 @@ -import 'package:collection/collection.dart'; - extension DurationExtensions on Duration? { String? get humanize { if (this == null) return null; @@ -7,7 +5,7 @@ extension DurationExtensions on Duration? { final hours = duration.inHours != 0 ? '${duration.inHours.toString()}h' : null; final minutes = duration.inMinutes % 60 != 0 ? '${duration.inMinutes % 60}m'.padLeft(3, '0') : null; final seconds = duration.inSeconds % 60 != 0 ? '${duration.inSeconds % 60}s'.padLeft(3, '0') : null; - final result = [hours, minutes, seconds].whereNotNull().map((e) => e).join(' '); + final result = [hours, minutes, seconds].nonNulls.map((e) => e).join(' '); return result.isNotEmpty ? result : null; } @@ -18,7 +16,7 @@ extension DurationExtensions on Duration? { final minutes = (duration.inMinutes % 60).toString().padLeft(2, '0'); final seconds = (duration.inHours == 0 ? duration.inSeconds % 60 : null)?.toString().padLeft(2, '0'); - final result = [hours, minutes, seconds].whereNotNull().map((e) => e).join(':'); + final result = [hours, minutes, seconds].nonNulls.map((e) => e).join(':'); return result.isNotEmpty ? result : null; } diff --git a/lib/util/keyed_list_view.dart b/lib/util/keyed_list_view.dart index 3aacd22..bf38921 100644 --- a/lib/util/keyed_list_view.dart +++ b/lib/util/keyed_list_view.dart @@ -1,5 +1,6 @@ -import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; + +import 'package:collection/collection.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; @@ -69,9 +70,12 @@ class _KeyedListViewState extends ConsumerState { style: TextButton.styleFrom( padding: EdgeInsets.zero, textStyle: Theme.of(context).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.bold), + iconColor: atPosition + ? Theme.of(context).colorScheme.onSecondary + : Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.35), foregroundColor: atPosition ? Theme.of(context).colorScheme.onSecondary - : Theme.of(context).colorScheme.onSurface.withOpacity(0.35), + : Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.35), ), onPressed: () { itemScrollController.scrollTo( diff --git a/lib/util/mouse_parking.dart b/lib/util/mouse_parking.dart index e6df68d..3dc010e 100644 --- a/lib/util/mouse_parking.dart +++ b/lib/util/mouse_parking.dart @@ -24,7 +24,7 @@ class _MouseParkingState extends ConsumerState { child: Container( decoration: BoxDecoration( borderRadius: const BorderRadius.only(topLeft: Radius.circular(20)), - color: parked ? Theme.of(context).colorScheme.primary.withOpacity(0.5) : Colors.black12, + color: parked ? Theme.of(context).colorScheme.primary.withValues(alpha: 0.5) : Colors.black12, ), child: const Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/util/string_extensions.dart b/lib/util/string_extensions.dart index 34cf204..d3b479f 100644 --- a/lib/util/string_extensions.dart +++ b/lib/util/string_extensions.dart @@ -1,5 +1,3 @@ -import 'package:collection/collection.dart'; - import 'package:fladder/models/items/item_shared_models.dart'; extension StringExtensions on String { @@ -64,6 +62,6 @@ extension GenreExtensions on List { extension StringListExtension on List { String get detailsTitle { - return whereNotNull().join(" ● "); + return nonNulls.join(" ● "); } } diff --git a/lib/widgets/navigation_scaffold/components/fladder_app_bar.dart b/lib/widgets/navigation_scaffold/components/fladder_app_bar.dart index 3f0c62a..563e21a 100644 --- a/lib/widgets/navigation_scaffold/components/fladder_app_bar.dart +++ b/lib/widgets/navigation_scaffold/components/fladder_app_bar.dart @@ -43,7 +43,7 @@ class FladderAppBar extends StatelessWidget implements PreferredSize { } else { return AppBar( toolbarHeight: 0, - backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0), + backgroundColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0), scrolledUnderElevation: 0, elevation: 0, systemOverlayStyle: const SystemUiOverlayStyle(), diff --git a/lib/widgets/navigation_scaffold/components/floating_player_bar.dart b/lib/widgets/navigation_scaffold/components/floating_player_bar.dart index e01ce2f..8703cde 100644 --- a/lib/widgets/navigation_scaffold/components/floating_player_bar.dart +++ b/lib/widgets/navigation_scaffold/components/floating_player_bar.dart @@ -116,7 +116,7 @@ class _CurrentlyPlayingBarState extends ConsumerState { opacity: showExpandButton ? 1 : 0, duration: const Duration(milliseconds: 125), child: Container( - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), child: FlatButton( onTap: () async => openFullScreenPlayer(), child: const Icon(Icons.keyboard_arrow_up_rounded), @@ -191,7 +191,7 @@ class _CurrentlyPlayingBarState extends ConsumerState { ), LinearProgressIndicator( minHeight: 6, - backgroundColor: Colors.black.withOpacity(0.25), + backgroundColor: Colors.black.withValues(alpha: 0.25), color: Theme.of(context).colorScheme.primary, value: progress.clamp(0, 1), ), diff --git a/lib/widgets/navigation_scaffold/components/navigation_button.dart b/lib/widgets/navigation_scaffold/components/navigation_button.dart index 34c7b7a..ebb00af 100644 --- a/lib/widgets/navigation_scaffold/components/navigation_button.dart +++ b/lib/widgets/navigation_scaffold/components/navigation_button.dart @@ -1,7 +1,9 @@ -import 'package:fladder/util/widget_extensions.dart'; import 'package:flutter/material.dart'; + import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:fladder/util/widget_extensions.dart'; + class NavigationButton extends ConsumerStatefulWidget { final String? label; final Widget selectedIcon; @@ -58,10 +60,15 @@ class _NavigationButtonState extends ConsumerState { elevation: const WidgetStatePropertyAll(0), padding: const WidgetStatePropertyAll(EdgeInsets.zero), backgroundColor: const WidgetStatePropertyAll(Colors.transparent), + iconColor: WidgetStateProperty.resolveWith((states) { + return widget.selected + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.45); + }), foregroundColor: WidgetStateProperty.resolveWith((states) { return widget.selected ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.onSurface.withOpacity(0.45); + : Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.45); })), onPressed: widget.onPressed, child: AnimatedContainer( @@ -94,7 +101,7 @@ class _NavigationButtonState extends ConsumerState { width: widget.selected ? 14 : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - color: Theme.of(context).colorScheme.primary.withOpacity(widget.selected ? 1 : 0), + color: Theme.of(context).colorScheme.primary.withValues(alpha: widget.selected ? 1 : 0), ), ), ], diff --git a/lib/widgets/pop_up/delete_file.dart b/lib/widgets/pop_up/delete_file.dart index ce6feaf..0a3ba48 100644 --- a/lib/widgets/pop_up/delete_file.dart +++ b/lib/widgets/pop_up/delete_file.dart @@ -1,10 +1,12 @@ +import 'package:flutter/material.dart'; + import 'package:chopper/chopper.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + import 'package:fladder/models/item_base_model.dart'; import 'package:fladder/providers/api_provider.dart'; import 'package:fladder/util/localization_helper.dart'; import 'package:fladder/widgets/shared/filled_button_await.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; Future?> showDeleteDialog(BuildContext context, ItemBaseModel item, WidgetRef ref) async { Response? response; @@ -23,6 +25,7 @@ Future?> showDeleteDialog(BuildContext context, ItemBaseModel style: FilledButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.errorContainer, foregroundColor: Theme.of(context).colorScheme.onErrorContainer, + iconColor: Theme.of(context).colorScheme.onErrorContainer, ), onPressed: () async { response = await ref.read(jellyApiProvider).deleteItem(item.id); diff --git a/lib/widgets/shared/animated_icon.dart b/lib/widgets/shared/animated_icon.dart index b5275cc..c7e3386 100644 --- a/lib/widgets/shared/animated_icon.dart +++ b/lib/widgets/shared/animated_icon.dart @@ -72,7 +72,7 @@ class AnimatedVisibilityIconState extends State { child: AnimatedContainer( duration: const Duration(milliseconds: 300), decoration: BoxDecoration( - color: (_currentFilledState ? widget.filledColor : widget.outlinedColor)?.withOpacity(0.2), + color: (_currentFilledState ? widget.filledColor : widget.outlinedColor)?.withValues(alpha: 0.2), shape: BoxShape.circle, ), child: Padding( diff --git a/lib/widgets/shared/elevated_icon.dart b/lib/widgets/shared/elevated_icon.dart index 502090e..e5c0703 100644 --- a/lib/widgets/shared/elevated_icon.dart +++ b/lib/widgets/shared/elevated_icon.dart @@ -20,9 +20,9 @@ IconData getBackIcon(BuildContext context) { } final _shadows = [ - BoxShadow(blurRadius: 1, spreadRadius: 1, color: Colors.black.withOpacity(0.2)), - BoxShadow(blurRadius: 4, spreadRadius: 4, color: Colors.black.withOpacity(0.1)), - BoxShadow(blurRadius: 16, spreadRadius: 6, color: Colors.black.withOpacity(0.2)), + BoxShadow(blurRadius: 1, spreadRadius: 1, color: Colors.black.withValues(alpha: 0.2)), + BoxShadow(blurRadius: 4, spreadRadius: 4, color: Colors.black.withValues(alpha: 0.1)), + BoxShadow(blurRadius: 16, spreadRadius: 6, color: Colors.black.withValues(alpha: 0.2)), ]; class ElevatedIconButton extends ConsumerWidget { @@ -36,7 +36,7 @@ class ElevatedIconButton extends ConsumerWidget { return IconButton( onPressed: onPressed, style: IconButtonTheme.of(context).style?.copyWith( - backgroundColor: WidgetStatePropertyAll(color?.withOpacity(0.15)), + backgroundColor: WidgetStatePropertyAll(color?.withValues(alpha: 0.15)), ), color: color, icon: Icon( diff --git a/lib/widgets/shared/fladder_carousel.dart b/lib/widgets/shared/fladder_carousel.dart index f7408d1..f6671a4 100644 --- a/lib/widgets/shared/fladder_carousel.dart +++ b/lib/widgets/shared/fladder_carousel.dart @@ -295,13 +295,13 @@ class _CarouselViewState extends State { overlayColor: widget.overlayColor ?? WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.pressed)) { - return theme.colorScheme.onSurface.withOpacity(0.1); + return theme.colorScheme.onSurface.withValues(alpha: 0.1); } if (states.contains(WidgetState.hovered)) { - return theme.colorScheme.onSurface.withOpacity(0.08); + return theme.colorScheme.onSurface.withValues(alpha: 0.08); } if (states.contains(WidgetState.focused)) { - return theme.colorScheme.onSurface.withOpacity(0.1); + return theme.colorScheme.onSurface.withValues(alpha: 0.1); } return null; }), diff --git a/lib/widgets/shared/fladder_scrollbar.dart b/lib/widgets/shared/fladder_scrollbar.dart index bfe8e39..c95d87b 100644 --- a/lib/widgets/shared/fladder_scrollbar.dart +++ b/lib/widgets/shared/fladder_scrollbar.dart @@ -28,7 +28,7 @@ class FladderScrollbar extends ConsumerWidget { borderRadius: BorderRadius.circular(5), color: info.isDragging ? Theme.of(context).colorScheme.secondary - : Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.75), + : Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.75), ), duration: const Duration(milliseconds: 250), ); diff --git a/lib/widgets/shared/item_actions.dart b/lib/widgets/shared/item_actions.dart index 4df9f4c..274cc37 100644 --- a/lib/widgets/shared/item_actions.dart +++ b/lib/widgets/shared/item_actions.dart @@ -95,6 +95,7 @@ class ItemActionButton extends ItemAction { minimumSize: const WidgetStatePropertyAll(Size(50, 50)), elevation: const WidgetStatePropertyAll(0), foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onSurface), + iconColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onSurface), ), onPressed: () { if (shouldPop) { diff --git a/lib/widgets/shared/modal_side_sheet.dart b/lib/widgets/shared/modal_side_sheet.dart index e51eb1f..360a8a0 100644 --- a/lib/widgets/shared/modal_side_sheet.dart +++ b/lib/widgets/shared/modal_side_sheet.dart @@ -16,7 +16,7 @@ Future showModalSideSheet( context: context, transitionDuration: transitionDuration ?? const Duration(milliseconds: 200), barrierDismissible: barrierDismissible, - barrierColor: Theme.of(context).colorScheme.scrim.withOpacity(0.3), + barrierColor: Theme.of(context).colorScheme.scrim.withValues(alpha: 0.3), barrierLabel: 'Material 3 side sheet', useRootNavigator: false, transitionBuilder: (context, animation, secondaryAnimation, child) { diff --git a/lib/widgets/shared/selectable_icon_button.dart b/lib/widgets/shared/selectable_icon_button.dart index 63036a3..277e9d1 100644 --- a/lib/widgets/shared/selectable_icon_button.dart +++ b/lib/widgets/shared/selectable_icon_button.dart @@ -1,10 +1,12 @@ import 'dart:async'; import 'dart:developer'; +import 'package:flutter/material.dart'; + +import 'package:flutter_riverpod/flutter_riverpod.dart'; + import 'package:fladder/screens/shared/animated_fade_size.dart'; import 'package:fladder/util/refresh_state.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; class SelectableIconButton extends ConsumerStatefulWidget { final FutureOr Function() onPressed; @@ -36,6 +38,7 @@ class _SelectableIconButtonState extends ConsumerState { child: ElevatedButton( style: ButtonStyle( backgroundColor: widget.selected ? WidgetStatePropertyAll(Theme.of(context).colorScheme.primary) : null, + iconColor: widget.selected ? WidgetStatePropertyAll(Theme.of(context).colorScheme.onPrimary) : null, foregroundColor: widget.selected ? WidgetStatePropertyAll(Theme.of(context).colorScheme.onPrimary) : null, padding: const WidgetStatePropertyAll(EdgeInsets.zero), ), From 2595c82d3ad65321b00cc2204040c80bd661701c Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 13:54:45 +0100 Subject: [PATCH 07/12] one more --- .../edit_screens/edit_image_content.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/screens/metadata/edit_screens/edit_image_content.dart b/lib/screens/metadata/edit_screens/edit_image_content.dart index cc2477d..b5fa60c 100644 --- a/lib/screens/metadata/edit_screens/edit_image_content.dart +++ b/lib/screens/metadata/edit_screens/edit_image_content.dart @@ -1,4 +1,8 @@ +import 'package:flutter/material.dart'; + import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + import 'package:fladder/jellyfin/jellyfin_open_api.enums.swagger.dart'; import 'package:fladder/models/item_editing_model.dart'; import 'package:fladder/providers/edit_item_provider.dart'; @@ -6,8 +10,6 @@ import 'package:fladder/providers/settings/client_settings_provider.dart'; import 'package:fladder/screens/settings/settings_list_tile.dart'; import 'package:fladder/screens/shared/file_picker.dart'; import 'package:fladder/util/adaptive_layout.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; class EditImageContent extends ConsumerStatefulWidget { final ImageType type; @@ -39,7 +41,8 @@ class _EditImageContentState extends ConsumerState { @override Widget build(BuildContext context) { final posterSize = MediaQuery.sizeOf(context).width / - (AdaptiveLayout.poster(context).gridRatio * ref.watch(clientSettingsProvider.select((value) => value.posterSize))); + (AdaptiveLayout.poster(context).gridRatio * + ref.watch(clientSettingsProvider.select((value) => value.posterSize))); final decimal = posterSize - posterSize.toInt(); final includeAllImages = ref.watch(editItemProvider.select((value) => value.includeAllImages)); final images = ref.watch(editItemProvider.select((value) => switch (widget.type) { @@ -85,7 +88,8 @@ class _EditImageContentState extends ConsumerState { decoration: BoxDecoration( color: selected ? Theme.of(context).colorScheme.primary : Colors.transparent, borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.transparent, width: 4, strokeAlign: BorderSide.strokeAlignInside), + border: + Border.all(color: Colors.transparent, width: 4, strokeAlign: BorderSide.strokeAlignInside), ), child: Card( color: selected ? Theme.of(context).colorScheme.onPrimary : null, @@ -108,6 +112,7 @@ class _EditImageContentState extends ConsumerState { style: FilledButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.error, foregroundColor: Theme.of(context).colorScheme.onError, + iconColor: Theme.of(context).colorScheme.onError, ), onPressed: () async { await showDialog( @@ -121,6 +126,7 @@ class _EditImageContentState extends ConsumerState { style: FilledButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.error, foregroundColor: Theme.of(context).colorScheme.onError, + iconColor: Theme.of(context).colorScheme.onError, ), onPressed: () async { await ref.read(editItemProvider.notifier).deleteImage(widget.type, image); @@ -230,7 +236,8 @@ class _EditImageContentState extends ConsumerState { children: [...serverImageCards, ...imageCards], ), if (loading) const Center(child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round)), - if (!loading && [...serverImageCards, ...imageCards].isEmpty) Center(child: Text("No ${widget.type.value}s found")) + if (!loading && [...serverImageCards, ...imageCards].isEmpty) + Center(child: Text("No ${widget.type.value}s found")) ], ), ), From 6c8aea736d5c0b1d184355cbbfdbfaa45d453ebc Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 14:10:56 +0100 Subject: [PATCH 08/12] fix: Use default flutter CarouselView --- lib/screens/shared/media/carousel_banner.dart | 218 ++--- lib/screens/shared/media/media_banner.dart | 3 - lib/widgets/shared/fladder_carousel.dart | 760 ------------------ 3 files changed, 112 insertions(+), 869 deletions(-) delete mode 100644 lib/widgets/shared/fladder_carousel.dart diff --git a/lib/screens/shared/media/carousel_banner.dart b/lib/screens/shared/media/carousel_banner.dart index 7bcd8cc..e9cad90 100644 --- a/lib/screens/shared/media/carousel_banner.dart +++ b/lib/screens/shared/media/carousel_banner.dart @@ -11,7 +11,6 @@ import 'package:fladder/util/fladder_image.dart'; import 'package:fladder/util/item_base_model/item_base_model_extensions.dart'; import 'package:fladder/util/list_padding.dart'; import 'package:fladder/util/themes_data.dart'; -import 'package:fladder/widgets/shared/fladder_carousel.dart'; import 'package:fladder/widgets/shared/item_actions.dart'; import 'package:fladder/widgets/shared/modal_bottom_sheet.dart'; @@ -42,119 +41,126 @@ class _CarouselBannerState extends ConsumerState { (MediaQuery.sizeOf(context).shortestSide * 0.75).clamp(251.0, double.maxFinite), ); final border = BorderRadius.circular(18); - return FladderCarousel( - elevation: 3, - shrinkExtent: 0, - shape: RoundedRectangleBorder(borderRadius: border), - itemPadding: + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 4).copyWith(top: AdaptiveLayout.of(context).isDesktop ? 6 : 10), - padding: const EdgeInsets.symmetric(horizontal: 6), - itemExtent: widget.items.length == 1 ? MediaQuery.sizeOf(context).width : maxExtent, - children: [ - ...widget.items.mapIndexed( - (index, item) => LayoutBuilder(builder: (context, constraints) { - final opacity = (constraints.maxWidth / maxExtent); - return Stack( - clipBehavior: Clip.none, - children: [ - FladderImage(image: item.bannerImage), - Opacity( - opacity: opacity.clamp(0, 1), - child: Stack( - children: [ - Positioned.fill( - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomLeft, - end: Alignment.topCenter, - colors: [ - ThemesData.of(context).dark.colorScheme.primaryContainer.withValues(alpha: 0.85), - Colors.transparent, - ], + child: CarouselView( + elevation: 3, + shrinkExtent: 0, + shape: RoundedRectangleBorder(borderRadius: border), + padding: const EdgeInsets.symmetric(horizontal: 6), + enableSplash: false, + itemExtent: widget.items.length == 1 ? MediaQuery.sizeOf(context).width : maxExtent, + children: [ + ...widget.items.mapIndexed( + (index, item) => LayoutBuilder(builder: (context, constraints) { + final opacity = (constraints.maxWidth / maxExtent); + return Stack( + clipBehavior: Clip.none, + children: [ + FladderImage(image: item.bannerImage), + Opacity( + opacity: opacity.clamp(0, 1), + child: Stack( + children: [ + Positioned.fill( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomLeft, + end: Alignment.topCenter, + colors: [ + ThemesData.of(context) + .dark + .colorScheme + .primaryContainer + .withValues(alpha: 0.85), + Colors.transparent, + ], + ), ), ), ), - ), - ], - ), - ), - Align( - alignment: Alignment.bottomLeft, - child: Padding( - padding: const EdgeInsets.all(16.0).copyWith(right: constraints.maxWidth * 0.2), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title, - maxLines: 2, - softWrap: item.title.length > 25, - overflow: TextOverflow.fade, - style: Theme.of(context).textTheme.headlineMedium?.copyWith(color: Colors.white), - ), - if (item.label(context) != null || item.subText != null) - Text( - item.label(context) ?? item.subText ?? "", - maxLines: 2, - softWrap: false, - overflow: TextOverflow.fade, - style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Colors.white), - ), - ].addInBetween(const SizedBox(height: 4)), + ], ), ), - ), - FlatButton( - onTap: () => widget.items[index].navigateTo(context), - onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer - ? null - : () { - final poster = widget.items[index]; - showBottomSheetPill( - context: context, - item: poster, - content: (scrollContext, scrollController) => ListView( - shrinkWrap: true, - controller: scrollController, - children: poster - .generateActions(context, ref) - .listTileItems(scrollContext, useIcons: true), + Align( + alignment: Alignment.bottomLeft, + child: Padding( + padding: const EdgeInsets.all(16.0).copyWith(right: constraints.maxWidth * 0.2), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.title, + maxLines: 2, + softWrap: item.title.length > 25, + overflow: TextOverflow.fade, + style: Theme.of(context).textTheme.headlineMedium?.copyWith(color: Colors.white), + ), + if (item.label(context) != null || item.subText != null) + Text( + item.label(context) ?? item.subText ?? "", + maxLines: 2, + softWrap: false, + overflow: TextOverflow.fade, + style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Colors.white), ), - ); - }, - onSecondaryTapDown: AdaptiveLayout.of(context).inputDevice == InputDevice.touch - ? null - : (details) async { - Offset localPosition = details.globalPosition; - RelativeRect position = RelativeRect.fromLTRB( - localPosition.dx - 320, localPosition.dy, localPosition.dx, localPosition.dy); - final poster = widget.items[index]; - - await showMenu( - context: context, - position: position, - items: poster.generateActions(context, ref).popupMenuItems(useIcons: true), - ); - }, - ), - BannerPlayButton(item: widget.items[index]), - IgnorePointer( - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.white.withValues(alpha: 0.1), - width: 1.0, - ), - borderRadius: border), + ].addInBetween(const SizedBox(height: 4)), + ), + ), ), - ), - ], - ); - }), - ) - ], + FlatButton( + onTap: () => widget.items[index].navigateTo(context), + onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer + ? null + : () { + final poster = widget.items[index]; + showBottomSheetPill( + context: context, + item: poster, + content: (scrollContext, scrollController) => ListView( + shrinkWrap: true, + controller: scrollController, + children: poster + .generateActions(context, ref) + .listTileItems(scrollContext, useIcons: true), + ), + ); + }, + onSecondaryTapDown: AdaptiveLayout.of(context).inputDevice == InputDevice.touch + ? null + : (details) async { + Offset localPosition = details.globalPosition; + RelativeRect position = RelativeRect.fromLTRB( + localPosition.dx - 320, localPosition.dy, localPosition.dx, localPosition.dy); + final poster = widget.items[index]; + + await showMenu( + context: context, + position: position, + items: poster.generateActions(context, ref).popupMenuItems(useIcons: true), + ); + }, + ), + BannerPlayButton(item: widget.items[index]), + IgnorePointer( + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: Colors.white.withValues(alpha: 0.1), + width: 1.0, + ), + borderRadius: border), + ), + ), + ], + ); + }), + ) + ], + ), ); }, ), diff --git a/lib/screens/shared/media/media_banner.dart b/lib/screens/shared/media/media_banner.dart index d8e4ca7..f8f2c3d 100644 --- a/lib/screens/shared/media/media_banner.dart +++ b/lib/screens/shared/media/media_banner.dart @@ -12,7 +12,6 @@ import 'package:fladder/util/fladder_image.dart'; import 'package:fladder/util/item_base_model/item_base_model_extensions.dart'; import 'package:fladder/util/list_padding.dart'; import 'package:fladder/util/themes_data.dart'; -import 'package:fladder/widgets/shared/fladder_carousel.dart'; import 'package:fladder/widgets/shared/fladder_slider.dart'; import 'package:fladder/widgets/shared/item_actions.dart'; import 'package:fladder/widgets/shared/modal_bottom_sheet.dart'; @@ -81,8 +80,6 @@ class _MediaBannerState extends ConsumerState { timer.reset(); } - final controller = FladderCarouselController(); - @override Widget build(BuildContext context) { final overlayColor = ThemesData.of(context).dark.colorScheme.primaryContainer; diff --git a/lib/widgets/shared/fladder_carousel.dart b/lib/widgets/shared/fladder_carousel.dart deleted file mode 100644 index f6671a4..0000000 --- a/lib/widgets/shared/fladder_carousel.dart +++ /dev/null @@ -1,760 +0,0 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//This is a copy of the CarouselView widget with some minor changes. - -import 'dart:math' as math; -import 'dart:ui'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; - -class MyCustomScrollBehavior extends MaterialScrollBehavior { - @override - Set get dragDevices => PointerDeviceKind.values.toSet(); -} - -/// A Material Design carousel widget. -/// -/// The [FladderCarousel] present a scrollable list of items, each of which can dynamically -/// change size based on the chosen layout. -/// -/// This widget supports uncontained carousel layout. It shows items that scroll -/// to the edge of the container, behaving similarly to a [ListView] where all -/// children are a uniform size. -/// -/// The [FladderCarouselController] is used to control the [FladderCarouselController.initialItem]. -/// -/// The [FladderCarousel.itemExtent] property must be non-null and defines the base -/// size of items. While items typically maintain this size, the first and last -/// visible items may be slightly compressed during scrolling. The [shrinkExtent] -/// property controls the minimum allowable size for these compressed items. -/// -/// {@tool dartpad} -/// Here is an example of [FladderCarousel] to show the uncontained layout. Each carousel -/// item has the same size but can be "squished" to the [shrinkExtent] when they -/// are show on the view and out of view. -/// -/// ** See code in examples/api/lib/material/carousel/carousel.0.dart ** -/// {@end-tool} -/// -/// See also: -/// -/// * [FladderCarouselController], which controls the first visible item in the carousel. -/// * [PageView], which is a scrollable list that works page by page. -class FladderCarousel extends StatefulWidget { - /// Creates a Material Design carousel. - const FladderCarousel({ - super.key, - this.itemPadding, - this.padding = EdgeInsets.zero, - this.backgroundColor, - this.elevation, - this.shape, - this.overlayColor, - this.itemSnapping = false, - this.shrinkExtent = 0.0, - this.controller, - this.scrollDirection = Axis.horizontal, - this.reverse = false, - this.onTap, - this.onLongPress, - this.onSecondaryTap, - required this.itemExtent, - required this.children, - }); - - /// The amount of space to surround each carousel item with. - /// - /// Defaults to [EdgeInsets.all] of 4 pixels. - final EdgeInsets? itemPadding; - - final EdgeInsets padding; - - /// The background color for each carousel item. - /// - /// Defaults to [ColorScheme.surface]. - final Color? backgroundColor; - - /// The z-coordinate of each carousel item. - /// - /// Defaults to 0.0. - final double? elevation; - - /// The shape of each carousel item's [Material]. - /// - /// Defines each item's [Material.shape]. - /// - /// Defaults to a [RoundedRectangleBorder] with a circular corner radius - /// of 28.0. - final ShapeBorder? shape; - - /// The highlight color to indicate the carousel items are in pressed, hovered - /// or focused states. - /// - /// The default values are: - /// * [WidgetState.pressed] - [ColorScheme.onSurface] with an opacity of 0.1 - /// * [WidgetState.hovered] - [ColorScheme.onSurface] with an opacity of 0.08 - /// * [WidgetState.focused] - [ColorScheme.onSurface] with an opacity of 0.1 - final WidgetStateProperty? overlayColor; - - /// The minimum allowable extent (size) in the main axis for carousel items - /// during scrolling transitions. - /// - /// As the carousel scrolls, the first visible item is pinned and gradually - /// shrinks until it reaches this minimum extent before scrolling off-screen. - /// Similarly, the last visible item enters the viewport at this minimum size - /// and expands to its full [itemExtent]. - /// - /// In cases where the remaining viewport space for the last visible item is - /// larger than the defined [shrinkExtent], the [shrinkExtent] is dynamically - /// adjusted to match this remaining space, ensuring a smooth size transition. - /// - /// Defaults to 0.0. Setting to 0.0 allows items to shrink/expand completely, - /// transitioning between 0.0 and the full [itemExtent]. In cases where the - /// remaining viewport space for the last visible item is larger than the - /// defined [shrinkExtent], the [shrinkExtent] is dynamically adjusted to match - /// this remaining space, ensuring a smooth size transition. - final double shrinkExtent; - - /// Whether the carousel should keep scrolling to the next/previous items to - /// maintain the original layout. - /// - /// Defaults to false. - final bool itemSnapping; - - /// An object that can be used to control the position to which this scroll - /// view is scrolled. - final FladderCarouselController? controller; - - /// The [Axis] along which the scroll view's offset increases with each item. - /// - /// Defaults to [Axis.horizontal]. - final Axis scrollDirection; - - /// Whether the carousel list scrolls in the reading direction. - /// - /// For example, if the reading direction is left-to-right and - /// [scrollDirection] is [Axis.horizontal], then the carousel scrolls from - /// left to right when [reverse] is false and from right to left when - /// [reverse] is true. - /// - /// Similarly, if [scrollDirection] is [Axis.vertical], then the carousel view - /// scrolls from top to bottom when [reverse] is false and from bottom to top - /// when [reverse] is true. - /// - /// Defaults to false. - final bool reverse; - - /// Called when one of the [children] is tapped. - final ValueChanged? onTap; - - /// Called when one of the [children] is longPressed. - final ValueChanged? onLongPress; - - final ValueChanged<(int, TapDownDetails)>? onSecondaryTap; - - /// The extent the children are forced to have in the main axis. - /// - /// The item extent should not exceed the available space that the carousel - /// occupies to ensure at least one item is fully visible. - /// - /// This must be non-null. - final double itemExtent; - - /// The child widgets for the carousel. - final List children; - - @override - State createState() => _CarouselViewState(); -} - -class _CarouselViewState extends State { - late double _itemExtent; - FladderCarouselController? _internalController; - FladderCarouselController get _controller => widget.controller ?? _internalController!; - - @override - void initState() { - super.initState(); - if (widget.controller == null) { - _internalController = FladderCarouselController(); - } - _controller._attach(this); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - _itemExtent = widget.itemExtent; - } - - @override - void didUpdateWidget(covariant FladderCarousel oldWidget) { - super.didUpdateWidget(oldWidget); - if (widget.controller != oldWidget.controller) { - oldWidget.controller?._detach(this); - if (widget.controller != null) { - _internalController?._detach(this); - _internalController = null; - widget.controller?._attach(this); - } else { - // widget.controller == null && oldWidget.controller != null - assert(_internalController == null); - _internalController = FladderCarouselController(); - _controller._attach(this); - } - } - if (widget.itemExtent != oldWidget.itemExtent) { - _itemExtent = widget.itemExtent; - } - } - - @override - void dispose() { - _controller._detach(this); - _internalController?.dispose(); - super.dispose(); - } - - AxisDirection _getDirection(BuildContext context) { - switch (widget.scrollDirection) { - case Axis.horizontal: - assert(debugCheckHasDirectionality(context)); - final TextDirection textDirection = Directionality.of(context); - final AxisDirection axisDirection = textDirectionToAxisDirection(textDirection); - return widget.reverse ? flipAxisDirection(axisDirection) : axisDirection; - case Axis.vertical: - return widget.reverse ? AxisDirection.up : AxisDirection.down; - } - } - - @override - Widget build(BuildContext context) { - final ThemeData theme = Theme.of(context); - final AxisDirection axisDirection = _getDirection(context); - final ScrollPhysics physics = - widget.itemSnapping ? const CarouselScrollPhysics() : ScrollConfiguration.of(context).getScrollPhysics(context); - final EdgeInsets effectivePadding = widget.itemPadding ?? const EdgeInsets.all(4.0); - final Color effectiveBackgroundColor = widget.backgroundColor ?? Theme.of(context).colorScheme.surface; - final double effectiveElevation = widget.elevation ?? 0.0; - final ShapeBorder effectiveShape = - widget.shape ?? const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(28.0))); - - return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { - final double mainAxisExtent = switch (widget.scrollDirection) { - Axis.horizontal => constraints.maxWidth, - Axis.vertical => constraints.maxHeight, - }; - _itemExtent = clampDouble(_itemExtent, 0, mainAxisExtent); - - return Scrollable( - axisDirection: axisDirection, - scrollBehavior: MyCustomScrollBehavior(), - controller: _controller, - physics: physics, - viewportBuilder: (BuildContext context, ViewportOffset position) { - return Viewport( - cacheExtent: 0.0, - cacheExtentStyle: CacheExtentStyle.viewport, - axisDirection: axisDirection, - offset: position, - clipBehavior: Clip.antiAlias, - slivers: [ - _SliverFixedExtentCarousel( - itemExtent: _itemExtent, - minExtent: widget.shrinkExtent, - delegate: SliverChildBuilderDelegate( - (BuildContext context, int index) { - return Padding( - padding: effectivePadding.add(EdgeInsets.only( - left: index == 0 ? widget.padding.left : 0, - right: index == widget.children.length - 1 ? widget.padding.right : 0, - )), - child: Material( - clipBehavior: Clip.antiAlias, - color: effectiveBackgroundColor, - elevation: effectiveElevation, - shape: effectiveShape, - child: Stack( - fit: StackFit.expand, - children: [ - widget.children.elementAt(index), - if (widget.onTap != null || widget.onSecondaryTap != null || widget.onLongPress != null) - Material( - color: Colors.transparent, - child: InkWell( - onTap: widget.onTap != null ? () => widget.onTap!.call(index) : null, - onLongPress: - widget.onLongPress != null ? () => widget.onLongPress!.call(index) : null, - onSecondaryTapDown: widget.onSecondaryTap != null - ? (details) => widget.onSecondaryTap!.call((index, details)) - : null, - overlayColor: widget.overlayColor ?? - WidgetStateProperty.resolveWith((Set states) { - if (states.contains(WidgetState.pressed)) { - return theme.colorScheme.onSurface.withValues(alpha: 0.1); - } - if (states.contains(WidgetState.hovered)) { - return theme.colorScheme.onSurface.withValues(alpha: 0.08); - } - if (states.contains(WidgetState.focused)) { - return theme.colorScheme.onSurface.withValues(alpha: 0.1); - } - return null; - }), - ), - ), - ], - ), - ), - ); - }, - childCount: widget.children.length, - ), - ), - ], - ); - }, - ); - }); - } -} - -/// A sliver that displays its box children in a linear array with a fixed extent -/// per item. -/// -/// _To learn more about slivers, see [CustomScrollView.slivers]._ -/// -/// This sliver list arranges its children in a line along the main axis starting -/// at offset zero and without gaps. Each child is constrained to a fixed extent -/// along the main axis and the [SliverConstraints.crossAxisExtent] -/// along the cross axis. The difference between this and a list view with a fixed -/// extent is the first item and last item can be squished a little during scrolling -/// transition. This compression is controlled by the `minExtent` property and -/// aligns with the [Material Design Carousel specifications] -/// (https://m3.material.io/components/carousel/guidelines#96c5c157-fe5b-4ee3-a9b4-72bf8efab7e9). -class _SliverFixedExtentCarousel extends SliverMultiBoxAdaptorWidget { - const _SliverFixedExtentCarousel({ - required super.delegate, - required this.minExtent, - required this.itemExtent, - }); - - final double itemExtent; - final double minExtent; - - @override - RenderSliverFixedExtentBoxAdaptor createRenderObject(BuildContext context) { - final SliverMultiBoxAdaptorElement element = context as SliverMultiBoxAdaptorElement; - return _RenderSliverFixedExtentCarousel( - childManager: element, - minExtent: minExtent, - maxExtent: itemExtent, - ); - } - - @override - void updateRenderObject(BuildContext context, _RenderSliverFixedExtentCarousel renderObject) { - renderObject.maxExtent = itemExtent; - renderObject.minExtent = minExtent; - } -} - -class _RenderSliverFixedExtentCarousel extends RenderSliverFixedExtentBoxAdaptor { - _RenderSliverFixedExtentCarousel({ - required super.childManager, - required double maxExtent, - required double minExtent, - }) : _maxExtent = maxExtent, - _minExtent = minExtent; - - double get maxExtent => _maxExtent; - double _maxExtent; - set maxExtent(double value) { - if (_maxExtent == value) { - return; - } - _maxExtent = value; - markNeedsLayout(); - } - - double get minExtent => _minExtent; - double _minExtent; - set minExtent(double value) { - if (_minExtent == value) { - return; - } - _minExtent = value; - markNeedsLayout(); - } - - // This implements the [itemExtentBuilder] callback. - double _buildItemExtent(int index, SliverLayoutDimensions currentLayoutDimensions) { - final int firstVisibleIndex = (constraints.scrollOffset / maxExtent).floor(); - - // Calculate how many items have been completely scroll off screen. - final int offscreenItems = (constraints.scrollOffset / maxExtent).floor(); - - // If an item is partially off screen and partially on screen, - // `constraints.scrollOffset` must be greater than - // `offscreenItems * maxExtent`, so the difference between these two is how - // much the current first visible item is off screen. - final double offscreenExtent = constraints.scrollOffset - offscreenItems * maxExtent; - - // If there is not enough space to place the last visible item but the remaining - // space is larger than `minExtent`, the extent for last item should be at - // least the remaining extent to ensure a smooth size transition. - final double effectiveMinExtent = math.max(constraints.remainingPaintExtent % maxExtent, minExtent); - - // Two special cases are the first and last visible items. Other items' extent - // should all return `maxExtent`. - if (index == firstVisibleIndex) { - final double effectiveExtent = maxExtent - offscreenExtent; - return math.max(effectiveExtent, effectiveMinExtent); - } - - final double scrollOffsetForLastIndex = constraints.scrollOffset + constraints.remainingPaintExtent; - if (index == getMaxChildIndexForScrollOffset(scrollOffsetForLastIndex, maxExtent)) { - return clampDouble(scrollOffsetForLastIndex - maxExtent * index, effectiveMinExtent, maxExtent); - } - - return maxExtent; - } - - late SliverLayoutDimensions _currentLayoutDimensions; - - @override - void performLayout() { - _currentLayoutDimensions = SliverLayoutDimensions( - scrollOffset: constraints.scrollOffset, - precedingScrollExtent: constraints.precedingScrollExtent, - viewportMainAxisExtent: constraints.viewportMainAxisExtent, - crossAxisExtent: constraints.crossAxisExtent, - ); - super.performLayout(); - } - - /// The layout offset for the child with the given index. - @override - double indexToLayoutOffset( - @Deprecated('The itemExtent is already available within the scope of this function. ' - 'This feature was deprecated after v3.20.0-7.0.pre.') - double itemExtent, - int index, - ) { - final int firstVisibleIndex = (constraints.scrollOffset / maxExtent).floor(); - - // If there is not enough space to place the last visible item but the remaining - // space is larger than `minExtent`, the extent for last item should be at - // least the remaining extent to make sure a smooth size transition. - final double effectiveMinExtent = math.max(constraints.remainingPaintExtent % maxExtent, minExtent); - if (index == firstVisibleIndex) { - final double firstVisibleItemExtent = _buildItemExtent(index, _currentLayoutDimensions); - - // If the first item is squished to be less than `effectievMinExtent`, - // then it should stop changinng its size and should start to scroll off screen. - if (firstVisibleItemExtent <= effectiveMinExtent) { - return maxExtent * index - effectiveMinExtent + maxExtent; - } - return constraints.scrollOffset; - } - return maxExtent * index; - } - - /// The minimum child index that is visible at the given scroll offset. - @override - int getMinChildIndexForScrollOffset( - double scrollOffset, - @Deprecated('The itemExtent is already available within the scope of this function. ' - 'This feature was deprecated after v3.20.0-7.0.pre.') - double itemExtent, - ) { - final int firstVisibleIndex = (constraints.scrollOffset / maxExtent).floor(); - return math.max(firstVisibleIndex, 0); - } - - /// The maximum child index that is visible at the given scroll offset. - @override - int getMaxChildIndexForScrollOffset( - double scrollOffset, - @Deprecated('The itemExtent is already available within the scope of this function. ' - 'This feature was deprecated after v3.20.0-7.0.pre.') - double itemExtent, - ) { - if (maxExtent > 0.0) { - final double actual = scrollOffset / maxExtent - 1; - final int round = actual.round(); - if ((actual * maxExtent - round * maxExtent).abs() < precisionErrorTolerance) { - return math.max(0, round); - } - return math.max(0, actual.ceil()); - } - return 0; - } - - @override - double? get itemExtent => null; - - @override - ItemExtentBuilder? get itemExtentBuilder => _buildItemExtent; -} - -/// Scroll physics used by a [FladderCarousel]. -/// -/// These physics cause the carousel item to snap to item boundaries. -/// -/// See also: -/// -/// * [ScrollPhysics], the base class which defines the API for scrolling -/// physics. -/// * [PageScrollPhysics], scroll physics used by a [PageView]. -class CarouselScrollPhysics extends ScrollPhysics { - /// Creates physics for a [FladderCarousel]. - const CarouselScrollPhysics({super.parent}); - - @override - CarouselScrollPhysics applyTo(ScrollPhysics? ancestor) { - return CarouselScrollPhysics(parent: buildParent(ancestor)); - } - - double _getTargetPixels( - _CarouselPosition position, - Tolerance tolerance, - double velocity, - ) { - double fraction; - fraction = position.itemExtent! / position.viewportDimension; - - final double itemWidth = position.viewportDimension * fraction; - - final double actual = math.max(0.0, position.pixels) / itemWidth; - final double round = actual.roundToDouble(); - double item; - if ((actual - round).abs() < precisionErrorTolerance) { - item = round; - } else { - item = actual; - } - if (velocity < -tolerance.velocity) { - item -= 0.5; - } else if (velocity > tolerance.velocity) { - item += 0.5; - } - return item.roundToDouble() * itemWidth; - } - - @override - Simulation? createBallisticSimulation( - ScrollMetrics position, - double velocity, - ) { - assert( - position is _CarouselPosition, - 'CarouselScrollPhysics can only be used with Scrollables that uses ' - 'the FladderCarouselController', - ); - - final _CarouselPosition metrics = position as _CarouselPosition; - if ((velocity <= 0.0 && metrics.pixels <= metrics.minScrollExtent) || - (velocity >= 0.0 && metrics.pixels >= metrics.maxScrollExtent)) { - return super.createBallisticSimulation(metrics, velocity); - } - - final Tolerance tolerance = toleranceFor(metrics); - final double target = _getTargetPixels(metrics, tolerance, velocity); - if (target != metrics.pixels) { - return ScrollSpringSimulation( - spring, - metrics.pixels, - target, - velocity, - tolerance: tolerance, - ); - } - return null; - } - - @override - bool get allowImplicitScrolling => true; -} - -/// Metrics for a [FladderCarousel]. -class _CarouselMetrics extends FixedScrollMetrics { - /// Creates an immutable snapshot of values associated with a [FladderCarousel]. - _CarouselMetrics({ - required super.minScrollExtent, - required super.maxScrollExtent, - required super.pixels, - required super.viewportDimension, - required super.axisDirection, - this.itemExtent, - required super.devicePixelRatio, - }); - - /// Extent for the carousel item. - /// - /// Used to compute the first item from the current [pixels]. - final double? itemExtent; - - @override - _CarouselMetrics copyWith({ - double? minScrollExtent, - double? maxScrollExtent, - double? pixels, - double? viewportDimension, - AxisDirection? axisDirection, - double? itemExtent, - double? devicePixelRatio, - }) { - return _CarouselMetrics( - minScrollExtent: minScrollExtent ?? (hasContentDimensions ? this.minScrollExtent : null), - maxScrollExtent: maxScrollExtent ?? (hasContentDimensions ? this.maxScrollExtent : null), - pixels: pixels ?? (hasPixels ? this.pixels : null), - viewportDimension: viewportDimension ?? (hasViewportDimension ? this.viewportDimension : null), - axisDirection: axisDirection ?? this.axisDirection, - itemExtent: itemExtent ?? this.itemExtent, - devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio, - ); - } -} - -class _CarouselPosition extends ScrollPositionWithSingleContext implements _CarouselMetrics { - _CarouselPosition({ - required super.physics, - required super.context, - this.initialItem = 0, - required this.itemExtent, - super.oldPosition, - }) : _itemToShowOnStartup = initialItem.toDouble(), - super(initialPixels: null); - - final int initialItem; - final double _itemToShowOnStartup; - // When the viewport has a zero-size, the item can not - // be retrieved by `getItemFromPixels`, so we need to cache the item - // for use when resizing the viewport to non-zero next time. - double? _cachedItem; - - @override - double? itemExtent; - - double getItemFromPixels(double pixels, double viewportDimension) { - assert(viewportDimension > 0.0); - final double fraction = itemExtent! / viewportDimension; - - final double actual = math.max(0.0, pixels) / (viewportDimension * fraction); - final double round = actual.roundToDouble(); - if ((actual - round).abs() < precisionErrorTolerance) { - return round; - } - return actual; - } - - double getPixelsFromItem(double item) { - final double fraction = itemExtent! / viewportDimension; - - return item * viewportDimension * fraction; - } - - @override - bool applyViewportDimension(double viewportDimension) { - final double? oldViewportDimensions = hasViewportDimension ? this.viewportDimension : null; - if (viewportDimension == oldViewportDimensions) { - return true; - } - final bool result = super.applyViewportDimension(viewportDimension); - final double? oldPixels = hasPixels ? pixels : null; - double item; - if (oldPixels == null) { - item = _itemToShowOnStartup; - } else if (oldViewportDimensions == 0.0) { - // If resize from zero, we should use the _cachedItem to recover the state. - item = _cachedItem!; - } else { - item = getItemFromPixels(oldPixels, oldViewportDimensions!); - } - final double newPixels = getPixelsFromItem(item); - // If the viewportDimension is zero, cache the item - // in case the viewport is resized to be non-zero. - _cachedItem = (viewportDimension == 0.0) ? item : null; - - if (newPixels != oldPixels) { - correctPixels(newPixels); - return false; - } - return result; - } - - @override - _CarouselMetrics copyWith({ - double? minScrollExtent, - double? maxScrollExtent, - double? pixels, - double? viewportDimension, - AxisDirection? axisDirection, - double? itemExtent, - List? layoutWeights, - double? devicePixelRatio, - }) { - return _CarouselMetrics( - minScrollExtent: minScrollExtent ?? (hasContentDimensions ? this.minScrollExtent : null), - maxScrollExtent: maxScrollExtent ?? (hasContentDimensions ? this.maxScrollExtent : null), - pixels: pixels ?? (hasPixels ? this.pixels : null), - viewportDimension: viewportDimension ?? (hasViewportDimension ? this.viewportDimension : null), - axisDirection: axisDirection ?? this.axisDirection, - itemExtent: itemExtent ?? this.itemExtent, - devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio, - ); - } -} - -/// A controller for [FladderCarousel]. -/// -/// Using a carousel controller helps to show the first visible item on the -/// carousel list. -class FladderCarouselController extends ScrollController { - /// Creates a carousel controller. - FladderCarouselController({ - this.initialItem = 0, - }); - - /// The item that expands to the maximum size when first creating the [FladderCarousel]. - final int initialItem; - - _CarouselViewState? _carouselState; - - // ignore: use_setters_to_change_properties - void _attach(_CarouselViewState anchor) { - _carouselState = anchor; - } - - void _detach(_CarouselViewState anchor) { - if (_carouselState == anchor) { - _carouselState = null; - } - } - - @override - ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition? oldPosition) { - assert(_carouselState != null); - final double itemExtent = _carouselState!._itemExtent; - - return _CarouselPosition( - physics: physics, - context: context, - initialItem: initialItem, - itemExtent: itemExtent, - oldPosition: oldPosition, - ); - } - - @override - void attach(ScrollPosition position) { - super.attach(position); - final _CarouselPosition carouselPosition = position as _CarouselPosition; - carouselPosition.itemExtent = _carouselState!._itemExtent; - } -} From 6c71a8e63d558f2f654d6aee3e6ac571a405fef2 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 14:13:40 +0100 Subject: [PATCH 09/12] Set iconSize for navigationButtons --- .../navigation_scaffold/components/navigation_button.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/widgets/navigation_scaffold/components/navigation_button.dart b/lib/widgets/navigation_scaffold/components/navigation_button.dart index ebb00af..305b0f7 100644 --- a/lib/widgets/navigation_scaffold/components/navigation_button.dart +++ b/lib/widgets/navigation_scaffold/components/navigation_button.dart @@ -60,6 +60,7 @@ class _NavigationButtonState extends ConsumerState { elevation: const WidgetStatePropertyAll(0), padding: const WidgetStatePropertyAll(EdgeInsets.zero), backgroundColor: const WidgetStatePropertyAll(Colors.transparent), + iconSize: const WidgetStatePropertyAll(24), iconColor: WidgetStateProperty.resolveWith((states) { return widget.selected ? Theme.of(context).colorScheme.primary From f445d8908b7a1ef63ddd4cf6f8c34c97854107a2 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 14:32:23 +0100 Subject: [PATCH 10/12] feature(Desktop): Usability improvements to top carousel --- lib/screens/shared/media/carousel_banner.dart | 296 ++++++++++-------- 1 file changed, 174 insertions(+), 122 deletions(-) diff --git a/lib/screens/shared/media/carousel_banner.dart b/lib/screens/shared/media/carousel_banner.dart index e9cad90..ef83ea1 100644 --- a/lib/screens/shared/media/carousel_banner.dart +++ b/lib/screens/shared/media/carousel_banner.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:collection/collection.dart'; +import 'package:ficonsax/ficonsax.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:fladder/models/item_base_model.dart'; @@ -30,139 +31,190 @@ class CarouselBanner extends ConsumerStatefulWidget { } class _CarouselBannerState extends ConsumerState { + final carouselController = CarouselController(); + bool showControls = false; + @override Widget build(BuildContext context) { - return ConstrainedBox( - constraints: BoxConstraints(maxHeight: widget.maxHeight), - child: LayoutBuilder( - builder: (context, constraints) { - final maxExtent = (constraints.maxHeight * 2.1).clamp( - 250.0, - (MediaQuery.sizeOf(context).shortestSide * 0.75).clamp(251.0, double.maxFinite), - ); - final border = BorderRadius.circular(18); - return Padding( - padding: - const EdgeInsets.symmetric(horizontal: 4).copyWith(top: AdaptiveLayout.of(context).isDesktop ? 6 : 10), - child: CarouselView( - elevation: 3, - shrinkExtent: 0, - shape: RoundedRectangleBorder(borderRadius: border), - padding: const EdgeInsets.symmetric(horizontal: 6), - enableSplash: false, - itemExtent: widget.items.length == 1 ? MediaQuery.sizeOf(context).width : maxExtent, - children: [ - ...widget.items.mapIndexed( - (index, item) => LayoutBuilder(builder: (context, constraints) { - final opacity = (constraints.maxWidth / maxExtent); - return Stack( - clipBehavior: Clip.none, - children: [ - FladderImage(image: item.bannerImage), - Opacity( - opacity: opacity.clamp(0, 1), - child: Stack( + return MouseRegion( + onEnter: (event) => setState(() => showControls = true), + onExit: (event) => setState(() => showControls = false), + child: ConstrainedBox( + constraints: BoxConstraints(maxHeight: widget.maxHeight), + child: LayoutBuilder( + builder: (context, constraints) { + final maxExtent = (constraints.maxHeight * 2.1).clamp( + 250.0, + (MediaQuery.sizeOf(context).shortestSide * 0.75).clamp(251.0, double.maxFinite), + ); + final border = BorderRadius.circular(18); + final itemExtent = widget.items.length == 1 ? MediaQuery.sizeOf(context).width : maxExtent; + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 4) + .copyWith(top: AdaptiveLayout.of(context).isDesktop ? 6 : 10), + child: Stack( + children: [ + CarouselView( + elevation: 3, + shrinkExtent: 0, + controller: carouselController, + shape: RoundedRectangleBorder(borderRadius: border), + padding: const EdgeInsets.symmetric(horizontal: 6), + enableSplash: false, + itemExtent: itemExtent, + children: [ + ...widget.items.mapIndexed( + (index, item) => LayoutBuilder(builder: (context, constraints) { + final opacity = (constraints.maxWidth / maxExtent); + return Stack( + clipBehavior: Clip.none, children: [ - Positioned.fill( - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomLeft, - end: Alignment.topCenter, - colors: [ - ThemesData.of(context) - .dark - .colorScheme - .primaryContainer - .withValues(alpha: 0.85), - Colors.transparent, - ], + FladderImage(image: item.bannerImage), + Opacity( + opacity: opacity.clamp(0, 1), + child: Stack( + children: [ + Positioned.fill( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomLeft, + end: Alignment.topCenter, + colors: [ + ThemesData.of(context) + .dark + .colorScheme + .primaryContainer + .withValues(alpha: 0.85), + Colors.transparent, + ], + ), + ), + ), ), + ], + ), + ), + Align( + alignment: Alignment.bottomLeft, + child: Padding( + padding: const EdgeInsets.all(16.0).copyWith(right: constraints.maxWidth * 0.2), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.title, + maxLines: 2, + softWrap: item.title.length > 25, + overflow: TextOverflow.fade, + style: + Theme.of(context).textTheme.headlineMedium?.copyWith(color: Colors.white), + ), + if (item.label(context) != null || item.subText != null) + Text( + item.label(context) ?? item.subText ?? "", + maxLines: 2, + softWrap: false, + overflow: TextOverflow.fade, + style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Colors.white), + ), + ].addInBetween(const SizedBox(height: 4)), ), ), ), - ], - ), - ), - Align( - alignment: Alignment.bottomLeft, - child: Padding( - padding: const EdgeInsets.all(16.0).copyWith(right: constraints.maxWidth * 0.2), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title, - maxLines: 2, - softWrap: item.title.length > 25, - overflow: TextOverflow.fade, - style: Theme.of(context).textTheme.headlineMedium?.copyWith(color: Colors.white), + FlatButton( + onTap: () => widget.items[index].navigateTo(context), + onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer + ? null + : () { + final poster = widget.items[index]; + showBottomSheetPill( + context: context, + item: poster, + content: (scrollContext, scrollController) => ListView( + shrinkWrap: true, + controller: scrollController, + children: poster + .generateActions(context, ref) + .listTileItems(scrollContext, useIcons: true), + ), + ); + }, + onSecondaryTapDown: AdaptiveLayout.of(context).inputDevice == InputDevice.touch + ? null + : (details) async { + Offset localPosition = details.globalPosition; + RelativeRect position = RelativeRect.fromLTRB(localPosition.dx - 320, + localPosition.dy, localPosition.dx, localPosition.dy); + final poster = widget.items[index]; + + await showMenu( + context: context, + position: position, + items: poster.generateActions(context, ref).popupMenuItems(useIcons: true), + ); + }, + ), + BannerPlayButton(item: widget.items[index]), + IgnorePointer( + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: Colors.white.withValues(alpha: 0.1), + width: 1.0, + ), + borderRadius: border), ), - if (item.label(context) != null || item.subText != null) - Text( - item.label(context) ?? item.subText ?? "", - maxLines: 2, - softWrap: false, - overflow: TextOverflow.fade, - style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Colors.white), - ), - ].addInBetween(const SizedBox(height: 4)), + ), + ], + ); + }), + ) + ], + ), + if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer) + AnimatedOpacity( + duration: const Duration(milliseconds: 250), + opacity: showControls ? 1 : 0, + child: IgnorePointer( + ignoring: !showControls, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Align( + alignment: Alignment.center, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton.filledTonal( + onPressed: () { + final currentPos = carouselController.position; + carouselController.animateTo(currentPos.pixels - itemExtent, + curve: Curves.easeInOutCubic, duration: const Duration(milliseconds: 250)); + }, + icon: const Icon(IconsaxOutline.arrow_left_2), + ), + IconButton.filledTonal( + onPressed: () { + final currentPos = carouselController.position; + carouselController.animateTo(currentPos.pixels + itemExtent, + curve: Curves.easeInOutCubic, duration: const Duration(milliseconds: 250)); + }, + icon: const Icon(IconsaxOutline.arrow_right_3), + ), + ], ), ), ), - FlatButton( - onTap: () => widget.items[index].navigateTo(context), - onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer - ? null - : () { - final poster = widget.items[index]; - showBottomSheetPill( - context: context, - item: poster, - content: (scrollContext, scrollController) => ListView( - shrinkWrap: true, - controller: scrollController, - children: poster - .generateActions(context, ref) - .listTileItems(scrollContext, useIcons: true), - ), - ); - }, - onSecondaryTapDown: AdaptiveLayout.of(context).inputDevice == InputDevice.touch - ? null - : (details) async { - Offset localPosition = details.globalPosition; - RelativeRect position = RelativeRect.fromLTRB( - localPosition.dx - 320, localPosition.dy, localPosition.dx, localPosition.dy); - final poster = widget.items[index]; - - await showMenu( - context: context, - position: position, - items: poster.generateActions(context, ref).popupMenuItems(useIcons: true), - ); - }, - ), - BannerPlayButton(item: widget.items[index]), - IgnorePointer( - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.white.withValues(alpha: 0.1), - width: 1.0, - ), - borderRadius: border), - ), - ), - ], - ); - }), - ) - ], - ), - ); - }, + ), + ), + ], + ), + ); + }, + ), ), ); } From 57b93574b44ef74a9d05dee15de13f177271c1f6 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 14:45:18 +0100 Subject: [PATCH 11/12] Use flutter version from fvm --- .github/workflows/checks.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index dd3daa7..97c5755 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -14,11 +14,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v4.1.1 + - name: Fetch version info + run: | + # Extract flutter_version from .fvmrc + FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc) + echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> "$GITHUB_ENV" + shell: bash + - name: Set up Flutter uses: subosito/flutter-action@v2.16.0 with: channel: ${{ vars.FLUTTER_CHANNEL }} - flutter-version: ${{ vars.FLUTTER_VERSION }} + flutter-version: ${{ env.FLUTTER_VERSION }} cache: true cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" @@ -26,10 +33,10 @@ jobs: - name: Get dependencies run: flutter pub get - - name: Setup dart + - name: Setup Dart uses: dart-lang/setup-dart@v1 - - name: Analyze Dart + - name: Analyze Dart uses: invertase/github-action-dart-analyzer@v3 with: custom-lint: true From 9710946a900b2a045f86b03a7bb58e8b7f45d706 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 5 Jan 2025 15:12:26 +0100 Subject: [PATCH 12/12] Use applicationBrightness --- lib/providers/settings/book_viewer_settings_provider.dart | 4 ++-- lib/providers/settings/video_player_settings_provider.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/providers/settings/book_viewer_settings_provider.dart b/lib/providers/settings/book_viewer_settings_provider.dart index c5eb4b3..206da28 100644 --- a/lib/providers/settings/book_viewer_settings_provider.dart +++ b/lib/providers/settings/book_viewer_settings_provider.dart @@ -125,7 +125,7 @@ class BookViewerSettingsNotifier extends StateNotifier screenBrightness: () => value, ); if (state.screenBrightness != null) { - ScreenBrightness().setSystemScreenBrightness(state.screenBrightness!); + ScreenBrightness().setApplicationScreenBrightness(state.screenBrightness!); } else { ScreenBrightness().resetApplicationScreenBrightness(); } @@ -133,7 +133,7 @@ class BookViewerSettingsNotifier extends StateNotifier void setSavedBrightness() { if (state.screenBrightness != null) { - ScreenBrightness().setSystemScreenBrightness(state.screenBrightness!); + ScreenBrightness().setApplicationScreenBrightness(state.screenBrightness!); } } diff --git a/lib/providers/settings/video_player_settings_provider.dart b/lib/providers/settings/video_player_settings_provider.dart index eb691d3..55b77c9 100644 --- a/lib/providers/settings/video_player_settings_provider.dart +++ b/lib/providers/settings/video_player_settings_provider.dart @@ -33,7 +33,7 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier