2024-08-17 03:19:32 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:lottis_birthday_escaperoom_app/controller/gamecontroller.dart';
|
|
|
|
import 'package:lottis_birthday_escaperoom_app/scanned_barcode_label.dart';
|
|
|
|
import 'package:lottis_birthday_escaperoom_app/scanner_error_widget.dart';
|
|
|
|
import 'package:lottis_birthday_escaperoom_app/screens/admin.dart';
|
|
|
|
import 'package:lottis_birthday_escaperoom_app/util.dart';
|
|
|
|
import 'package:mobile_scanner/mobile_scanner.dart';
|
|
|
|
|
2024-08-17 12:45:09 +00:00
|
|
|
class PatternScreen extends StatefulWidget {
|
2024-08-17 03:19:32 +00:00
|
|
|
const PatternScreen({Key? key}) : super(key: key);
|
|
|
|
|
2024-08-17 12:45:09 +00:00
|
|
|
@override
|
|
|
|
_PatternScreenState createState() => _PatternScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _PatternScreenState extends State<PatternScreen> {
|
|
|
|
bool _showBackPattern = false;
|
|
|
|
|
|
|
|
void _togglePattern(int index) {
|
|
|
|
setState(() {
|
|
|
|
_showBackPattern = index == 1;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-17 03:19:32 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return PopScope(
|
|
|
|
canPop: false,
|
|
|
|
child: Scaffold(
|
2024-08-17 12:45:09 +00:00
|
|
|
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',
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
2024-08-17 03:19:32 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|