Commit 33db20c3 authored by Uditha Prabhasha 's avatar Uditha Prabhasha

Update games.dart

parent 00d0c33c
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mobile_application_kids/addclassroom.dart';
import 'package:mobile_application_kids/chatScreen.dart';
import 'package:mobile_application_kids/teacherProfile.dart';
class GamesPage extends StatelessWidget { class GamesPage extends StatelessWidget {
final List<Map<String, String>> gameData = [
{'game': 'Game 1', 'description': 'Description for Game 1'},
{'game': 'Game 2', 'description': 'Description for Game 2'},
// add list
];
final String commonImagePath = 'assets/act_photo.png';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Games'), title: Text('Games'),
), ),
body: Center( body: Column(
child: Text( crossAxisAlignment: CrossAxisAlignment.start,
'Welcome to the Games Page!', children: [
style: TextStyle(fontSize: 20), Padding(
), padding: const EdgeInsets.all(16.0),
child: Text(
'My Games',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
child: ListView.builder(
itemCount: gameData.length,
itemBuilder: (context, index) {
var game = gameData[index];
return Card(
child: ListTile(
contentPadding: EdgeInsets.all(16),
leading: Container(
width: 50,
height: 50,
child: CircleAvatar(
backgroundImage: AssetImage(commonImagePath),
),
),
title: Text(
game['game'] ?? '',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
subtitle: Text(game['description'] ?? ''),
),
);
},
),
),
],
), ),
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
items: const [ items: const [
...@@ -39,26 +81,33 @@ class GamesPage extends StatelessWidget { ...@@ -39,26 +81,33 @@ class GamesPage extends StatelessWidget {
unselectedItemColor: Color(0xFFA9ABAD), unselectedItemColor: Color(0xFFA9ABAD),
selectedLabelStyle: TextStyle(color: Color(0xFF7A1FA0)), selectedLabelStyle: TextStyle(color: Color(0xFF7A1FA0)),
unselectedLabelStyle: TextStyle(color: Color.fromARGB(0, 197, 16, 16)), unselectedLabelStyle: TextStyle(color: Color.fromARGB(0, 197, 16, 16)),
currentIndex: 2, currentIndex: 2,
onTap: (index) { onTap: (index) {
switch (index) { switch (index) {
case 0: case 0:
// Navigate to Home // Navigate to Home
// Replace the code below with your home navigation logic
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => AddClassroom()),
// );
break; break;
case 1: case 1:
// Navigate to Chat // Navigate to Chat
Navigator.push( // Navigator.push(
context, // // context,
MaterialPageRoute(builder: (context) => ChatScreen()), // // MaterialPageRoute(builder: (context) => ChatScreen()),
); // );
break; break;
case 2: case 2:
// Already on Games Page // Already on Games Page
break; break;
case 3: case 3:
// Navigate to Profile // Navigate to Profile
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => TeacherProfile()),
// );
break; break;
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment