Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions lib/screens/GroupPage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import 'package:flutter/material.dart';

class GroupPage extends StatefulWidget {
const GroupPage({super.key});

@override
State<GroupPage> createState() => _GroupPageState();
}

class _GroupPageState extends State<GroupPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('INFO BVCA', style: TextStyle(color: Colors.white)),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Colors.white),
onPressed: () {
// Handle back button press
},
),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
leading: Icon(Icons.announcement, color: Colors.teal),
title:
Text('Announcements', style: TextStyle(color: Colors.white)),
subtitle: Text('Mona: Submit your assignment',
style: TextStyle(color: Colors.grey)),
trailing: Text('11:29 AM', style: TextStyle(color: Colors.grey)),
onTap: () {
// Handle Announcements tap
},
),
Divider(color: Colors.grey),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text('Groups you\'re in',
style: TextStyle(color: Colors.white, fontSize: 16)),
),
ListTile(
leading: CircleAvatar(
backgroundColor: Colors.red,
child: Icon(Icons.group, color: Colors.white),
),
title: Text('B.Voc C.A (UNITED 🧑‍💻🏴‍☠️)',
style: TextStyle(color: Colors.white)),
subtitle: Text('CR: All classes are cancel',
style: TextStyle(color: Colors.grey)),
trailing: Text('4:05 PM', style: TextStyle(color: Colors.grey)),
onTap: () {
// Handle Group tap
},
),
Divider(color: Colors.grey),
Spacer(),
Center(
child: Text(
'Other groups added to the community will appear here.\nCommunity members can join these groups.',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey)),
),
Spacer(),
Padding(
padding: const EdgeInsets.only(bottom: 16.0),
child: Center(
child: ElevatedButton(
onPressed: () {
// Handle Add group button press
},
child: Text('Add group'),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.teal,
),
),
),
),
],
),
),
);
}
}
77 changes: 47 additions & 30 deletions lib/screens/HomePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import 'package:flutter/material.dart';
import 'package:test_app/screens/ChatPage.dart';
import 'package:test_app/screens/GroupPage.dart';

class HomePage extends StatefulWidget {
const HomePage({super.key});
Expand Down Expand Up @@ -119,42 +120,58 @@ class _HomePageState extends State<HomePage> {
],
),
),
body: ListView.builder(
itemCount: chats.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(chats[index]["name"]),
subtitle: chats[index]["sent"]
? Row(
children: [
const Icon(Icons.done_all),
Text(
body: Column(
children: [
ListView.builder(
itemCount: chats.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(chats[index]["name"]),
subtitle: chats[index]["sent"]
? Row(
children: [
const Icon(Icons.done_all),
Text(
chats[index]["Message"],
style: const TextStyle(
overflow: TextOverflow.ellipsis),
),
],
)
: Text(
chats[index]["Message"],
style: const TextStyle(
overflow: TextOverflow.ellipsis),
),
],
)
: Text(
chats[index]["Message"],
style: const TextStyle(overflow: TextOverflow.ellipsis),
),
leading: ClipRRect(
borderRadius: BorderRadius.circular(40),
child: index % 2 == 0
? Image.asset("assets/srk.png")
: Image.asset("assets/srk1.png"),
),
trailing: Text(chats[index]["time"]),
leading: ClipRRect(
borderRadius: BorderRadius.circular(40),
child: index % 2 == 0
? Image.asset("assets/srk.png")
: Image.asset("assets/srk1.png"),
),
trailing: Text(chats[index]["time"]),
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) {
return ChatPage(
name: chats[index]["name"],
image: index % 2 == 0
? "assets/srk.png"
: "assets/srk1.png",
);
})),
);
}),
Row(children: [
ListTile(
title: Text("Info BVCA"),
trailing: Icon(Icons.chevron_right),
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) {
return ChatPage(
name: chats[index]["name"],
image:
index % 2 == 0 ? "assets/srk.png" : "assets/srk1.png",
);
return GroupPage();
})),
);
}));
),
])
],
));
}
}