Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various User Interface Enhancements #304

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Please refer to the respective installation instructions:
|------------------------------------------|------------------------------------------|----------------------------------------------|
| `Flutter` (includes the `Dart` compiler) | SDK to develop this app | https://docs.flutter.dev/get-started/install |

### Updating the `.proto` files of the
### Updating the `.proto` files

To update the generated stubs for the Campus, you need protoc installed, then activte it in dart and then you can generate the new client

Expand All @@ -70,15 +70,16 @@ curl -o protos/tumdev/campus_backend.proto https://raw.githubusercontent.com/TUM
protoc --dart_out=grpc:lib/base/networking/apis -I./protos google/protobuf/timestamp.proto google/protobuf/empty.proto tumdev/campus_backend.proto
```

### Current needed Forks
### Currently needed Forks

To ensure that campus_flutter runs on every supported platform, we need to make some modifications to packages.

| Package | Reason | Link |
|-----------------|-------------------------------------|----------------------------------------------|
| gRPC | Caching | https://github.com/jakobkoerber/grpc-dart |
| Xml2Json | Fix Parsing of XML to JSON | https://github.com/jakobkoerber/xml2json |
| Package | Reason | Link |
|-----------------|-------------------------------------|-------------------------------------------------|
| gRPC | Caching | https://github.com/jakobkoerber/grpc-dart |
| Xml2Json | Fix Parsing of XML to JSON | https://github.com/jakobkoerber/xml2json |
| flutter_linkify | Fix Selection Menu and Text Scaling | https://github.com/jakobkoerber/flutter_linkify |
| home_widget | Fix App Crash | https://github.com/jakobkoerber/home_widget |



2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.7.3' apply false
id "com.android.application" version '8.8.0' apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "2.0.21" apply false
id "com.google.gms.google-services" version "4.4.2" apply false
Expand Down
1 change: 1 addition & 0 deletions assets/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"tokenPermissions": "Berechtigungen für Token",
"permissionChangePossibleInTUMonline": "Du kannst deine Berechtigungen in TUMOnline ändern",
"login": "Anmelden",
"logout": "Abmelden",
"notLoggedIn": "Nicht angemeldet!",
"profileError": "Profil konnte nicht geladen werden!",
"welcomeToTheApp": "Willkommen in der\n TUM Campus App",
Expand Down
1 change: 1 addition & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"tokenPermissions": "Token Permissions",
"permissionChangePossibleInTUMonline": "You can change your permissions on TUMOnline",
"login": "Login",
"logout": "Logout",
"notLoggedIn": "Not Logged In!",
"profileError": "Error fetching profile!",
"welcomeToTheApp": "Welcome to the TUM Campus App",
Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PODS:
- FirebaseSharedSwift (~> 11.0)
- GoogleUtilities/Environment (~> 8.0)
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- FirebaseRemoteConfigInterop (11.6.0)
- FirebaseRemoteConfigInterop (11.7.0)
- FirebaseSessions (11.6.0):
- FirebaseCore (~> 11.6.0)
- FirebaseCoreExtension (~> 11.6.0)
Expand All @@ -62,7 +62,7 @@ PODS:
- GoogleUtilities/UserDefaults (~> 8.0)
- nanopb (~> 3.30910.0)
- PromisesSwift (~> 2.1)
- FirebaseSharedSwift (11.6.0)
- FirebaseSharedSwift (11.7.0)
- Flutter (1.0.0)
- flutter_native_splash (2.4.3):
- Flutter
Expand Down Expand Up @@ -246,9 +246,9 @@ SPEC CHECKSUMS:
FirebaseCrashlytics: b21c665fb50138766480bce73ebdb1aa30f7f300
FirebaseInstallations: efc0946fc756e4d22d8113f7c761948120322e8c
FirebaseRemoteConfig: ee5161282c4e857ad81c0197cd8baec9d5dfef0e
FirebaseRemoteConfigInterop: e75e348953352a000331eb77caf01e424248e176
FirebaseRemoteConfigInterop: ca12abf9da0003efd3a476b2dff4f7a04fd31b4f
FirebaseSessions: 9529d14180868e29a8da164b3a729c036204918b
FirebaseSharedSwift: a4e5dfca3e210633bb3a3dfb94176c019211948b
FirebaseSharedSwift: a45efd84d60ebbfdcdbaebc66948af3630459e62
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_native_splash: 6cad9122ea0fad137d23137dd14b937f3e90b145
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
Expand Down
16 changes: 9 additions & 7 deletions lib/campusComponent/screen/campus_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ class CampusScreen extends StatelessWidget {
}

Widget body() {
return const SingleChildScrollView(
child: Column(
children: [
NewsWidgetView(),
StudentClubWidgetView(),
MovieWidgetView(),
],
return const Scrollbar(
child: SingleChildScrollView(
child: Column(
children: [
NewsWidgetView(),
StudentClubWidgetView(),
MovieWidgetView(),
],
),
),
);
}
Expand Down
12 changes: 7 additions & 5 deletions lib/campusComponent/screen/movie_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ class MovieScreen extends ConsumerWidget {
),
body: () {
if (snapshot.hasData) {
return MovieGridView(
movies: snapshot.data!,
padding: EdgeInsets.all(context.padding),
crossAxisCount: GridUtility.campusCrossAxisCount(context),
withinScrollView: false,
return Scrollbar(
child: MovieGridView(
movies: snapshot.data!,
padding: EdgeInsets.all(context.padding),
crossAxisCount: GridUtility.campusCrossAxisCount(context),
withinScrollView: false,
),
);
} else if (snapshot.hasError) {
return Center(
Expand Down
30 changes: 16 additions & 14 deletions lib/campusComponent/screen/news_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ class NewsScreen extends ConsumerWidget {
return TabBarView(
children: [
for (var collection in snapshot.data!.values)
GridView.count(
crossAxisCount: crossAxisCount(context),
mainAxisSpacing: context.padding,
crossAxisSpacing: context.padding,
padding: EdgeInsets.all(context.padding),
childAspectRatio: 1.1,
children: [
for (var news in collection)
LayoutBuilder(
builder: (context, constraints) => NewsCardView(
news: news,
width: constraints.maxWidth,
Scrollbar(
child: GridView.count(
crossAxisCount: crossAxisCount(context),
mainAxisSpacing: context.padding,
crossAxisSpacing: context.padding,
padding: EdgeInsets.all(context.padding),
childAspectRatio: 1.1,
children: [
for (var news in collection)
LayoutBuilder(
builder: (context, constraints) => NewsCardView(
news: news,
width: constraints.maxWidth,
),
),
),
],
],
),
),
],
);
Expand Down
12 changes: 7 additions & 5 deletions lib/campusComponent/screen/student_clubs_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ class StudentClubsScreen extends ConsumerWidget {
return TabBarView(
children: [
for (var collection in snapshot.data!)
StudentClubGridView(
studentClubs: collection.clubs,
padding: EdgeInsets.all(context.padding),
crossAxisCount: crossAxisCount(context),
withinScrollView: false,
Scrollbar(
child: StudentClubGridView(
studentClubs: collection.clubs,
padding: EdgeInsets.all(context.padding),
crossAxisCount: crossAxisCount(context),
withinScrollView: false,
),
),
],
);
Expand Down
3 changes: 2 additions & 1 deletion lib/campusComponent/view/news/news_card_view.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:campus_flutter/base/extensions/string_capitalize.dart';
import 'package:campus_flutter/base/util/string_parser.dart';
import 'package:campus_flutter/base/networking/apis/tumdev/campus_backend.pbgrpc.dart';
import 'package:campus_flutter/base/routing/routes.dart';
Expand Down Expand Up @@ -87,7 +88,7 @@ class NewsCardView extends ConsumerWidget {
Expanded(
flex: 3,
child: Text(
news.title,
news.title.capitalizeFirstLetter(),
style: Theme.of(context)
.textTheme
.titleMedium
Expand Down
5 changes: 5 additions & 0 deletions lib/campusComponent/viewmodel/news_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class NewsViewModel {
return NewsService.fetchRecentNews(forcedRefresh).then(
(value) {
lastFetched.add(value.$1);
value.$2.sort((news1, news2) {
final date1 = news1.date.toDateTime();
final date2 = news2.date.toDateTime();
return date2.compareTo(date1);
});
newsBySource.add(mapNewsBySource(value.$2));
news.add(value.$2);
},
Expand Down
7 changes: 6 additions & 1 deletion lib/settingsComponent/views/contact_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ class ContactView extends ConsumerWidget {
link: "https://app.tum.de",
label: "TUM-Dev Website",
),
const HyperLinkListTile(
dense: true,
link: "https://tum.sexy/",
label: "TUM.sexy",
),
HyperLinkListTile(
dense: true,
link: "https://www.tum.app/privacy",
link: "https://www.tum.dev/privacy",
label: context.tr("privacyPolicy"),
),
_licensesButton(context),
Expand Down
2 changes: 1 addition & 1 deletion lib/settingsComponent/views/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class SettingsView extends ConsumerWidget {
textAlign: TextAlign.center,
)
: Text(
context.tr("resetLogin"),
context.tr("logout"),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Colors.red,
fontWeight: FontWeight.w500,
Expand Down
Loading