From 4c8e61279d8fbd0022e06397a2ffb6eb881bc877 Mon Sep 17 00:00:00 2001 From: JosephValle Date: Fri, 16 Feb 2024 15:01:24 -0500 Subject: [PATCH] Delete Schools Done --- lib/logical_interface/bloc/students/students_bloc.dart | 2 +- .../bloc/students/students_state.dart | 4 +--- .../student_creation/student_creation_page.dart | 10 ++-------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/logical_interface/bloc/students/students_bloc.dart b/lib/logical_interface/bloc/students/students_bloc.dart index c7c38be..d7161d1 100644 --- a/lib/logical_interface/bloc/students/students_bloc.dart +++ b/lib/logical_interface/bloc/students/students_bloc.dart @@ -137,7 +137,7 @@ class StudentsBloc extends Bloc { .compareTo(('${b.lastName}, ${b.firstName}')), ); - emit(StudentCreated(student: student, students: students)); + emit(StudentCreated( students: students)); } void _clearAllStudents(ClearAllStudents event, emit) async { diff --git a/lib/logical_interface/bloc/students/students_state.dart b/lib/logical_interface/bloc/students/students_state.dart index 8ffb83c..3d98b7d 100644 --- a/lib/logical_interface/bloc/students/students_state.dart +++ b/lib/logical_interface/bloc/students/students_state.dart @@ -16,9 +16,7 @@ class StudentsLoaded extends StudentsState { } class StudentCreated extends StudentsState { - final Student student; - - const StudentCreated({required this.student, required super.students}); + const StudentCreated({required super.students}); } class UploadFinished extends StudentsState { diff --git a/lib/user_interface/student_creation/student_creation_page.dart b/lib/user_interface/student_creation/student_creation_page.dart index fff0fa7..dd0b38a 100644 --- a/lib/user_interface/student_creation/student_creation_page.dart +++ b/lib/user_interface/student_creation/student_creation_page.dart @@ -67,12 +67,6 @@ class _StudentCreationPageState extends State { return BlocListener( listener: (context, state) { if (state is StudentCreated) { - context.read().add( - AddStudent( - student: state.student, - schoolId: state.student.schoolId, - ), - ); Navigator.of(context).pop(); } }, @@ -182,11 +176,11 @@ class _StudentCreationPageState extends State { priority: priority, firstName: _firstNameController.text.trim(), lastName: _lastNameController.text.trim(), - schoolName: school.shortName, + schoolName: widget.student!.school, grade: int.tryParse(_gradeController.text.trim()) ?? -1, - schoolId: school.id, + schoolId: widget.student!.schoolId, ), ); },