mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
feature: Adds schemeVariants to color options (#109)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
98130f953e
commit
0b0cd3a557
11 changed files with 143 additions and 16 deletions
|
|
@ -30,6 +30,7 @@ class ClientSettingsModel with _$ClientSettingsModel {
|
|||
@Default(1.0) double posterSize,
|
||||
@Default(false) bool pinchPosterZoom,
|
||||
@Default(false) bool mouseDragSupport,
|
||||
@Default(DynamicSchemeVariant.tonalSpot) DynamicSchemeVariant schemeVariant,
|
||||
int? libraryPageSize,
|
||||
}) = _ClientSettingsModel;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ mixin _$ClientSettingsModel {
|
|||
double get posterSize => throw _privateConstructorUsedError;
|
||||
bool get pinchPosterZoom => throw _privateConstructorUsedError;
|
||||
bool get mouseDragSupport => throw _privateConstructorUsedError;
|
||||
DynamicSchemeVariant get schemeVariant => throw _privateConstructorUsedError;
|
||||
int? get libraryPageSize => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ClientSettingsModel to a JSON map.
|
||||
|
|
@ -70,6 +71,7 @@ abstract class $ClientSettingsModelCopyWith<$Res> {
|
|||
double posterSize,
|
||||
bool pinchPosterZoom,
|
||||
bool mouseDragSupport,
|
||||
DynamicSchemeVariant schemeVariant,
|
||||
int? libraryPageSize});
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +105,7 @@ class _$ClientSettingsModelCopyWithImpl<$Res, $Val extends ClientSettingsModel>
|
|||
Object? posterSize = null,
|
||||
Object? pinchPosterZoom = null,
|
||||
Object? mouseDragSupport = null,
|
||||
Object? schemeVariant = null,
|
||||
Object? libraryPageSize = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
|
|
@ -166,6 +169,10 @@ class _$ClientSettingsModelCopyWithImpl<$Res, $Val extends ClientSettingsModel>
|
|||
? _value.mouseDragSupport
|
||||
: mouseDragSupport // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
schemeVariant: null == schemeVariant
|
||||
? _value.schemeVariant
|
||||
: schemeVariant // ignore: cast_nullable_to_non_nullable
|
||||
as DynamicSchemeVariant,
|
||||
libraryPageSize: freezed == libraryPageSize
|
||||
? _value.libraryPageSize
|
||||
: libraryPageSize // ignore: cast_nullable_to_non_nullable
|
||||
|
|
@ -198,6 +205,7 @@ abstract class _$$ClientSettingsModelImplCopyWith<$Res>
|
|||
double posterSize,
|
||||
bool pinchPosterZoom,
|
||||
bool mouseDragSupport,
|
||||
DynamicSchemeVariant schemeVariant,
|
||||
int? libraryPageSize});
|
||||
}
|
||||
|
||||
|
|
@ -229,6 +237,7 @@ class __$$ClientSettingsModelImplCopyWithImpl<$Res>
|
|||
Object? posterSize = null,
|
||||
Object? pinchPosterZoom = null,
|
||||
Object? mouseDragSupport = null,
|
||||
Object? schemeVariant = null,
|
||||
Object? libraryPageSize = freezed,
|
||||
}) {
|
||||
return _then(_$ClientSettingsModelImpl(
|
||||
|
|
@ -292,6 +301,10 @@ class __$$ClientSettingsModelImplCopyWithImpl<$Res>
|
|||
? _value.mouseDragSupport
|
||||
: mouseDragSupport // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
schemeVariant: null == schemeVariant
|
||||
? _value.schemeVariant
|
||||
: schemeVariant // ignore: cast_nullable_to_non_nullable
|
||||
as DynamicSchemeVariant,
|
||||
libraryPageSize: freezed == libraryPageSize
|
||||
? _value.libraryPageSize
|
||||
: libraryPageSize // ignore: cast_nullable_to_non_nullable
|
||||
|
|
@ -320,6 +333,7 @@ class _$ClientSettingsModelImpl extends _ClientSettingsModel
|
|||
this.posterSize = 1.0,
|
||||
this.pinchPosterZoom = false,
|
||||
this.mouseDragSupport = false,
|
||||
this.schemeVariant = DynamicSchemeVariant.tonalSpot,
|
||||
this.libraryPageSize})
|
||||
: super._();
|
||||
|
||||
|
|
@ -369,11 +383,14 @@ class _$ClientSettingsModelImpl extends _ClientSettingsModel
|
|||
@JsonKey()
|
||||
final bool mouseDragSupport;
|
||||
@override
|
||||
@JsonKey()
|
||||
final DynamicSchemeVariant schemeVariant;
|
||||
@override
|
||||
final int? libraryPageSize;
|
||||
|
||||
@override
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'ClientSettingsModel(syncPath: $syncPath, position: $position, size: $size, timeOut: $timeOut, nextUpDateCutoff: $nextUpDateCutoff, themeMode: $themeMode, themeColor: $themeColor, amoledBlack: $amoledBlack, blurPlaceHolders: $blurPlaceHolders, blurUpcomingEpisodes: $blurUpcomingEpisodes, selectedLocale: $selectedLocale, enableMediaKeys: $enableMediaKeys, posterSize: $posterSize, pinchPosterZoom: $pinchPosterZoom, mouseDragSupport: $mouseDragSupport, libraryPageSize: $libraryPageSize)';
|
||||
return 'ClientSettingsModel(syncPath: $syncPath, position: $position, size: $size, timeOut: $timeOut, nextUpDateCutoff: $nextUpDateCutoff, themeMode: $themeMode, themeColor: $themeColor, amoledBlack: $amoledBlack, blurPlaceHolders: $blurPlaceHolders, blurUpcomingEpisodes: $blurUpcomingEpisodes, selectedLocale: $selectedLocale, enableMediaKeys: $enableMediaKeys, posterSize: $posterSize, pinchPosterZoom: $pinchPosterZoom, mouseDragSupport: $mouseDragSupport, schemeVariant: $schemeVariant, libraryPageSize: $libraryPageSize)';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -396,6 +413,7 @@ class _$ClientSettingsModelImpl extends _ClientSettingsModel
|
|||
..add(DiagnosticsProperty('posterSize', posterSize))
|
||||
..add(DiagnosticsProperty('pinchPosterZoom', pinchPosterZoom))
|
||||
..add(DiagnosticsProperty('mouseDragSupport', mouseDragSupport))
|
||||
..add(DiagnosticsProperty('schemeVariant', schemeVariant))
|
||||
..add(DiagnosticsProperty('libraryPageSize', libraryPageSize));
|
||||
}
|
||||
|
||||
|
|
@ -432,6 +450,8 @@ class _$ClientSettingsModelImpl extends _ClientSettingsModel
|
|||
other.pinchPosterZoom == pinchPosterZoom) &&
|
||||
(identical(other.mouseDragSupport, mouseDragSupport) ||
|
||||
other.mouseDragSupport == mouseDragSupport) &&
|
||||
(identical(other.schemeVariant, schemeVariant) ||
|
||||
other.schemeVariant == schemeVariant) &&
|
||||
(identical(other.libraryPageSize, libraryPageSize) ||
|
||||
other.libraryPageSize == libraryPageSize));
|
||||
}
|
||||
|
|
@ -455,6 +475,7 @@ class _$ClientSettingsModelImpl extends _ClientSettingsModel
|
|||
posterSize,
|
||||
pinchPosterZoom,
|
||||
mouseDragSupport,
|
||||
schemeVariant,
|
||||
libraryPageSize);
|
||||
|
||||
/// Create a copy of ClientSettingsModel
|
||||
|
|
@ -491,6 +512,7 @@ abstract class _ClientSettingsModel extends ClientSettingsModel {
|
|||
final double posterSize,
|
||||
final bool pinchPosterZoom,
|
||||
final bool mouseDragSupport,
|
||||
final DynamicSchemeVariant schemeVariant,
|
||||
final int? libraryPageSize}) = _$ClientSettingsModelImpl;
|
||||
_ClientSettingsModel._() : super._();
|
||||
|
||||
|
|
@ -529,6 +551,8 @@ abstract class _ClientSettingsModel extends ClientSettingsModel {
|
|||
@override
|
||||
bool get mouseDragSupport;
|
||||
@override
|
||||
DynamicSchemeVariant get schemeVariant;
|
||||
@override
|
||||
int? get libraryPageSize;
|
||||
|
||||
/// Create a copy of ClientSettingsModel
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ _$ClientSettingsModelImpl _$$ClientSettingsModelImplFromJson(
|
|||
posterSize: (json['posterSize'] as num?)?.toDouble() ?? 1.0,
|
||||
pinchPosterZoom: json['pinchPosterZoom'] as bool? ?? false,
|
||||
mouseDragSupport: json['mouseDragSupport'] as bool? ?? false,
|
||||
schemeVariant: $enumDecodeNullable(
|
||||
_$DynamicSchemeVariantEnumMap, json['schemeVariant']) ??
|
||||
DynamicSchemeVariant.tonalSpot,
|
||||
libraryPageSize: (json['libraryPageSize'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
|
|
@ -55,6 +58,7 @@ Map<String, dynamic> _$$ClientSettingsModelImplToJson(
|
|||
'posterSize': instance.posterSize,
|
||||
'pinchPosterZoom': instance.pinchPosterZoom,
|
||||
'mouseDragSupport': instance.mouseDragSupport,
|
||||
'schemeVariant': _$DynamicSchemeVariantEnumMap[instance.schemeVariant]!,
|
||||
'libraryPageSize': instance.libraryPageSize,
|
||||
};
|
||||
|
||||
|
|
@ -81,3 +85,15 @@ const _$ColorThemesEnumMap = {
|
|||
ColorThemes.deepPurple: 'deepPurple',
|
||||
ColorThemes.blueGrey: 'blueGrey',
|
||||
};
|
||||
|
||||
const _$DynamicSchemeVariantEnumMap = {
|
||||
DynamicSchemeVariant.tonalSpot: 'tonalSpot',
|
||||
DynamicSchemeVariant.fidelity: 'fidelity',
|
||||
DynamicSchemeVariant.monochrome: 'monochrome',
|
||||
DynamicSchemeVariant.neutral: 'neutral',
|
||||
DynamicSchemeVariant.vibrant: 'vibrant',
|
||||
DynamicSchemeVariant.expressive: 'expressive',
|
||||
DynamicSchemeVariant.content: 'content',
|
||||
DynamicSchemeVariant.rainbow: 'rainbow',
|
||||
DynamicSchemeVariant.fruitSalad: 'fruitSalad',
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue