Implemented basic Fileviewing
This commit is contained in:
@ -1,43 +1,23 @@
|
||||
// import 'dart:developer';
|
||||
//
|
||||
// import 'package:marianum_mobile/api/apiParams.dart';
|
||||
// import 'package:marianum_mobile/api/apiRequest.dart';
|
||||
// import 'package:marianum_mobile/api/webuntis/queries/authenticate/authenticate.dart';
|
||||
// import 'package:shared_preferences/shared_preferences.dart';
|
||||
// import 'package:webdav_client/webdav_client.dart';
|
||||
//
|
||||
// import '../../apiResponse.dart';
|
||||
//
|
||||
// abstract class WebdavApi<T> extends ApiRequest {
|
||||
// T genericParams;
|
||||
//
|
||||
// WebdavApi(this.genericParams) {
|
||||
// establishWebdavConnection();
|
||||
// }
|
||||
//
|
||||
// Future<ApiResponse> run();
|
||||
//
|
||||
// static Future<Client> webdav = establishWebdavConnection();
|
||||
//
|
||||
// static Future<Client> establishWebdavConnection() async {
|
||||
// SharedPreferences preferences = await SharedPreferences.getInstance();
|
||||
//
|
||||
// // Client client = newClient(
|
||||
// // "https://cloud.marianum-fulda.de/remote.php/dav/files/***REMOVED***/",
|
||||
// // user: "***REMOVED***",
|
||||
// // password: "***REMOVED***",
|
||||
// // debug: true
|
||||
// // );
|
||||
// //
|
||||
// // client.setHeaders(
|
||||
// // {
|
||||
// // "Authorization": "Bearer",
|
||||
// // "User-Agent": "Marianum Fulda/Alpha0.1 (Development build) ; https://mhsl.eu/id.html",
|
||||
// // }
|
||||
// // );
|
||||
//
|
||||
// throw UnimplementedError();
|
||||
// //return client;
|
||||
//
|
||||
// }
|
||||
// }
|
||||
import 'package:marianum_mobile/api/apiRequest.dart';
|
||||
import 'package:nextcloud/nextcloud.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../apiResponse.dart';
|
||||
|
||||
abstract class WebdavApi<T> extends ApiRequest {
|
||||
T genericParams;
|
||||
|
||||
WebdavApi(this.genericParams) {
|
||||
establishWebdavConnection();
|
||||
}
|
||||
|
||||
Future<ApiResponse> run();
|
||||
|
||||
static Future<WebDavClient> webdav = establishWebdavConnection();
|
||||
|
||||
static Future<WebDavClient> establishWebdavConnection() async {
|
||||
SharedPreferences preferences = await SharedPreferences.getInstance();
|
||||
|
||||
return NextcloudClient("https://cloud.marianum-fulda.de/", username: preferences.getString("username"), password: preferences.getString("password"), loginName: preferences.getString("username")).webdav;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user