toolheim/mobile-app/lib/widgets/henchmengroup_list_tile_widget.dart

57 lines
1.6 KiB
Dart
Raw Normal View History

2019-08-13 22:37:22 +02:00
import 'package:badges/badges.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:toolheim/widgets/stats_widget.dart';
class HenchmengroupListTileWidget extends StatelessWidget {
final henchmenGroup;
HenchmengroupListTileWidget(this.henchmenGroup);
@override
Widget build(BuildContext context) {
return ListTile(
title: Padding(
padding: const EdgeInsets.only(bottom: 7),
child: Row(children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 5),
child: Text(henchmenGroup.name),
),
Text(
'(' + henchmenGroup.type + ')',
style: TextStyle(fontSize: 10),
),
Spacer(),
Badge(
badgeColor: Colors.black12,
shape: BadgeShape.square,
borderRadius: 2,
badgeContent: Text(henchmenGroup.number.toString() + 'x',
style: TextStyle(color: Colors.white)),
),
]),
),
leading: CircleAvatar(
child: Row(children: <Widget>[
Spacer(),
Text(henchmenGroup.experience.toString(),
style: TextStyle(color: Colors.white)),
Text(
'xp',
style: TextStyle(fontSize: 8),
),
Spacer()
]),
backgroundColor: Colors.orange,
foregroundColor: Colors.white,
),
subtitle: StatsWidget(henchmenGroup.stats),
isThreeLine: true,
onTap: () {
//Navigator.pushNamed(context, '/unit', arguments: hero);
},
);
}
}