MIF_E31222389/lib/play_page.dart

157 lines
5.7 KiB
Dart

import 'package:flutter/material.dart';
import 'hindu_buddha_level_page.dart';
import 'islam_level_page.dart';
import 'utils/audio_manager.dart';
class PlayPage extends StatelessWidget {
final Function(String) onKingdomSelected;
const PlayPage({
required this.onKingdomSelected,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/background.jpg'),
fit: BoxFit.cover, // Menutupi seluruh layar
),
),
child: Stack(
children: [
// Tombol Setting dan Petunjuk
Positioned(
top: 10,
right: 10,
child: IconButton(
icon: Image.asset(
'assets/icons/exit.png',
width: 40,
height: 40,
),
onPressed: () {
AudioManager.playClickSound();
Navigator.pop(context);
},
),
),
// Konten Utama
Align(
alignment: const Alignment(0, -0.1),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 250,
height: 90,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/icons/title_bermain.png'),
fit: BoxFit.fill,
),
),
),
const SizedBox(height: 30),
Container(
width: 300,
height: 70,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/icons/button.png'),
fit: BoxFit.contain,
),
),
child: ElevatedButton(
onPressed: () {
AudioManager.playClickSound();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const HinduBuddhaLevelPage(),
),
);
},
style: ButtonStyle(
minimumSize:
MaterialStateProperty.all(const Size(0, 0)),
backgroundColor:
MaterialStateProperty.all(Colors.transparent),
elevation: MaterialStateProperty.all(0),
shape:
MaterialStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
)),
overlayColor:
MaterialStateProperty.all(Colors.transparent),
),
child: const Text(
'Hindu & Buddha',
style: TextStyle(
color: Color.fromARGB(255, 103, 75, 47),
fontFamily: 'Bestime',
fontSize: 12,
),
),
),
),
const SizedBox(height: 10),
Container(
width: 300,
height: 70,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/icons/button.png'),
fit: BoxFit.contain,
),
),
child: ElevatedButton(
onPressed: () {
AudioManager.playClickSound();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const IslamLevelPage(),
),
);
},
style: ButtonStyle(
minimumSize:
MaterialStateProperty.all(const Size(0, 0)),
backgroundColor:
MaterialStateProperty.all(Colors.transparent),
elevation: MaterialStateProperty.all(0),
shape:
MaterialStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
)),
overlayColor:
MaterialStateProperty.all(Colors.transparent),
),
child: const Text(
'Islam',
style: TextStyle(
color: Color.fromARGB(225, 103, 75, 47),
fontSize: 12,
fontFamily: 'Bestime',
),
),
),
),
],
),
),
),
],
),
),
);
}
}