This repository has been archived on 2025-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/cards/badges.dart
2020-05-09 13:38:05 +00:00

29 lines
696 B
Dart

part of '../main.dart';
class Badges extends StatelessWidget {
final BadgesData badges;
const Badges({Key key, this.badges}) : super(key: key);
@override
Widget build(BuildContext context) {
List<EntityWrapper> entitiesToShow = badges.getEntitiesToShow();
if (entitiesToShow.isNotEmpty) {
return Wrap(
alignment: WrapAlignment.center,
spacing: 10.0,
runSpacing: 1.0,
children: entitiesToShow.map((entity) =>
EntityModel(
entityWrapper: entity,
child: BadgeWidget(),
handleTap: true,
)).toList(),
);
}
return Container(height: 0.0, width: 0.0,);
}
}