feat: complete pattern page

This commit is contained in:
Yandrik 2024-08-17 14:45:09 +02:00
parent 7486be476a
commit 4638f9db90
4 changed files with 57 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

View File

@ -7,20 +7,68 @@ import 'package:lottis_birthday_escaperoom_app/screens/admin.dart';
import 'package:lottis_birthday_escaperoom_app/util.dart'; import 'package:lottis_birthday_escaperoom_app/util.dart';
import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:mobile_scanner/mobile_scanner.dart';
class PatternScreen extends StatelessWidget { class PatternScreen extends StatefulWidget {
const PatternScreen({Key? key}) : super(key: key); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
GameController c = Get.find();
return PopScope( return PopScope(
canPop: false, canPop: false,
child: Scaffold( child: Scaffold(
body: Image.asset( appBar: AppBar(
'assets/images/pattern.jpg', // Replace with your image path title: const Text('Lotti\'s Escape Room - Rätsel 1'),
fit: BoxFit.contain, actions: [
width: double.infinity, IconButton(
height: double.infinity, 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',
),
],
),
],
), ),
), ),
); );

View File

@ -68,6 +68,8 @@ flutter:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
- assets/sounds/beep.mp3 - 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 # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images # https://flutter.dev/to/resolution-aware-images