Logging cleanup
This commit is contained in:
parent
9b5a4f7029
commit
cc43a9e081
@ -1,5 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:localstore/localstore.dart';
|
||||
import 'package:marianum_mobile/api/webuntis/webuntisError.dart';
|
||||
@ -38,7 +37,6 @@ abstract class RequestCache<T> {
|
||||
"lastupdate": DateTime.now().millisecondsSinceEpoch
|
||||
});
|
||||
} on WebuntisError catch(e) {
|
||||
log("ERROR CATCHED");
|
||||
onError(e);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:localstore/localstore.dart';
|
||||
@ -15,8 +14,6 @@ abstract class DataHolder extends ChangeNotifier {
|
||||
List<ApiResponse?> properties();
|
||||
|
||||
bool primaryLoading() {
|
||||
log(properties().toString());
|
||||
|
||||
for(ApiResponse? element in properties()) {
|
||||
if(element == null) return true;
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:marianum_mobile/api/apiResponse.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFilesCache.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFilesResponse.dart';
|
||||
@ -20,7 +18,6 @@ class FilesProps extends DataHolder {
|
||||
ListFilesResponse get listFilesResponse => _listFilesResponse!;
|
||||
|
||||
void runPath(List<String> path) {
|
||||
log(path.toString());
|
||||
folderPath = path;
|
||||
run();
|
||||
}
|
||||
@ -34,12 +31,10 @@ class FilesProps extends DataHolder {
|
||||
void run() {
|
||||
_listFilesResponse = null;
|
||||
notifyListeners();
|
||||
log("fetch data");
|
||||
ListFilesCache(
|
||||
path: folderPath.isEmpty ? "/" : folderPath.join("/"),
|
||||
onUpdate: (ListFilesResponse data) => {
|
||||
_listFilesResponse = data,
|
||||
log("got data"),
|
||||
notifyListeners(),
|
||||
}
|
||||
);
|
||||
|
@ -1,6 +1,4 @@
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:marianum_mobile/api/apiResponse.dart';
|
||||
import 'package:marianum_mobile/api/webuntis/queries/getHolidays/getHolidaysCache.dart';
|
||||
@ -63,7 +61,6 @@ class TimetableProps extends DataHolder {
|
||||
},
|
||||
onError: (Exception e) => {
|
||||
error = e as WebuntisError?,
|
||||
log("hello there"),
|
||||
notifyListeners(),
|
||||
}
|
||||
);
|
||||
@ -122,7 +119,6 @@ class TimetableProps extends DataHolder {
|
||||
} on WebuntisError catch(e) {
|
||||
error = e;
|
||||
notifyListeners();
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
@ -10,15 +10,13 @@ import 'package:jiffy/jiffy.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart';
|
||||
import 'package:marianum_mobile/screen/pages/files/files.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../api/marianumcloud/webdav/webdavApi.dart';
|
||||
import '../../../data/files/filesProps.dart';
|
||||
|
||||
class FileElement extends StatefulWidget {
|
||||
CacheableFile file;
|
||||
List<String> path;
|
||||
FileElement(this.file, this.path, {Key? key}) : super(key: key);
|
||||
final CacheableFile file;
|
||||
final List<String> path;
|
||||
const FileElement(this.file, this.path, {Key? key}) : super(key: key);
|
||||
|
||||
static void download(String remotePath, String name, Function(double) onProgress, Function(OpenResult) onDone) async {
|
||||
Directory paths = await getApplicationDocumentsDirectory();
|
||||
@ -42,8 +40,6 @@ class FileElement extends StatefulWidget {
|
||||
},
|
||||
);
|
||||
|
||||
log(local);
|
||||
|
||||
await Flowder.download(
|
||||
"${await WebdavApi.webdavConnectString}$remotePath",
|
||||
options,
|
||||
|
@ -1,6 +1,4 @@
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart';
|
||||
import 'package:marianum_mobile/widget/errorView.dart';
|
||||
@ -25,7 +23,6 @@ class _FilesState extends State<Files> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
log("Init files: ${widget.path.toString()}");
|
||||
|
||||
ListFilesCache(
|
||||
path: widget.path.isEmpty ? "/" : widget.path.join("/"),
|
||||
|
@ -1,6 +1,4 @@
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/data/timetable/timetableProps.dart';
|
||||
import 'package:marianum_mobile/screen/pages/timetable/weekView.dart';
|
||||
@ -44,11 +42,10 @@ class _TimetableState extends State<Timetable> {
|
||||
builder: (context, value, child) {
|
||||
|
||||
if(value.hasError) {
|
||||
return ErrorView(icon: Icons.error, text: value.error?.message ?? "Unbekannt?");
|
||||
return ErrorView(icon: Icons.error, text: value.error?.message ?? "Unbekannter Fehler");
|
||||
}
|
||||
|
||||
if(value.primaryLoading()) {
|
||||
log("LOADING");
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user