From cd061eceeb421d6bec5cd38bf9f315036ce88887 Mon Sep 17 00:00:00 2001 From: Orangerot Date: Sat, 11 Jan 2025 18:22:32 +0100 Subject: style: refactored into folder structure --- lib/arrows.dart | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 lib/arrows.dart (limited to 'lib/arrows.dart') diff --git a/lib/arrows.dart b/lib/arrows.dart deleted file mode 100644 index ff53e02..0000000 --- a/lib/arrows.dart +++ /dev/null @@ -1,57 +0,0 @@ -import 'package:flutter/material.dart'; - -enum ArrowDirection { - left(Icons.arrow_back), - down(Icons.arrow_downward), - up(Icons.arrow_upward), - right(Icons.arrow_forward); - - const ArrowDirection(this.icon); - - final IconData icon; -} - -class Note { - final double time; - final ArrowDirection direction; - double position = 0; - bool? wasHit; - - Note({required this.time, required this.direction}); -} - -class Arrows extends StatelessWidget { - final List notes; - final double position; - - const Arrows({super.key, required this.notes, required this.position}); - - @override - Widget build(BuildContext context) { - return Stack( - children: notes.map((note) { - double position = note.position * 10000; // * 20 * MediaQuery.of(context).size.height; - - return Arrow( - position: position, - direction: note.direction, - ); - }).toList()); - } -} - -class Arrow extends StatelessWidget { - final double position; - final ArrowDirection direction; - - const Arrow({super.key, required this.position, required this.direction}); - - @override - Widget build(BuildContext context) { - return Positioned( - left: MediaQuery.of(context).size.width / 2 - 50, // Center the arrow - bottom: position + 50, - child: Icon(size: 100, color: Colors.redAccent.shade400, direction.icon), - ); - } -} -- cgit v1.2.3