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

View File

@ -44,13 +44,10 @@ class ViewWidget extends StatelessWidget {
} else {
cardsContainer = Container();
}
return ListView(
shrinkWrap: true,
return SingleChildScrollView(
scrollDirection: Axis.vertical,
padding: EdgeInsets.all(0),
children: <Widget>[
_buildBadges(context),
cardsContainer
]
child: cardsContainer
);
}
}
@ -63,18 +60,4 @@ class ViewWidget extends StatelessWidget {
}
}
Widget _buildBadges(BuildContext context) {
if (this.view.badges.isNotEmpty) {
return Wrap(
alignment: WrapAlignment.center,
spacing: 10.0,
runSpacing: 1.0,
children: this.view.badges.map((badge) =>
badge.buildBadgeWidget(context)).toList(),
);
} else {
return Container(width: 0, height: 0,);
}
}
}