MainScreen
import 'package:flutter/material.dart';
void main() {
runApp( SchoolDashboard());
}
class SchoolDashboard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('School Management Dashboard Ui'),
actions: [
IconButton(
icon: Icon(Icons.notifications),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.logout),
onPressed: () {},
),
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Welcome, Flutterfever.com',
style: Theme.of(context).textTheme.headline5,
),
),
Expanded(
child: GridView.count(
crossAxisCount: 3,
mainAxisSpacing: 16,
crossAxisSpacing: 16,
padding: EdgeInsets.all(16),
children: [
_buildCard(context, 'Students', Icons.people, onPressed: () {}),
_buildCard(context, 'Teachers', Icons.school, onPressed: () {}),
_buildCard(context, 'Courses', Icons.class_, onPressed: () {}),
_buildCard(context, 'Attendance', Icons.check_circle, onPressed: () {}),
_buildCard(context, 'Exams', Icons.assignment, onPressed: () {}),
_buildCard(context, 'Reports', Icons.bar_chart, onPressed: () {}),
],
),
),
],
),
),
);
}
Widget _buildCard(BuildContext context, String title, IconData icon, {VoidCallback? onPressed}) {
return InkWell(
onTap: onPressed,
child: Card(
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
size: 48,
color: Theme.of(context).primaryColor,
),
SizedBox(height: 16),
Text(
title,
style: Theme.of(context).textTheme.headline6,
),
],
),
),
);
}
}
Output:
Examscreen:
class Examscreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Exams'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Upcoming Exams',
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 8.0),
Container(
height: 120.0,
child: ListView.builder(
itemCount: 3,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext context, int index) {
return Container(
width: 220.0,
margin: EdgeInsets.only(right: 16.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
color: Colors.blue,
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'Mathematics Exam',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16.0,
),
),
Text(
'Date: 12 May 2022',
style: TextStyle(
color: Colors.white,
fontSize: 14.0,
),
),
Text(
'Time: 9:00 AM',
style: TextStyle(
color: Colors.white,
fontSize: 14.0,
),
),
],
),
),
);
},
),
),
SizedBox(height: 16.0),
Text(
'Recent Exams',
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 8.0),
Expanded(
child: ListView.builder(
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return Card(
elevation: 2.0,
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.blue,
child: Icon(Icons.book, color: Colors.white),
),
title: Text('Mathematics Exam'),
subtitle: Text('12 May 2022, 9:00 AM'),
trailing: Icon(Icons.arrow_forward_ios),
),
);
},
),
),
],
),
),
),
);
}
}
output:
Report Screen:
class ReportScreen extends StatelessWidget {
final List<Map<String, String>> reportData = [
{'subject': 'Math', 'grade': 'A', 'teacher': 'Ms. flutter', 'date': 'April 12, 2023'},
{'subject': 'Science', 'grade': 'B', 'teacher': 'Mr. fever', 'date': 'April 10, 2023'},
{'subject': 'History', 'grade': 'A', 'teacher': 'Ms. flutter', 'date': 'April 8, 2023'},
{'subject': 'English', 'grade': 'B', 'teacher': 'Mr. fever', 'date': 'April 5, 2023'},
{'subject': 'Art', 'grade': 'A+', 'teacher': 'Ms. fever', 'date': 'April 3, 2023'},
];
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Report'),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Report',
style: TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 16.0),
Expanded(
child: ListView.builder(
itemCount: reportData.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
reportData[index]['subject']!,
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 4.0),
Text(
'Grade: ${reportData[index]['grade']}',
style: TextStyle(
color: Colors.grey[600],
),
),
SizedBox(height: 4.0),
Text(
'Teacher: ${reportData[index]['teacher']}',
style: TextStyle(
color: Colors.grey[600],
),
),
],
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
'Date',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 4.0),
Text(
reportData[index]['date']!,
style: TextStyle(
color: Colors.grey[600],
),
),
],
),
),
Icon(
FeatherIcons.chevronRight,
color: Colors.grey[600],
),
],
),
);
},
),
),
],
),
),
),
);
}
}
output:
Attendance Screen:
class AttendanceScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Attendance'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Select Date',
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 8.0),
Row(
children: [
Expanded(
child: TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'From',
hintText: 'Select Date',
),
),
),
SizedBox(width: 8.0),
Expanded(
child: TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'To',
hintText: 'Select Date',
),
),
),
],
),
SizedBox(height: 16.0),
Text(
'Attendance List',
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 8.0),
Expanded(
child: ListView.builder(
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return Card(
elevation: 2.0,
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.orange,
child: Text(
'A',
style: TextStyle(color: Colors.white),
),
),
title: Text('John Doe'),
subtitle: Text('Class: 10th'),
trailing: Text('12/20'),
),
);
},
),
),
],
),
),
),
);
}
}
output: