TetraStats/lib/widgets/sp_trailing_stats.dart

29 lines
1.2 KiB
Dart
Raw Normal View History

2024-06-13 21:12:48 +00:00
import 'package:flutter/material.dart';
import 'package:tetra_stats/data_objects/tetrio.dart';
import 'package:tetra_stats/utils/numers_formats.dart';
class SpTrailingStats extends StatelessWidget{
2024-07-27 19:10:45 +00:00
final ResultsStats endContext;
final String gamemode;
2024-06-13 21:12:48 +00:00
2024-07-27 19:10:45 +00:00
const SpTrailingStats(this.endContext, this.gamemode, {super.key});
2024-06-13 21:12:48 +00:00
@override
Widget build(BuildContext context) {
const TextStyle style = TextStyle(height: 1.1, fontWeight: FontWeight.w100, fontSize: 13);
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text("${endContext.piecesPlaced} P, ${f2.format(endContext.pps)} PPS", style: style, textAlign: TextAlign.right),
Text("${intf.format(endContext.finessePercentage*100)}% F, ${endContext.finesse?.faults} FF", style: style, textAlign: TextAlign.right),
2024-07-27 19:10:45 +00:00
Text(switch(gamemode){
2024-06-13 21:12:48 +00:00
"40l" => "${f2.format(endContext.kps)} KPS, ${f2.format(endContext.kpp)} KPP",
"blitz" => "${intf.format(endContext.spp)} SPP, lvl ${endContext.level}",
"5mblast" => "${intf.format(endContext.spp)} SPP, ${endContext.lines} L",
String() => "huh"
}, style: style, textAlign: TextAlign.right)
],
);
}
}