TetraStats/lib/widgets/list_tile_trailing_stats.dart

32 lines
1.6 KiB
Dart
Raw Normal View History

2024-03-02 22:26:31 +00:00
import 'package:flutter/material.dart';
2024-03-06 22:34:15 +00:00
import 'package:tetra_stats/utils/numers_formats.dart';
2024-03-02 22:26:31 +00:00
class TrailingStats extends StatelessWidget{
final double yourAPM;
final double yourPPS;
final double yourVS;
final double notyourAPM;
final double notyourPPS;
final double notyourVS;
const TrailingStats(this.yourAPM, this.yourPPS, this.yourVS, this.notyourAPM, this.notyourPPS, this.notyourVS, {super.key});
@override
Widget build(BuildContext context) {
2024-11-02 22:46:42 +00:00
const TextStyle style = TextStyle(height: 1.1, fontWeight: FontWeight.w100, fontSize: 15);
2024-03-02 22:26:31 +00:00
return Table(
defaultColumnWidth: const IntrinsicColumnWidth(),
defaultVerticalAlignment: TableCellVerticalAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
columnWidths: const {
2024-11-02 22:46:42 +00:00
0: FixedColumnWidth(54),
2: FixedColumnWidth(54),
2024-03-02 22:26:31 +00:00
},
children: [
TableRow(children: [Text(f2.format(yourAPM), textAlign: TextAlign.right, style: style), const Text(" :", style: style), Text(f2.format(notyourAPM), textAlign: TextAlign.right, style: style), const Text(" APM", textAlign: TextAlign.right, style: style)]),
TableRow(children: [Text(f2.format(yourPPS), textAlign: TextAlign.right, style: style), const Text(" :", style: style), Text(f2.format(notyourPPS), textAlign: TextAlign.right, style: style), const Text(" PPS", textAlign: TextAlign.right, style: style)]),
TableRow(children: [Text(f2.format(yourVS), textAlign: TextAlign.right, style: style), const Text(" :", style: style), Text(f2.format(notyourVS), textAlign: TextAlign.right, style: style), const Text(" VS", textAlign: TextAlign.right, style: style)]),
2024-03-02 22:26:31 +00:00
],
);
}
}