diff --git a/lib/presentation/core/routes/routes.dart b/lib/presentation/core/routes/routes.dart index 6a29934c..e89f6719 100644 --- a/lib/presentation/core/routes/routes.dart +++ b/lib/presentation/core/routes/routes.dart @@ -87,9 +87,16 @@ GoRouter createRouter() => GoRouter( GoRoute( path: 'details', builder: (context, state) { - return ScheduleDetailsPage( - lesson: state.extra as LessonSchedulePart, - ); + try { + final json = state.extra as Map; + return ScheduleDetailsPage( + lesson: LessonSchedulePart.fromJson(json), + ); + } catch (e) { + return ScheduleDetailsPage( + lesson: state.extra as LessonSchedulePart, + ); + } }, ), ],