diff --git a/lib/ui/widgets/season_background.dart b/lib/ui/widgets/season_background.dart index d9e78a6..ffb9161 100644 --- a/lib/ui/widgets/season_background.dart +++ b/lib/ui/widgets/season_background.dart @@ -28,12 +28,20 @@ class _SeasonBackgroundState extends State duration: const Duration(seconds: 18), ); + late ThemeColors _colors = ThemeColors(widget.theme); + @override void initState() { super.initState(); if (!debugDisableLoopingAnimations) _drift.repeat(); } + @override + void didUpdateWidget(SeasonBackground old) { + super.didUpdateWidget(old); + if (old.theme != widget.theme) _colors = ThemeColors(widget.theme); + } + @override void dispose() { _drift.dispose(); @@ -42,13 +50,12 @@ class _SeasonBackgroundState extends State @override Widget build(BuildContext context) { - final colors = ThemeColors(widget.theme); return RepaintBoundary( child: AnimatedBuilder( animation: _drift, builder: (context, _) => CustomPaint( size: Size.infinite, - painter: _AmbiencePainter(colors: colors, t: _drift.value), + painter: _AmbiencePainter(colors: _colors, t: _drift.value), ), ), ); @@ -110,7 +117,7 @@ class _AmbiencePainter extends CustomPainter { paint.color = Colors.white.withValues(alpha: 0.35); canvas.drawCircle(Offset.zero, s * 0.4, paint); case 'leaves': - paint.color = const Color(0xFFE8945A).withValues(alpha: 0.35); + paint.color = colors.accent.withValues(alpha: 0.35); canvas.drawOval( Rect.fromCenter(center: Offset.zero, width: s, height: s * 0.55), paint);