WIP #530 Badges refactoring

This commit is contained in:
Yegor Vialov
2020-05-09 13:38:05 +00:00
parent 4fbf58e707
commit 13508ee92f
8 changed files with 128 additions and 89 deletions

29
lib/cards/badges.dart Normal file
View File

@ -0,0 +1,29 @@
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,);
}
}