Fixed webuntis bug, added share button
This commit is contained in:
@ -14,6 +14,7 @@ abstract class DataHolder extends ChangeNotifier {
|
||||
List<ApiResponse?> properties();
|
||||
|
||||
bool primaryLoading() {
|
||||
// log("${toString()} ${properties().map((e) => e != null ? "1" : "0").join(", ")}");
|
||||
for(ApiResponse? element in properties()) {
|
||||
if(element == null) return true;
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../api/apiResponse.dart';
|
||||
import '../../api/webuntis/queries/getHolidays/getHolidaysCache.dart';
|
||||
import '../../api/webuntis/queries/getHolidays/getHolidaysResponse.dart';
|
||||
import '../../api/webuntis/queries/getRooms/getRoomsCache.dart';
|
||||
import '../../api/webuntis/queries/getRooms/getRoomsResponse.dart';
|
||||
@ -78,12 +79,16 @@ class TimetableProps extends DataHolder {
|
||||
}
|
||||
);
|
||||
|
||||
GetHolidaysCache(
|
||||
onUpdate: (GetHolidaysResponse data) => {
|
||||
_getHolidaysResponse = data,
|
||||
notifyListeners(),
|
||||
}
|
||||
);
|
||||
// GetHolidaysCache( // TODO is this fixed by webuntis? miese kriese
|
||||
// onUpdate: (GetHolidaysResponse data) => {
|
||||
// _getHolidaysResponse = data,
|
||||
// notifyListeners(),
|
||||
// }
|
||||
// );
|
||||
_getHolidaysResponse = GetHolidaysResponse.fromJson(jsonDecode("""
|
||||
{"jsonrpc":"2.0","id":"ID","result":[]}
|
||||
"""));
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
DateTime getDate(DateTime d) => DateTime(d.year, d.month, d.day);
|
||||
|
@ -8,6 +8,7 @@ import 'package:fast_rsa/fast_rsa.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../../../model/endpointData.dart';
|
||||
import '../../../widget/ListItem.dart';
|
||||
@ -23,6 +24,7 @@ class Overhang extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Mehr"),
|
||||
@ -36,6 +38,19 @@ class Overhang extends StatelessWidget {
|
||||
const ListItemNavigator(icon: Icons.room, text: "Raumplan", target: Roomplan()),
|
||||
const ListItemNavigator(icon: Icons.calculate, text: "Notendurschnittsrechner", target: GradeAverage()),
|
||||
const ListItemNavigator(icon: Icons.calendar_month, text: "Schulferien", target: Holidays()),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.share_outlined),
|
||||
title: const Text("Teile die App mit deiner Klasse"),
|
||||
onTap: () {
|
||||
Share.share( // TODO ipad needs position argument
|
||||
subject: "App Teilen",
|
||||
"Hol dir die inoffizielle App für's Marianum:"
|
||||
"\n\nAndroid: https://play.google.com/store/apps/details?id=eu.mhsl.marianum.mobile.client "
|
||||
"\nApple: https://apps.apple.com/us/app/marianum-fulda/id6458789560 "
|
||||
"\n\nViel Spaß!"
|
||||
);
|
||||
},
|
||||
),
|
||||
DebugTile(context, onlyInDebug: true).callback(onTab: () async {
|
||||
log("Starting");
|
||||
log("Generate keys");
|
||||
|
@ -16,7 +16,7 @@ class _LoadingSpinnerState extends State<LoadingSpinner> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
timer = Timer(const Duration(seconds: 15), () {
|
||||
timer = Timer(const Duration(seconds: 30), () {
|
||||
setState(() {
|
||||
textVisible = true;
|
||||
});
|
||||
@ -33,13 +33,16 @@ class _LoadingSpinnerState extends State<LoadingSpinner> {
|
||||
children: [
|
||||
Visibility(
|
||||
visible: !textVisible,
|
||||
replacement: const Icon(Icons.signal_wifi_connected_no_internet_4_outlined),
|
||||
replacement: const Icon(Icons.sentiment_dissatisfied_outlined),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Visibility(
|
||||
visible: textVisible,
|
||||
child: const Text("Etwas scheint nicht zu funktionieren!\nBist du mit dem Internet verbunden?\n\nVersuche die App neuzustarten"),
|
||||
child: const Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Irgendetwas funktioniert nicht!\nBist du mit dem Internet verbunden?\n\nVersuche die App neuzustarten"
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user