import 'package:json_annotation/json_annotation.dart'; part 'settings.g.dart'; @JsonSerializable() class AppSettings { final String defaultService; final String audioQuality; final String filenameFormat; final String downloadDirectory; final bool autoFallback; final bool embedLyrics; final bool maxQualityCover; final bool isFirstLaunch; const AppSettings({ this.defaultService = 'tidal', this.audioQuality = 'LOSSLESS', this.filenameFormat = '{title} - {artist}', this.downloadDirectory = '', this.autoFallback = true, this.embedLyrics = true, this.maxQualityCover = true, this.isFirstLaunch = true, }); AppSettings copyWith({ String? defaultService, String? audioQuality, String? filenameFormat, String? downloadDirectory, bool? autoFallback, bool? embedLyrics, bool? maxQualityCover, bool? isFirstLaunch, }) { return AppSettings( defaultService: defaultService ?? this.defaultService, audioQuality: audioQuality ?? this.audioQuality, filenameFormat: filenameFormat ?? this.filenameFormat, downloadDirectory: downloadDirectory ?? this.downloadDirectory, autoFallback: autoFallback ?? this.autoFallback, embedLyrics: embedLyrics ?? this.embedLyrics, maxQualityCover: maxQualityCover ?? this.maxQualityCover, isFirstLaunch: isFirstLaunch ?? this.isFirstLaunch, ); } factory AppSettings.fromJson(Map json) => _$AppSettingsFromJson(json); Map toJson() => _$AppSettingsToJson(this); }