Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Monitoring and Recommendations For Early Childhood Development
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sandunika Senavirathna
Monitoring and Recommendations For Early Childhood Development
Commits
33db20c3
Commit
33db20c3
authored
Feb 25, 2024
by
Uditha Prabhasha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update games.dart
parent
00d0c33c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
15 deletions
+64
-15
lib/games.dart
lib/games.dart
+64
-15
No files found.
lib/games.dart
View file @
33db20c3
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
(
child:
Text
(
'Welcome to the Games Page!'
,
style:
TextStyle
(
fontSize:
20
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
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
(
items:
const
[
...
...
@@ -39,26 +81,33 @@ class GamesPage extends StatelessWidget {
unselectedItemColor:
Color
(
0xFFA9ABAD
),
selectedLabelStyle:
TextStyle
(
color:
Color
(
0xFF7A1FA0
)),
unselectedLabelStyle:
TextStyle
(
color:
Color
.
fromARGB
(
0
,
197
,
16
,
16
)),
currentIndex:
2
,
currentIndex:
2
,
onTap:
(
index
)
{
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
;
}
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment