Skip to content

Commit

Permalink
Fix Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkoerber committed Feb 14, 2025
1 parent ede237d commit de85b1c
Show file tree
Hide file tree
Showing 210 changed files with 2,593 additions and 3,102 deletions.
100 changes: 20 additions & 80 deletions lib/base/enums/campus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,17 @@ extension CampusExtension on Campus {
LatLng get location {
switch (this) {
case Campus.stammgelaende:
return const LatLng(
48.14887567648079,
11.568029074814328,
);
return const LatLng(48.14887567648079, 11.568029074814328);
case Campus.olympiapark:
return const LatLng(
48.17957305879896,
11.546601863009668,
);
return const LatLng(48.17957305879896, 11.546601863009668);
case Campus.klinikumRechts:
return const LatLng(
48.13760759635786,
11.60083902677729,
);
return const LatLng(48.13760759635786, 11.60083902677729);
case Campus.grosshadern:
return const LatLng(
48.1116433849602,
11.47027262422505,
);
return const LatLng(48.1116433849602, 11.47027262422505);
case Campus.garching:
return const LatLng(
48.26513710129958,
11.671590834492283,
);
return const LatLng(48.26513710129958, 11.671590834492283);
case Campus.freising:
return const LatLng(
48.39549985559942,
11.727904526510946,
);
return const LatLng(48.39549985559942, 11.727904526510946);
}
}

Expand All @@ -104,55 +86,37 @@ extension CampusExtension on Campus {
return Station(
name: "Technische Universität",
apiName: "91000095",
location: const LatLng(
48.148145129847244,
11.566048520744298,
),
location: const LatLng(48.148145129847244, 11.566048520744298),
);
case Campus.olympiapark:
return Station(
name: "Olympiazentrum",
apiName: "91000350",
location: const LatLng(
48.17946648767361,
11.555783595899824,
),
location: const LatLng(48.17946648767361, 11.555783595899824),
);
case Campus.klinikumRechts:
return Station(
name: "Max-Weber-Platz",
apiName: "91000580",
location: const LatLng(
48.13573243097588,
11.599014647301777,
),
location: const LatLng(48.13573243097588, 11.599014647301777),
);
case Campus.grosshadern:
return Station(
name: "Klinikum Großhadern",
apiName: "91001540",
location: const LatLng(
48.10889880944028,
11.47363212095666,
),
location: const LatLng(48.10889880944028, 11.47363212095666),
);
case Campus.garching:
return Station(
name: "Forschungszentrum",
apiName: "1000460",
location: const LatLng(
48.26519145730091,
11.671545161597082,
),
location: const LatLng(48.26519145730091, 11.671545161597082),
);
case Campus.freising:
return Station(
name: "Freising, Weihenstephan",
apiName: "1002911",
location: const LatLng(
48.39799498961109,
11.723989661968458,
),
location: const LatLng(48.39799498961109, 11.723989661968458),
);
}
}
Expand All @@ -165,18 +129,12 @@ extension CampusExtension on Campus {
Station(
name: "Theresienstraße",
apiName: "91000120",
location: const LatLng(
48.1512235719802,
11.564211669898931,
),
location: const LatLng(48.1512235719802, 11.564211669898931),
),
Station(
name: "Pinakotheken",
apiName: "91000051",
location: const LatLng(
48.148780089472,
11.571870970398924,
),
location: const LatLng(48.148780089472, 11.571870970398924),
),
];
case Campus.olympiapark:
Expand All @@ -187,10 +145,7 @@ extension CampusExtension on Campus {
Station(
name: "Friedensengel/Villa Stuck",
apiName: "91000073",
location: const LatLng(
48.14074544433942,
11.600075277341709,
),
location: const LatLng(48.14074544433942, 11.600075277341709),
),
];
case Campus.grosshadern:
Expand All @@ -199,18 +154,12 @@ extension CampusExtension on Campus {
Station(
name: "Klinikum Großhadern Ost",
apiName: "91001472",
location: const LatLng(
48.11092668280441,
11.473909030506093,
),
location: const LatLng(48.11092668280441, 11.473909030506093),
),
Station(
name: "Klinikum Großhadern Nord",
apiName: "91001474",
location: const LatLng(
48.11250562334001,
11.467122898318992,
),
location: const LatLng(48.11250562334001, 11.467122898318992),
),
];
case Campus.garching:
Expand All @@ -219,10 +168,7 @@ extension CampusExtension on Campus {
Station(
name: "Lichtenbergstraße",
apiName: "1002070",
location: const LatLng(
48.26777168760462,
11.665502685140389,
),
location: const LatLng(48.26777168760462, 11.665502685140389),
),
];
case Campus.freising:
Expand All @@ -231,18 +177,12 @@ extension CampusExtension on Campus {
Station(
name: "Freising, Forstzentrum",
apiName: "1009413",
location: const LatLng(
48.39924842116169,
11.716601891310122,
),
location: const LatLng(48.39924842116169, 11.716601891310122),
),
Station(
name: "Freising, Weihenstephaner Berg",
apiName: "1002617",
location: const LatLng(
48.39581877364193,
11.725859432987532,
),
location: const LatLng(48.39581877364193, 11.725859432987532),
),
];
}
Expand Down
6 changes: 1 addition & 5 deletions lib/base/enums/credentials.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
enum Credentials {
none,
noTumId,
tumId;
}
enum Credentials { none, noTumId, tumId }
6 changes: 1 addition & 5 deletions lib/base/enums/device.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
enum Device {
phone,
portraitTablet,
landscapeTablet;
}
enum Device { phone, portraitTablet, landscapeTablet }
2 changes: 1 addition & 1 deletion lib/base/enums/error_handling_view_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ enum ErrorHandlingViewType {
fullScreenNoImage,
textOnly,
descriptionOnly,
redDescriptionOnly
redDescriptionOnly,
}
5 changes: 1 addition & 4 deletions lib/base/enums/home_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ class HomeScreenWidget {
WidgetType widgetType;
bool enabled;

HomeScreenWidget({
required this.widgetType,
this.enabled = true,
});
HomeScreenWidget({required this.widgetType, this.enabled = true});

String convertToString() {
return "${WidgetType.values.indexOf(widgetType)};${enabled.toString()}";
Expand Down
2 changes: 1 addition & 1 deletion lib/base/enums/search_category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum SearchCategory {
grade,
movie,
news,
studentClub;
studentClub,
}

extension SearchCategoryExtension on SearchCategory {
Expand Down
6 changes: 1 addition & 5 deletions lib/base/enums/search_type.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
enum SearchType {
general,
room,
person;
}
enum SearchType { general, room, person }
10 changes: 5 additions & 5 deletions lib/base/enums/shortcut_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ extension Routing on ShortcutItemType {

extension ActiveShortcuts on ShortcutItemType {
static List<ShortcutItemType> get items => [
ShortcutItemType.cafeterias,
ShortcutItemType.roomSearch,
ShortcutItemType.calendar,
ShortcutItemType.studies,
];
ShortcutItemType.cafeterias,
ShortcutItemType.roomSearch,
ShortcutItemType.calendar,
ShortcutItemType.studies,
];
}
7 changes: 1 addition & 6 deletions lib/base/enums/widget_type.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
enum WidgetType {
cafeterias,
calendar,
departures,
studyRooms;
}
enum WidgetType { cafeterias, calendar, departures, studyRooms }
18 changes: 5 additions & 13 deletions lib/base/errorHandling/error_handling_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class ErrorHandlingRouter extends ConsumerWidget {
case TumOnlineApiException tumOnlineApiException:
final isInvalidToken =
tumOnlineApiException.tumOnlineApiExceptionType !=
TumOnlineApiExceptionInvalidToken();
TumOnlineApiExceptionInvalidToken();
final isTokenNotConfirmed =
tumOnlineApiException.tumOnlineApiExceptionType !=
TumOnlineApiExceptionTokenNotConfirmed();
TumOnlineApiExceptionTokenNotConfirmed();
final isNotAuthorized =
ref.read(onboardingViewModel).credentials.value !=
Credentials.tumId;
Credentials.tumId;
if (isNotAuthorized && (isInvalidToken || isTokenNotConfirmed)) {
recordFlutterError(
FlutterErrorDetails(
Expand All @@ -75,11 +75,7 @@ class ErrorHandlingRouter extends ConsumerWidget {
bodyColor: bodyColor,
);
case SearchException searchException:
recordFlutterError(
FlutterErrorDetails(
exception: searchException,
),
);
recordFlutterError(FlutterErrorDetails(exception: searchException));
return SearchExceptionRouter(
searchException: searchException,
errorHandlingViewType: errorHandlingViewType,
Expand Down Expand Up @@ -111,11 +107,7 @@ class ErrorHandlingRouter extends ConsumerWidget {
);
default:
if (error != null) {
recordFlutterError(
FlutterErrorDetails(
exception: error!,
),
);
recordFlutterError(FlutterErrorDetails(exception: error!));
}
return DefaultErrorRouter(
exception: error,
Expand Down
27 changes: 13 additions & 14 deletions lib/base/errorHandling/error_handling_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,25 @@ mixin ErrorHandlingView {
child: _errorMessageText(
errorMessage,
context,
style: Theme.of(context)
.textTheme
.headlineMedium
?.copyWith(
color: titleColor ?? context.primaryColor,
),
style: Theme.of(
context,
).textTheme.headlineMedium?.copyWith(
color: titleColor ?? context.primaryColor,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
if (fixMessage != null)
Padding(
padding:
EdgeInsets.symmetric(horizontal: context.padding),
padding: EdgeInsets.symmetric(
horizontal: context.padding,
),
child: Text(
fixMessage,
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(color: bodyColor),
style: Theme.of(
context,
).textTheme.bodyLarge?.copyWith(color: bodyColor),
textAlign: TextAlign.center,
maxLines: 3,
overflow: TextOverflow.ellipsis,
Expand Down Expand Up @@ -91,8 +90,8 @@ mixin ErrorHandlingView {
errorMessage,
context,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: titleColor ?? context.primaryColor,
),
color: titleColor ?? context.primaryColor,
),
textAlign: TextAlign.center,
),
if (fixMessage != null)
Expand Down
6 changes: 4 additions & 2 deletions lib/base/extensions/string_levenshtein.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ extension Levenshtein on String {
List<String> a = split('');
List<String> b = comparisonToken.split('');

List<List<int>> dist =
List.generate(a.length + 1, (_) => List<int>.filled(b.length + 1, 0));
List<List<int>> dist = List.generate(
a.length + 1,
(_) => List<int>.filled(b.length + 1, 0),
);

for (int i = 1; i <= a.length; i++) {
dist[i][0] = i;
Expand Down
4 changes: 2 additions & 2 deletions lib/base/networking/apis/eatApi/eat_api_endpoint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class EatApiEndpointMenu extends EatApiEndpoint {
final String week;

EatApiEndpointMenu({required this.location, int? year, String? week})
: year = year ?? DateTime.now().year,
week = week ?? DateTime.now().weekNumber();
: year = year ?? DateTime.now().year,
week = week ?? DateTime.now().weekNumber();
}
2 changes: 0 additions & 2 deletions lib/base/networking/apis/google/protobuf/empty.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import 'package:protobuf/protobuf.dart' as $pb;
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
///
/// The JSON representation for `Empty` is empty JSON object `{}`.
class Empty extends $pb.GeneratedMessage {
factory Empty() => create();
Empty._() : super();
Expand Down
Loading

0 comments on commit de85b1c

Please sign in to comment.