Skip to content

Commit

Permalink
Update Versions, Add Splash Screen for Web, Cleanup (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkoerber authored Jan 3, 2024
1 parent 3e186d7 commit e673af5
Show file tree
Hide file tree
Showing 34 changed files with 105 additions and 21 deletions.
Binary file added assets/images/logos/tum-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ios/Runner/Assets.xcassets/AppIcon2.appiconset/20.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

4 changes: 2 additions & 2 deletions lib/navigaTumComponent/services/navigatum_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class NavigaTumService {
String id,
Ref ref,
) async {
final response = await getIt<RESTClient>()
.get<NavigaTumNavigationDetails, NavigaTumApi>(
final response =
await getIt<RESTClient>().get<NavigaTumNavigationDetails, NavigaTumApi>(
NavigaTumApi(
navigaTumApiService: NavigaTumApiServiceDetails(
id: id,
Expand Down
1 change: 1 addition & 0 deletions lib/navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class _NavigationState extends ConsumerState<Navigation> {
),
floatingActionButton: getIt<NavigationService>().floatingActionButton(
ref.watch(currentIndex),
ref,
context,
),
body: PageView(
Expand Down
26 changes: 17 additions & 9 deletions lib/navigation_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import 'package:campus_flutter/settingsComponent/views/settings_scaffold.dart';
import 'package:campus_flutter/base/extensions/context.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'base/enums/credentials.dart';
import 'loginComponent/viewModels/login_viewmodel.dart';

class NavigationService {
double? _navigationBarHeight;
Expand Down Expand Up @@ -75,18 +79,22 @@ class NavigationService {
}
}

Widget? floatingActionButton(int index, BuildContext context) {
Widget? floatingActionButton(int index, WidgetRef ref, BuildContext context) {
switch (index) {
case 3:
return FloatingActionButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const EventCreationScaffold(),
if (ref.read(loginViewModel).credentials.value == Credentials.tumId) {
return FloatingActionButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const EventCreationScaffold(),
),
),
),
child: const Icon(Icons.add),
);
child: const Icon(Icons.add),
);
} else {
return null;
}
default:
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: campus_flutter
description: A new Flutter project.
publish_to: 'none'
version: 4.4.1
version: 4.5.0

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
92 changes: 84 additions & 8 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<!DOCTYPE html><html><head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
Expand All @@ -23,11 +21,11 @@
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="campus_flutter">
<meta name="apple-mobile-web-app-title" content="TUM Campus App">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<link rel="icon" type="image/png" href="favicon.png">

<title>campus_flutter</title>
<link rel="manifest" href="manifest.json">
Expand All @@ -37,15 +35,92 @@
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
<script src="flutter.js" defer=""></script>

<!-- Needed for Google Maps Package -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAxUbnUMsXWVzeptXiLuNDMGpGEVFHLT4Y"></script>
<!--<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAxUbnUMsXWVzeptXiLuNDMGpGEVFHLT4Y&libraries=core,maps,places,geocoding,routes,marker,geometry,elevation,streetView,journeySharing,drawing,visualization">
</script>-->
<style id="splash-screen-style">
html {
height: 100%
}

body {
margin: 0;
min-height: 100%;
background-color: #0064BC;
background-size: 100% 100%;
}

.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}

.contain {
display:block;
width:100%; height:100%;
object-fit: contain;
}

.stretch {
display:block;
width:100%; height:100%;
}

.cover {
display:block;
width:100%; height:100%;
object-fit: cover;
}

.bottom {
position: absolute;
bottom: 0;
left: 50%;
-ms-transform: translate(-50%, 0);
transform: translate(-50%, 0);
}

.bottomLeft {
position: absolute;
bottom: 0;
left: 0;
}

.bottomRight {
position: absolute;
bottom: 0;
right: 0;
}

@media (prefers-color-scheme: dark) {
body {
background-color: #3070B3;
}
}
</style>
<script id="splash-screen-script">
function removeSplashFromWeb() {
document.getElementById("splash")?.remove();
document.getElementById("splash-branding")?.remove();
document.body.style.background = "transparent";
}
</script>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
</head>
<body>
<picture id="splash">
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x" media="(prefers-color-scheme: light)">
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x" media="(prefers-color-scheme: dark)">
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
</picture>
<script>
window.addEventListener('load', function (ev) {
// Download main.dart.js
Expand All @@ -61,5 +136,6 @@
});
});
</script>
</body>
</html>


</body></html>
Binary file added web/splash/img/dark-1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/splash/img/dark-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/splash/img/dark-3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/splash/img/dark-4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/splash/img/light-1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/splash/img/light-2x.png
Binary file added web/splash/img/light-3x.png
Binary file added web/splash/img/light-4x.png

0 comments on commit e673af5

Please sign in to comment.