From c2ad8e6ab9dc95364ec0460e983b2f2791ca660a Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Sat, 25 Feb 2023 13:20:35 +0300 Subject: [PATCH] fix: Nullable edu program type with many profiles (#294) --- lib/data/datasources/user_remote.dart | 3 +++ lib/domain/entities/edu_program.dart | 2 +- lib/presentation/pages/profile/profile_detail_page.dart | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/data/datasources/user_remote.dart b/lib/data/datasources/user_remote.dart index 73b4369b..386fa5ef 100644 --- a/lib/data/datasources/user_remote.dart +++ b/lib/data/datasources/user_remote.dart @@ -9,6 +9,7 @@ import 'package:rtu_mirea_app/data/models/employee_model.dart'; import 'package:rtu_mirea_app/data/models/nfc_pass_model.dart'; import 'package:rtu_mirea_app/data/models/score_model.dart'; import 'package:rtu_mirea_app/data/models/user_model.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; abstract class UserRemoteData { Future auth(); @@ -72,6 +73,8 @@ class UserRemoteDataImpl implements UserRemoteData { throw ServerException('Response status code is ${response.statusCode}'); } } catch (e) { + Sentry.captureException(e, stackTrace: StackTrace.current); + throw ServerException(e.toString()); } } diff --git a/lib/domain/entities/edu_program.dart b/lib/domain/entities/edu_program.dart index b558b73f..89f9abf1 100644 --- a/lib/domain/entities/edu_program.dart +++ b/lib/domain/entities/edu_program.dart @@ -5,7 +5,7 @@ class EduProgram extends Equatable { final String eduProgramCode; final String department; final String prodDepartment; - final String type; + final String? type; const EduProgram({ required this.eduProgram, diff --git a/lib/presentation/pages/profile/profile_detail_page.dart b/lib/presentation/pages/profile/profile_detail_page.dart index cf50f30f..6833a4ba 100644 --- a/lib/presentation/pages/profile/profile_detail_page.dart +++ b/lib/presentation/pages/profile/profile_detail_page.dart @@ -136,7 +136,7 @@ class ProfileDetailPage extends StatelessWidget { const SizedBox(height: 23), CopyTextBlockWithLabel( label: "Вид образовательной программы", - text: student.eduProgram.type), + text: student.eduProgram.type ?? ""), ], ), ),