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