diff --git a/assets/images/pattern_hinten.png b/assets/images/pattern_hinten.png new file mode 100644 index 0000000..9166372 Binary files /dev/null and b/assets/images/pattern_hinten.png differ diff --git a/assets/images/pattern_vorne.png b/assets/images/pattern_vorne.png new file mode 100644 index 0000000..b2514e1 Binary files /dev/null and b/assets/images/pattern_vorne.png differ diff --git a/lib/screens/pattern.dart b/lib/screens/pattern.dart index 001944a..f2e97f9 100644 --- a/lib/screens/pattern.dart +++ b/lib/screens/pattern.dart @@ -7,20 +7,68 @@ import 'package:lottis_birthday_escaperoom_app/screens/admin.dart'; import 'package:lottis_birthday_escaperoom_app/util.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; -class PatternScreen extends StatelessWidget { +class PatternScreen extends StatefulWidget { const PatternScreen({Key? key}) : super(key: key); + @override + _PatternScreenState createState() => _PatternScreenState(); +} + +class _PatternScreenState extends State { + bool _showBackPattern = false; + + void _togglePattern(int index) { + setState(() { + _showBackPattern = index == 1; + }); + } + @override Widget build(BuildContext context) { - GameController c = Get.find(); return PopScope( canPop: false, child: Scaffold( - body: Image.asset( - 'assets/images/pattern.jpg', // Replace with your image path - fit: BoxFit.contain, - width: double.infinity, - height: double.infinity, + appBar: AppBar( + title: const Text('Lotti\'s Escape Room - Rätsel 1'), + actions: [ + IconButton( + icon: const Icon(Icons.smart_toy_outlined), + onPressed: () { + showAdminLoginPopup(); + }, + ), + ], + ), + body: Column( + children: [ + Expanded( + child: RotatedBox( + quarterTurns: 1, + child: Image.asset( + !_showBackPattern + ? 'assets/images/pattern_vorne.png' + : 'assets/images/pattern_hinten.png', + fit: BoxFit.contain, + width: double.infinity, + height: double.infinity, + ), + ), + ), + BottomNavigationBar( + currentIndex: _showBackPattern ? 1 : 0, + onTap: _togglePattern, + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.front_hand), + label: 'Vorne', + ), + BottomNavigationBarItem( + icon: Icon(Icons.back_hand), + label: 'Hinten', + ), + ], + ), + ], ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index f75eca8..b54c6ca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -68,6 +68,8 @@ flutter: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg - assets/sounds/beep.mp3 + - assets/images/pattern_hinten.png + - assets/images/pattern_vorne.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/to/resolution-aware-images