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

Update games.dart

parent 00d0c33c
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 {
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
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Games'),
),
body: Center(
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Welcome to the Games Page!',
style: TextStyle(fontSize: 20),
'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(
items: const [
BottomNavigationBarItem(
......@@ -44,21 +86,28 @@ class GamesPage extends StatelessWidget {
switch (index) {
case 0:
// Navigate to Home
// Replace the code below with your home navigation logic
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => AddClassroom()),
// );
break;
case 1:
// Navigate to Chat
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChatScreen()),
);
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => ChatScreen()),
// );
break;
case 2:
// Already on Games Page
break;
case 3:
// Navigate to Profile
// Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => TeacherProfile()),
// );
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