Skip to content

Commit

Permalink
Delete Schools Done
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephValle committed Feb 16, 2024
1 parent d694d11 commit 4c8e612
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/logical_interface/bloc/students/students_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class StudentsBloc extends Bloc<StudentsEvent, StudentsState> {
.compareTo(('${b.lastName}, ${b.firstName}')),
);

emit(StudentCreated(student: student, students: students));
emit(StudentCreated( students: students));
}

void _clearAllStudents(ClearAllStudents event, emit) async {
Expand Down
4 changes: 1 addition & 3 deletions lib/logical_interface/bloc/students/students_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 2 additions & 8 deletions lib/user_interface/student_creation/student_creation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ class _StudentCreationPageState extends State<StudentCreationPage> {
return BlocListener<StudentsBloc, StudentsState>(
listener: (context, state) {
if (state is StudentCreated) {
context.read<SchoolDetailBloc>().add(
AddStudent(
student: state.student,
schoolId: state.student.schoolId,
),
);
Navigator.of(context).pop();
}
},
Expand Down Expand Up @@ -182,11 +176,11 @@ class _StudentCreationPageState extends State<StudentCreationPage> {
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,
),
);
},
Expand Down

0 comments on commit 4c8e612

Please sign in to comment.