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
dd0eb34d
Commit
dd0eb34d
authored
Feb 22, 2024
by
Uditha Prabhasha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update parentHome.dart
parent
45a7ed22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
31 deletions
+7
-31
lib/parentHome.dart
lib/parentHome.dart
+7
-31
No files found.
lib/parentHome.dart
View file @
dd0eb34d
import
'package:cloud_firestore/cloud_firestore.dart'
;
import
'package:firebase_auth/firebase_auth.dart'
;
import
'package:flutter/material.dart'
;
import
'package:mobile_application_kids/classroomview.dart'
;
import
'package:mobile_application_kids/addclassroom.dart'
;
import
'package:mobile_application_kids/childrenProfile.dart'
;
import
'package:mobile_application_kids/classroomview.dart'
;
import
'package:mobile_application_kids/teacherchat.dart'
;
import
'ChatScreen.dart'
;
import
'TeacherProfile.dart'
;
import
'childrenProfile.dart'
;
class
ParentHomePage
extends
StatelessWidget
{
late
User
?
user
;
late
final
Stream
<
QuerySnapshot
>
_usersStream
;
late
String
phoneNo
;
late
String
role
;
ParentHomePage
(
param0
,
role
)
{
this
.
role
=
role
;
this
.
phoneNo
=
param0
;
...
...
@@ -28,7 +29,6 @@ class ParentHomePage extends StatelessWidget {
.
snapshots
();
}
// Define a TextStyle with the Poppins font
final
TextStyle
poppinsTextStyle
=
TextStyle
(
fontFamily:
'Poppins'
,
);
...
...
@@ -37,24 +37,14 @@ class ParentHomePage extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
// Disable the back button press
return
false
;
},
child:
Scaffold
(
appBar:
AppBar
(
// leading: Flexible(
// child: Image.asset(
// 'lib/assets/logo.png',
// fit: BoxFit.contain,
// height: 150, // Adjust the height to make the logo bigger
// ),
// ),
actions:
[
IconButton
(
icon:
Icon
(
Icons
.
notifications
),
onPressed:
()
{
// Handle notification icon press
},
onPressed:
()
{},
),
],
),
...
...
@@ -67,7 +57,6 @@ class ParentHomePage extends StatelessWidget {
Text
(
'Explore, learn, and play in our magical world of wonder!'
,
style:
poppinsTextStyle
.
copyWith
(
// fontWeight: FontWeight.bold,
fontSize:
13
,
),
),
...
...
@@ -84,11 +73,9 @@ class ParentHomePage extends StatelessWidget {
children:
[
TextButton
(
onPressed:
()
{
// Navigate to the AddClassroomPage
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddClassroomPage
()),
MaterialPageRoute
(
builder:
(
context
)
=>
AddClassroomPage
()),
);
},
child:
Row
(
...
...
@@ -111,7 +98,6 @@ class ParentHomePage extends StatelessWidget {
child:
StreamBuilder
<
QuerySnapshot
>(
stream:
_usersStream
,
builder:
(
context
,
snapshot
)
{
print
(
"--------------------------------------"
);
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
return
CircularProgressIndicator
();
}
...
...
@@ -119,7 +105,6 @@ class ParentHomePage extends StatelessWidget {
if
(
snapshot
.
hasError
)
{
return
Text
(
'Error:
${snapshot.error}
'
);
}
var
itemcount
=
snapshot
.
data
!.
docs
.
length
;
return
ListView
.
builder
(
itemCount:
snapshot
.
data
!.
docs
.
length
,
...
...
@@ -127,16 +112,13 @@ class ParentHomePage extends StatelessWidget {
var
document
=
snapshot
.
data
!.
docs
[
index
];
var
className
=
document
[
'className'
];
var
name
=
document
[
'Firstname'
];
print
(
document
);
return
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
8.0
),
// Adjust the spacing as needed
padding:
const
EdgeInsets
.
only
(
bottom:
8.0
),
child:
ListTile
(
leading:
CircleAvatar
(
radius:
27.0
,
backgroundImage:
AssetImage
(
'lib/assets/classlogo.png'
),
backgroundImage:
AssetImage
(
'lib/assets/classlogo.png'
),
),
title:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -170,8 +152,6 @@ class ParentHomePage extends StatelessWidget {
),
child:
TextButton
(
onPressed:
()
{
print
(
document
);
// Handle view class button press
Navigator
.
push
(
context
,
MaterialPageRoute
(
...
...
@@ -209,7 +189,6 @@ class ParentHomePage extends StatelessWidget {
icon:
Icon
(
Icons
.
chat
),
label:
'Chat'
,
),
// New BottomNavigationBarItem for the game
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
games
),
label:
'Games'
,
...
...
@@ -221,12 +200,10 @@ class ParentHomePage extends StatelessWidget {
],
selectedItemColor:
Colors
.
blue
,
onTap:
(
index
)
{
// Handle bottom navigation item tap
switch
(
index
)
{
case
0
:
break
;
case
1
:
// Navigate to Chat
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ChatScreen
()),
...
...
@@ -236,7 +213,6 @@ class ParentHomePage extends StatelessWidget {
// Handle Game
break
;
case
3
:
// Navigate to Profile
Navigator
.
push
(
context
,
MaterialPageRoute
(
...
...
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