Skip to content

Commit 1cd12fa

Browse files
committed
Add Connection Handling, Improve Code
1 parent 6d230e1 commit 1cd12fa

File tree

45 files changed

+172
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+172
-440
lines changed

ios/Podfile.lock

Lines changed: 0 additions & 240 deletions
This file was deleted.

lib/base/classes/campus_exception.dart

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/base/errorHandling/custom_exception_router.dart renamed to lib/base/errorHandling/campus_exception_router.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import 'package:campus_flutter/base/errorHandling/error_handling_view.dart';
33
import 'package:campus_flutter/base/extensions/custom_exception.dart';
44
import 'package:flutter/material.dart';
55

6-
class CustomExceptionRouter extends StatelessWidget with ErrorHandlingView {
7-
CustomExceptionRouter({
6+
class CampusExceptionRouter extends StatelessWidget with ErrorHandlingView {
7+
CampusExceptionRouter({
88
super.key,
9-
required this.customException,
9+
required this.campusException,
1010
required ErrorHandlingViewType errorHandlingViewType,
1111
Future<dynamic> Function(bool)? retry,
1212
Color? titleColor,
@@ -18,10 +18,10 @@ class CustomExceptionRouter extends StatelessWidget with ErrorHandlingView {
1818
this.bodyColor = bodyColor;
1919
}
2020

21-
final CustomException customException;
21+
final CampusException campusException;
2222

2323
@override
2424
Widget build(BuildContext context) {
25-
return exceptionMessage(context, customException.message, null);
25+
return exceptionMessage(context, campusException.message, null);
2626
}
2727
}

lib/base/errorHandling/error_handling_router.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:campus_flutter/base/enums/error_handling_view_type.dart';
2-
import 'package:campus_flutter/base/errorHandling/custom_exception_router.dart';
2+
import 'package:campus_flutter/base/errorHandling/campus_exception_router.dart';
33
import 'package:campus_flutter/base/errorHandling/default_error_router.dart';
44
import 'package:campus_flutter/base/errorHandling/dio_exception_router.dart';
55
import 'package:campus_flutter/base/errorHandling/search_exception_router.dart';
@@ -50,7 +50,7 @@ class ErrorHandlingRouter extends ConsumerWidget {
5050
case TumOnlineApiException tumOnlineApiException:
5151
if (ref.read(loginViewModel).credentials.value != Credentials.tumId &&
5252
tumOnlineApiException.tumOnlineApiExceptionType ==
53-
TumOnlineApiExceptionInvalidToken) {
53+
TumOnlineApiExceptionInvalidToken()) {
5454
FirebaseCrashlytics.instance.recordFlutterFatalError(
5555
FlutterErrorDetails(
5656
exception: tumOnlineApiException,
@@ -78,14 +78,14 @@ class ErrorHandlingRouter extends ConsumerWidget {
7878
titleColor: titleColor,
7979
bodyColor: bodyColor,
8080
);
81-
case CustomException customException:
81+
case CampusException campusException:
8282
FirebaseCrashlytics.instance.recordFlutterFatalError(
8383
FlutterErrorDetails(
84-
exception: customException,
84+
exception: campusException,
8585
),
8686
);
87-
return CustomExceptionRouter(
88-
customException: customException,
87+
return CampusExceptionRouter(
88+
campusException: campusException,
8989
errorHandlingViewType: errorHandlingViewType,
9090
retry: retry,
9191
titleColor: titleColor,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class CustomException implements Exception {
1+
class CampusException implements Exception {
22
final String message;
33

4-
CustomException(this.message);
4+
CampusException(this.message);
55
}

lib/base/networking/apis/tumOnlineApi/tum_online_api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TumOnlineApi extends Api {
3030
case TumOnlineServicePersonalLectures _:
3131
return "${path}wbservicesbasic.veranstaltungenEigene";
3232
case TumOnlineServicePersonalGrades _:
33-
return "${path}wbservicesbasic.notena";
33+
return "${path}wbservicesbasic.noten";
3434
case TumOnlineServiceLectureSearch _:
3535
return "${path}wbservicesbasic.veranstaltungenSuche";
3636
case TumOnlineServiceLectureDetails _:

0 commit comments

Comments
 (0)