summaryrefslogtreecommitdiff
path: root/lib/game_over_stats.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/game_over_stats.dart')
-rw-r--r--lib/game_over_stats.dart63
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/game_over_stats.dart b/lib/game_over_stats.dart
deleted file mode 100644
index a80617c..0000000
--- a/lib/game_over_stats.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sense_the_rhythm/arrows.dart';
-import 'package:sense_the_rhythm/level.dart';
-import 'package:sense_the_rhythm/simfile.dart';
-
-class GameOverStats extends StatelessWidget {
- const GameOverStats({super.key, required this.simfile, required this.notes});
-
- final Simfile simfile;
- final List<Note> notes;
-
- @override
- Widget build(BuildContext context) {
- int hits = notes.where((note) => note.wasHit == true).length;
- int misses = notes.where((note) => note.wasHit == false).length;
- int total = notes.length;
- int percent = (hits.toDouble() / total.toDouble() * 100).toInt();
-
- return Scaffold(
- appBar: AppBar(
- leading: IconButton(
- onPressed: () => Navigator.pop(context),
- icon: Icon(Icons.arrow_back)),
- title: Text('Game Stats'),
- ),
- body: Center(
- child: Column(
- children: [
- Text(' $percent%',
- style: TextStyle(
- fontSize: 60,
- fontWeight: FontWeight.bold,
- color: Colors.orange)),
- DataTable(columns: [
- DataColumn(label: Container()),
- DataColumn(label: Container()),
- ], rows: [
- DataRow(cells: [
- DataCell(Text('Hits')),
- DataCell(Text(hits.toString())),
- ]),
- DataRow(cells: [
- DataCell(Text('Misses')),
- DataCell(Text(misses.toString())),
- ]),
- DataRow(cells: [
- DataCell(Text('Total')),
- DataCell(Text(total.toString())),
- ]),
- ]),
- TextButton(
- onPressed: () {
- Route route = MaterialPageRoute(
- builder: (context) => Level(stepmaniaFolderPath: simfile.directoryPath));
- Navigator.pushReplacement(context, route);
- },
- child: Text('Retry'))
- ],
- ),
- ),
- );
- }
-}