From b0e1786e378b770dbb747a441f457b8b7ddab059 Mon Sep 17 00:00:00 2001 From: nishans9665 Date: Sun, 15 Mar 2026 11:38:09 +0530 Subject: [PATCH 1/2] add new student registration forms? --- task_manager_app/lib/home_page.dart | 17 +++ task_manager_app/lib/main.dart | 2 + .../lib/student_registration_screen.dart | 106 ++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 task_manager_app/lib/student_registration_screen.dart diff --git a/task_manager_app/lib/home_page.dart b/task_manager_app/lib/home_page.dart index c035ccf..6ef1418 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 'student_registration_screen.dart'; class HomePage extends StatelessWidget { const HomePage({super.key}); @@ -31,6 +32,22 @@ class HomePage extends StatelessWidget { color: Theme.of(context).colorScheme.onSurfaceVariant, ), ), + + const SizedBox(height: 30), + + // Student Registration Button + ElevatedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const StudentRegistrationScreen(), + ), + ); + }, + child: const Text('Student Registration'), + ), ], ), ), diff --git a/task_manager_app/lib/main.dart b/task_manager_app/lib/main.dart index f04d52a..1659163 100644 --- a/task_manager_app/lib/main.dart +++ b/task_manager_app/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'student_registration_screen.dart'; import 'home_page.dart'; void main() { @@ -17,6 +18,7 @@ class TaskManagerApp extends StatelessWidget { useMaterial3: true, ), home: const HomePage(), + // home: const StudentRegistrationScreen(), ); } } diff --git a/task_manager_app/lib/student_registration_screen.dart b/task_manager_app/lib/student_registration_screen.dart new file mode 100644 index 0000000..a87201f --- /dev/null +++ b/task_manager_app/lib/student_registration_screen.dart @@ -0,0 +1,106 @@ +import 'package:flutter/material.dart'; + +class StudentRegistrationScreen extends StatefulWidget { + const StudentRegistrationScreen({super.key}); + + @override + State createState() => + _StudentRegistrationScreenState(); +} + +class _StudentRegistrationScreenState + extends State { + + final _formKey = GlobalKey(); + + final nameController = TextEditingController(); + final idController = TextEditingController(); + final emailController = TextEditingController(); + final courseController = TextEditingController(); + + void submitForm() { + if (_formKey.currentState!.validate()) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text("Student Registered Successfully")), + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("Student Registration"), + ), + body: Padding( + padding: const EdgeInsets.all(20), + child: Form( + key: _formKey, + child: Column( + children: [ + + TextFormField( + controller: nameController, + decoration: const InputDecoration( + labelText: "Student Name", + ), + validator: (value) { + if (value == null || value.isEmpty) { + return "Enter student name"; + } + return null; + }, + ), + + TextFormField( + controller: idController, + decoration: const InputDecoration( + labelText: "Student ID", + ), + validator: (value) { + if (value == null || value.isEmpty) { + return "Enter student ID"; + } + return null; + }, + ), + + TextFormField( + controller: emailController, + decoration: const InputDecoration( + labelText: "Email", + ), + validator: (value) { + if (value == null || value.isEmpty) { + return "Enter email"; + } + return null; + }, + ), + + TextFormField( + controller: courseController, + decoration: const InputDecoration( + labelText: "Course", + ), + validator: (value) { + if (value == null || value.isEmpty) { + return "Enter course"; + } + return null; + }, + ), + + const SizedBox(height: 20), + + ElevatedButton( + onPressed: submitForm, + child: const Text("Submit"), + ), + ], + ), + ), + ), + ); + } +} \ No newline at end of file From 58a58fed2ca28449d1d4fc3e4fc91d69045f21e5 Mon Sep 17 00:00:00 2001 From: nishans9665 Date: Sun, 15 Mar 2026 11:44:07 +0530 Subject: [PATCH 2/2] title chnage --- 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 6ef1418..003a2d7 100644 --- a/task_manager_app/lib/home_page.dart +++ b/task_manager_app/lib/home_page.dart @@ -46,7 +46,7 @@ class HomePage extends StatelessWidget { ), ); }, - child: const Text('Student Registration'), + child: const Text('Student Registration form'), ), ], ),