fix: tolerate num-typed JSON color entries in SeasonTheme
This commit is contained in:
@@ -17,12 +17,12 @@ class SeasonTheme {
|
|||||||
tileSet: (json['tileSet'] as String?) ?? 'spring',
|
tileSet: (json['tileSet'] as String?) ?? 'spring',
|
||||||
background: (json['background'] as String?) ?? '',
|
background: (json['background'] as String?) ?? '',
|
||||||
backgroundGradient: json['backgroundGradient'] != null
|
backgroundGradient: json['backgroundGradient'] != null
|
||||||
? [for (final c in json['backgroundGradient'] as List) c as int]
|
? [for (final c in json['backgroundGradient'] as List) (c as num).toInt()]
|
||||||
: defaultGradient,
|
: defaultGradient,
|
||||||
accentColor: (json['accentColor'] as int?) ?? 0xFFFF7EB3,
|
accentColor: (json['accentColor'] as int?) ?? 0xFFFF7EB3,
|
||||||
particleType: (json['particleType'] as String?) ?? 'petals',
|
particleType: (json['particleType'] as String?) ?? 'petals',
|
||||||
tilePalette: json['tilePalette'] != null
|
tilePalette: json['tilePalette'] != null
|
||||||
? [for (final c in json['tilePalette'] as List) c as int]
|
? [for (final c in json['tilePalette'] as List) (c as num).toInt()]
|
||||||
: null,
|
: null,
|
||||||
boardTint: json['boardTint'] as int?,
|
boardTint: json['boardTint'] as int?,
|
||||||
);
|
);
|
||||||
@@ -42,7 +42,7 @@ class SeasonTheme {
|
|||||||
/// petals | snow | leaves | none
|
/// petals | snow | leaves | none
|
||||||
final String particleType;
|
final String particleType;
|
||||||
|
|
||||||
/// Optional 8-color tile override; null = built-in candy palette.
|
/// Optional tile color override; null = built-in candy palette.
|
||||||
final List<int>? tilePalette;
|
final List<int>? tilePalette;
|
||||||
|
|
||||||
/// Optional board background override.
|
/// Optional board background override.
|
||||||
|
|||||||
Reference in New Issue
Block a user