freezer/lib/settings.g.dart

483 lines
16 KiB
Dart
Raw Normal View History

2020-06-23 19:23:12 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'settings.dart';
// **************************************************************************
2023-07-29 02:17:26 +00:00
// TypeAdapterGenerator
2020-06-23 19:23:12 +00:00
// **************************************************************************
2023-07-29 02:17:26 +00:00
class SettingsAdapter extends TypeAdapter<Settings> {
@override
final int typeId = 24;
@override
Settings read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Settings()
..language = fields[0] as String?
..ignoreInterruptions = fields[1] as bool
..enableEqualizer = fields[2] as bool
..arl = fields[3] as String?
..wifiQuality = fields[4] as AudioQuality
..mobileQuality = fields[5] as AudioQuality
..offlineQuality = fields[6] as AudioQuality
..downloadQuality = fields[7] as AudioQuality
..downloadPath = fields[8] as String?
..downloadFilename = fields[9] as String
..albumFolder = fields[10] as bool
..artistFolder = fields[11] as bool
..albumDiscFolder = fields[12] as bool
..overwriteDownload = fields[13] as bool
..downloadThreads = fields[14] as int
..playlistFolder = fields[15] as bool
..downloadLyrics = fields[16] as bool
..trackCover = fields[17] as bool
..albumCover = fields[18] as bool
..nomediaFiles = fields[19] as bool
..artistSeparator = fields[20] as String
..singletonFilename = fields[21] as String
..albumArtResolution = fields[22] as int
..tags = (fields[23] as List).cast<String>()
..theme = fields[24] as Themes
..useSystemTheme = fields[25] as bool
..colorGradientBackground = fields[26] as bool
..blurPlayerBackground = fields[27] as bool
..font = fields[28] as String
..lyricsVisualizer = fields[29] as bool
..displayMode = fields[30] as int?
..enableFilledPlayButton = fields[31] == null ? true : fields[31] as bool
2021-11-01 16:41:25 +00:00
..playerBackgroundOnLyrics =
2023-07-29 02:17:26 +00:00
fields[32] == null ? false : fields[32] as bool
..navigatorRouteType = fields[33] == null
? NavigatorRouteType.material
: fields[33] as NavigatorRouteType
..primaryColor = fields[34] == null ? Colors.blue : fields[34] as Color
..useArtColor = fields[35] as bool
..deezerLanguage = fields[36] as String
..deezerCountry = fields[37] as String
..logListen = fields[38] as bool
..proxyAddress = fields[39] as String?
..lastFMUsername = fields[40] as String?
..lastFMPassword = fields[41] as String?
..spotifyClientId = fields[42] as String?
..spotifyClientSecret = fields[43] as String?
..spotifyCredentials = fields[44] as SpotifyCredentialsSave?
..materialYouAccent = fields[45] == null ? false : fields[45] as bool
..playerAlbumArtDropShadow =
fields[46] == null ? true : fields[46] as bool
..seekAsSkip = fields[47] == null ? false : fields[47] as bool;
2023-07-29 02:17:26 +00:00
}
@override
void write(BinaryWriter writer, Settings obj) {
writer
..writeByte(48)
2023-07-29 02:17:26 +00:00
..writeByte(0)
..write(obj.language)
..writeByte(1)
..write(obj.ignoreInterruptions)
..writeByte(2)
..write(obj.enableEqualizer)
..writeByte(3)
..write(obj.arl)
..writeByte(4)
..write(obj.wifiQuality)
..writeByte(5)
..write(obj.mobileQuality)
..writeByte(6)
..write(obj.offlineQuality)
..writeByte(7)
..write(obj.downloadQuality)
..writeByte(8)
..write(obj.downloadPath)
..writeByte(9)
..write(obj.downloadFilename)
..writeByte(10)
..write(obj.albumFolder)
..writeByte(11)
..write(obj.artistFolder)
..writeByte(12)
..write(obj.albumDiscFolder)
..writeByte(13)
..write(obj.overwriteDownload)
..writeByte(14)
..write(obj.downloadThreads)
..writeByte(15)
..write(obj.playlistFolder)
..writeByte(16)
..write(obj.downloadLyrics)
..writeByte(17)
..write(obj.trackCover)
..writeByte(18)
..write(obj.albumCover)
..writeByte(19)
..write(obj.nomediaFiles)
..writeByte(20)
..write(obj.artistSeparator)
..writeByte(21)
..write(obj.singletonFilename)
..writeByte(22)
..write(obj.albumArtResolution)
..writeByte(23)
..write(obj.tags)
..writeByte(24)
..write(obj.theme)
..writeByte(25)
..write(obj.useSystemTheme)
..writeByte(26)
..write(obj.colorGradientBackground)
..writeByte(27)
..write(obj.blurPlayerBackground)
..writeByte(28)
..write(obj.font)
..writeByte(29)
..write(obj.lyricsVisualizer)
..writeByte(30)
..write(obj.displayMode)
..writeByte(31)
..write(obj.enableFilledPlayButton)
..writeByte(32)
..write(obj.playerBackgroundOnLyrics)
..writeByte(33)
..write(obj.navigatorRouteType)
..writeByte(34)
..write(obj.primaryColor)
..writeByte(35)
..write(obj.useArtColor)
..writeByte(36)
..write(obj.deezerLanguage)
..writeByte(37)
..write(obj.deezerCountry)
..writeByte(38)
..write(obj.logListen)
..writeByte(39)
..write(obj.proxyAddress)
..writeByte(40)
..write(obj.lastFMUsername)
..writeByte(41)
..write(obj.lastFMPassword)
..writeByte(42)
..write(obj.spotifyClientId)
..writeByte(43)
..write(obj.spotifyClientSecret)
..writeByte(44)
..write(obj.spotifyCredentials)
..writeByte(45)
..write(obj.materialYouAccent)
..writeByte(46)
..write(obj.playerAlbumArtDropShadow)
..writeByte(47)
..write(obj.seekAsSkip);
2023-07-29 02:17:26 +00:00
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SettingsAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class SpotifyCredentialsSaveAdapter
extends TypeAdapter<SpotifyCredentialsSave> {
@override
final int typeId = 25;
@override
SpotifyCredentialsSave read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return SpotifyCredentialsSave(
accessToken: fields[0] as String?,
refreshToken: fields[1] as String?,
scopes: (fields[2] as List?)?.cast<String>(),
expiration: fields[3] as DateTime?,
);
}
@override
void write(BinaryWriter writer, SpotifyCredentialsSave obj) {
writer
..writeByte(4)
..writeByte(0)
..write(obj.accessToken)
..writeByte(1)
..write(obj.refreshToken)
..writeByte(2)
..write(obj.scopes)
..writeByte(3)
..write(obj.expiration);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SpotifyCredentialsSaveAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class AudioQualityAdapter extends TypeAdapter<AudioQuality> {
@override
final int typeId = 29;
@override
AudioQuality read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return AudioQuality.MP3_128;
case 1:
return AudioQuality.MP3_320;
case 2:
return AudioQuality.FLAC;
case 3:
return AudioQuality.ASK;
default:
return AudioQuality.MP3_128;
}
}
@override
void write(BinaryWriter writer, AudioQuality obj) {
switch (obj) {
case AudioQuality.MP3_128:
writer.writeByte(0);
break;
case AudioQuality.MP3_320:
writer.writeByte(1);
break;
case AudioQuality.FLAC:
writer.writeByte(2);
break;
case AudioQuality.ASK:
writer.writeByte(3);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AudioQualityAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class ThemesAdapter extends TypeAdapter<Themes> {
@override
final int typeId = 28;
@override
Themes read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return Themes.Light;
case 1:
return Themes.Dark;
case 2:
return Themes.Deezer;
case 3:
return Themes.Black;
default:
return Themes.Light;
}
}
@override
void write(BinaryWriter writer, Themes obj) {
switch (obj) {
case Themes.Light:
writer.writeByte(0);
break;
case Themes.Dark:
writer.writeByte(1);
break;
case Themes.Deezer:
writer.writeByte(2);
break;
case Themes.Black:
writer.writeByte(3);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ThemesAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Settings _$SettingsFromJson(Map<String, dynamic> json) => Settings()
..language = json['language'] as String?
..ignoreInterruptions = json['ignoreInterruptions'] as bool
..enableEqualizer = json['enableEqualizer'] as bool
..arl = json['arl'] as String?
..offlineMode = json['offlineMode'] as bool
..wifiQuality = $enumDecode(_$AudioQualityEnumMap, json['wifiQuality'])
..mobileQuality = $enumDecode(_$AudioQualityEnumMap, json['mobileQuality'])
..offlineQuality = $enumDecode(_$AudioQualityEnumMap, json['offlineQuality'])
..downloadQuality =
$enumDecode(_$AudioQualityEnumMap, json['downloadQuality'])
..downloadPath = json['downloadPath'] as String?
..downloadFilename = json['downloadFilename'] as String
..albumFolder = json['albumFolder'] as bool
..artistFolder = json['artistFolder'] as bool
..albumDiscFolder = json['albumDiscFolder'] as bool
..overwriteDownload = json['overwriteDownload'] as bool
..downloadThreads = json['downloadThreads'] as int
..playlistFolder = json['playlistFolder'] as bool
..downloadLyrics = json['downloadLyrics'] as bool
..trackCover = json['trackCover'] as bool
..albumCover = json['albumCover'] as bool
..nomediaFiles = json['nomediaFiles'] as bool
..artistSeparator = json['artistSeparator'] as String
..singletonFilename = json['singletonFilename'] as String
..albumArtResolution = json['albumArtResolution'] as int
..tags = (json['tags'] as List<dynamic>).map((e) => e as String).toList()
..theme = $enumDecode(_$ThemesEnumMap, json['theme'])
..useSystemTheme = json['useSystemTheme'] as bool
..colorGradientBackground = json['colorGradientBackground'] as bool
..blurPlayerBackground = json['blurPlayerBackground'] as bool
..font = json['font'] as String
..lyricsVisualizer = json['lyricsVisualizer'] as bool
..displayMode = json['displayMode'] as int?
..enableFilledPlayButton = json['enableFilledPlayButton'] as bool
..playerBackgroundOnLyrics = json['playerBackgroundOnLyrics'] as bool
..navigatorRouteType =
$enumDecode(_$NavigatorRouteTypeEnumMap, json['navigatorRouteType'])
..primaryColor = Settings._colorFromJson(json['primaryColor'] as int?)
..useArtColor = json['useArtColor'] as bool
..deezerLanguage = json['deezerLanguage'] as String
..deezerCountry = json['deezerCountry'] as String
..logListen = json['logListen'] as bool
..proxyAddress = json['proxyAddress'] as String?
..lastFMUsername = json['lastFMUsername'] as String?
..lastFMPassword = json['lastFMPassword'] as String?
..spotifyClientId = json['spotifyClientId'] as String?
..spotifyClientSecret = json['spotifyClientSecret'] as String?
..spotifyCredentials = json['spotifyCredentials'] == null
? null
: SpotifyCredentialsSave.fromJson(
json['spotifyCredentials'] as Map<String, dynamic>)
..materialYouAccent = json['materialYouAccent'] as bool
..playerAlbumArtDropShadow = json['playerAlbumArtDropShadow'] as bool
..seekAsSkip = json['seekAsSkip'] as bool;
2020-06-23 19:23:12 +00:00
Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
'language': instance.language,
'ignoreInterruptions': instance.ignoreInterruptions,
2021-02-09 20:14:14 +00:00
'enableEqualizer': instance.enableEqualizer,
2020-06-23 19:23:12 +00:00
'arl': instance.arl,
2023-07-29 02:17:26 +00:00
'wifiQuality': _$AudioQualityEnumMap[instance.wifiQuality]!,
'mobileQuality': _$AudioQualityEnumMap[instance.mobileQuality]!,
'offlineQuality': _$AudioQualityEnumMap[instance.offlineQuality]!,
'downloadQuality': _$AudioQualityEnumMap[instance.downloadQuality]!,
2020-06-23 19:23:12 +00:00
'downloadPath': instance.downloadPath,
2020-09-01 14:41:15 +00:00
'downloadFilename': instance.downloadFilename,
'albumFolder': instance.albumFolder,
'artistFolder': instance.artistFolder,
'albumDiscFolder': instance.albumDiscFolder,
'overwriteDownload': instance.overwriteDownload,
'downloadThreads': instance.downloadThreads,
'playlistFolder': instance.playlistFolder,
'downloadLyrics': instance.downloadLyrics,
2020-10-10 20:51:20 +00:00
'trackCover': instance.trackCover,
'albumCover': instance.albumCover,
'nomediaFiles': instance.nomediaFiles,
'artistSeparator': instance.artistSeparator,
'singletonFilename': instance.singletonFilename,
'albumArtResolution': instance.albumArtResolution,
2021-02-09 20:14:14 +00:00
'tags': instance.tags,
2023-07-29 02:17:26 +00:00
'theme': _$ThemesEnumMap[instance.theme]!,
'useSystemTheme': instance.useSystemTheme,
'colorGradientBackground': instance.colorGradientBackground,
2021-02-09 20:14:14 +00:00
'blurPlayerBackground': instance.blurPlayerBackground,
'font': instance.font,
'lyricsVisualizer': instance.lyricsVisualizer,
2021-03-21 21:46:44 +00:00
'displayMode': instance.displayMode,
2021-11-01 16:41:25 +00:00
'enableFilledPlayButton': instance.enableFilledPlayButton,
'playerBackgroundOnLyrics': instance.playerBackgroundOnLyrics,
'navigatorRouteType':
2023-07-29 02:17:26 +00:00
_$NavigatorRouteTypeEnumMap[instance.navigatorRouteType]!,
2020-06-23 19:23:12 +00:00
'primaryColor': Settings._colorToJson(instance.primaryColor),
'useArtColor': instance.useArtColor,
'deezerLanguage': instance.deezerLanguage,
'deezerCountry': instance.deezerCountry,
'logListen': instance.logListen,
'proxyAddress': instance.proxyAddress,
'lastFMUsername': instance.lastFMUsername,
'lastFMPassword': instance.lastFMPassword,
2021-04-05 20:22:32 +00:00
'spotifyClientId': instance.spotifyClientId,
'spotifyClientSecret': instance.spotifyClientSecret,
'spotifyCredentials': instance.spotifyCredentials?.toJson(),
'materialYouAccent': instance.materialYouAccent,
'playerAlbumArtDropShadow': instance.playerAlbumArtDropShadow,
'seekAsSkip': instance.seekAsSkip,
2020-06-23 19:23:12 +00:00
};
const _$AudioQualityEnumMap = {
AudioQuality.MP3_128: 'MP3_128',
AudioQuality.MP3_320: 'MP3_320',
AudioQuality.FLAC: 'FLAC',
AudioQuality.ASK: 'ASK',
2020-06-23 19:23:12 +00:00
};
const _$ThemesEnumMap = {
Themes.Light: 'Light',
Themes.Dark: 'Dark',
Themes.Deezer: 'Deezer',
2020-06-23 19:23:12 +00:00
Themes.Black: 'Black',
};
2021-11-01 16:41:25 +00:00
const _$NavigatorRouteTypeEnumMap = {
NavigatorRouteType.blur_slide: 'blur_slide',
2023-07-29 02:17:26 +00:00
NavigatorRouteType.fade: 'fade',
NavigatorRouteType.fade_blur: 'fade_blur',
2021-11-01 16:41:25 +00:00
NavigatorRouteType.material: 'material',
NavigatorRouteType.cupertino: 'cupertino',
};
SpotifyCredentialsSave _$SpotifyCredentialsSaveFromJson(
2021-09-01 12:38:32 +00:00
Map<String, dynamic> json) =>
SpotifyCredentialsSave(
accessToken: json['accessToken'] as String?,
refreshToken: json['refreshToken'] as String?,
scopes:
(json['scopes'] as List<dynamic>?)?.map((e) => e as String).toList(),
expiration: json['expiration'] == null
? null
: DateTime.parse(json['expiration'] as String),
);
Map<String, dynamic> _$SpotifyCredentialsSaveToJson(
SpotifyCredentialsSave instance) =>
<String, dynamic>{
'accessToken': instance.accessToken,
'refreshToken': instance.refreshToken,
'scopes': instance.scopes,
'expiration': instance.expiration?.toIso8601String(),
};