lottis_birthday_escaperoom_app/lib/screens/pattern.dart

77 lines
2.2 KiB
Dart

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';
class PatternScreen extends StatefulWidget {
const PatternScreen({Key? key}) : super(key: key);
@override
_PatternScreenState createState() => _PatternScreenState();
}
class _PatternScreenState extends State<PatternScreen> {
bool _showBackPattern = false;
void _togglePattern(int index) {
setState(() {
_showBackPattern = index == 1;
});
}
@override
Widget build(BuildContext context) {
return PopScope(
canPop: false,
child: Scaffold(
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',
),
],
),
],
),
),
);
}
}