WIP Themes: State colors from themes

This commit is contained in:
Yegor Vialov
2020-04-04 21:39:12 +00:00
parent d6f7096055
commit 379e1a4a7e
11 changed files with 98 additions and 58 deletions

View File

@ -33,7 +33,7 @@ class _MediaPlayerProgressBarState extends State<MediaPlayerProgressBar> {
return LinearProgressIndicator(
value: progress,
backgroundColor: Colors.black45,
valueColor: AlwaysStoppedAnimation<Color>(HAClientTheme().stateColor(EntityState.on)),
valueColor: AlwaysStoppedAnimation<Color>(HAClientTheme().getOnStateColor(context)),
);
}

View File

@ -12,7 +12,7 @@ class MediaPlayerWidget extends StatelessWidget {
Stack(
alignment: AlignmentDirectional.topEnd,
children: <Widget>[
_buildImage(entity),
_buildImage(entity, context),
Positioned(
bottom: 0.0,
left: 0.0,
@ -68,7 +68,7 @@ class MediaPlayerWidget extends StatelessWidget {
);
}
Widget _buildImage(MediaPlayerEntity entity) {
Widget _buildImage(MediaPlayerEntity entity, BuildContext context) {
String state = entity.state;
if (entity.entityPicture != null && state != EntityState.off && state != EntityState.unavailable && state != EntityState.idle) {
return Container(
@ -94,7 +94,7 @@ class MediaPlayerWidget extends StatelessWidget {
Icon(
MaterialDesignIcons.getIconDataFromIconName("mdi:movie"),
size: 150.0,
color: HAClientTheme().stateColor("$state"),
color: HAClientTheme().getColorByEntityState("$state", context),
)
],
);