From 4ef01bf152ec44e0d0d997a8aee85b31186a5bd1 Mon Sep 17 00:00:00 2001 From: Theekshana Nuwan Date: Sun, 15 Mar 2026 09:45:28 +0530 Subject: [PATCH 1/2] Change subtitle (Group 2) --- task_manager_app/lib/home_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task_manager_app/lib/home_page.dart b/task_manager_app/lib/home_page.dart index ddbfd2a..3f54c4f 100644 --- a/task_manager_app/lib/home_page.dart +++ b/task_manager_app/lib/home_page.dart @@ -26,7 +26,7 @@ class HomePage extends StatelessWidget { ), const SizedBox(height: 8), Text( - 'Week 2 – Your first Flutter app', + 'Manage your tasks efficiently and stay organized.', style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of(context).colorScheme.onSurfaceVariant, ), From 0f1709a31f5425c49e8f6cd72d3ca7815e300600 Mon Sep 17 00:00:00 2001 From: Theekshana Nuwan Date: Sun, 15 Mar 2026 11:33:23 +0530 Subject: [PATCH 2/2] Add Student model and implement StudentListScreen with student data display --- task_manager_app/lib/home_page.dart | 13 ++++++ task_manager_app/lib/models/student.dart | 7 ++++ .../lib/screens/student_list_screen.dart | 41 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 task_manager_app/lib/models/student.dart create mode 100644 task_manager_app/lib/screens/student_list_screen.dart diff --git a/task_manager_app/lib/home_page.dart b/task_manager_app/lib/home_page.dart index 3f54c4f..55c106d 100644 --- a/task_manager_app/lib/home_page.dart +++ b/task_manager_app/lib/home_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'screens/student_list_screen.dart'; class HomePage extends StatelessWidget { const HomePage({super.key}); @@ -31,6 +32,18 @@ class HomePage extends StatelessWidget { color: Theme.of(context).colorScheme.onSurfaceVariant, ), ), + const SizedBox(height: 20), + ElevatedButton.icon( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const StudentListScreen(), + ), + ); + }, + icon: const Icon(Icons.person_search), + label: const Text('View Students'), + ), ], ), ), diff --git a/task_manager_app/lib/models/student.dart b/task_manager_app/lib/models/student.dart new file mode 100644 index 0000000..3cc324e --- /dev/null +++ b/task_manager_app/lib/models/student.dart @@ -0,0 +1,7 @@ +class Student { + final String name; + final String id; + final String course; + + const Student({required this.name, required this.id, required this.course}); +} diff --git a/task_manager_app/lib/screens/student_list_screen.dart b/task_manager_app/lib/screens/student_list_screen.dart new file mode 100644 index 0000000..94f61f4 --- /dev/null +++ b/task_manager_app/lib/screens/student_list_screen.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import '../models/student.dart'; + +class StudentListScreen extends StatelessWidget { + const StudentListScreen({super.key}); + + final List _students = const [ + Student(name: 'Alice Johnson', id: 'S001', course: 'Biology'), + Student(name: 'Bob Smith', id: 'S002', course: 'Mathematics'), + Student(name: 'Carol Lee', id: 'S003', course: 'Computer Science'), + Student(name: 'David Kim', id: 'S004', course: 'Chemistry'), + Student(name: 'Eva Martínez', id: 'S005', course: 'Physics'), + Student(name: 'Frank Miller', id: 'S006', course: 'History'), + Student(name: 'Grace Wilson', id: 'S007', course: 'Economics'), + Student(name: 'Henry Clark', id: 'S008', course: 'English Literature'), + Student(name: 'Isabella Davis', id: 'S009', course: 'Psychology'), + Student(name: 'Jack Thompson', id: 'S010', course: 'Engineering'), + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Students'), + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + ), + body: ListView.separated( + itemCount: _students.length, + separatorBuilder: (_, __) => const Divider(height: 1), + itemBuilder: (context, index) { + final s = _students[index]; + return ListTile( + title: Text(s.name), + subtitle: Text('ID: ${s.id} • Course: ${s.course}'), + leading: CircleAvatar(child: Text(s.name.substring(0, 1))), + ); + }, + ), + ); + } +}