lyrics_screen: don't animate music visualizer if audio isn't playing
This commit is contained in:
parent
4b5d0bd09c
commit
415325ac94
|
@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:freezer/api/definitions.dart';
|
||||
import 'package:freezer/api/pipe_api.dart';
|
||||
import 'package:freezer/api/player/audio_handler.dart';
|
||||
import 'package:freezer/api/player/player_helper.dart';
|
||||
import 'package:freezer/settings.dart';
|
||||
import 'package:freezer/translations.i18n.dart';
|
||||
|
@ -302,12 +303,20 @@ class _LyricsWidgetState extends State<LyricsWidget>
|
|||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 8.0 * 3 + 6.0,
|
||||
child: MiniMusicVisualizer(
|
||||
color: textColor,
|
||||
width: 8.0,
|
||||
height: 16.0,
|
||||
animate: _currentIndex == -1,
|
||||
),
|
||||
child: StreamBuilder<bool>(
|
||||
initialData: playerHelper
|
||||
.playing.valueOrNull,
|
||||
stream: playerHelper.playing,
|
||||
builder: (context, snapshot) {
|
||||
return MiniMusicVisualizer(
|
||||
color: textColor,
|
||||
width: 8.0,
|
||||
height: 16.0,
|
||||
animate: (snapshot.data ??
|
||||
false) &&
|
||||
_currentIndex == -1,
|
||||
);
|
||||
}),
|
||||
)));
|
||||
}
|
||||
return DecoratedBox(
|
||||
|
|
Loading…
Reference in New Issue