Upgraded dependencies and SDK
This commit is contained in:
@ -22,9 +22,9 @@ class CacheableFile {
|
||||
CacheableFile({required this.path, required this.isDirectory, required this.name, this.mimeType, this.size, this.eTag, this.createdAt, this.modifiedAt});
|
||||
|
||||
CacheableFile.fromDavFile(WebDavFile file) {
|
||||
path = file.path;
|
||||
path = file.path.path;
|
||||
isDirectory = file.isDirectory;
|
||||
name = file.isDirectory ? file.name : file.path.split("/").last;
|
||||
name = file.isDirectory ? file.name : file.path.path.split("/").last;
|
||||
mimeType = file.mimeType;
|
||||
size = file.size;
|
||||
eTag = file.etag;
|
||||
|
@ -14,7 +14,7 @@ class ListFiles extends WebdavApi<ListFilesParams> {
|
||||
|
||||
@override
|
||||
Future<ListFilesResponse> run() async {
|
||||
List<WebDavFile> davFiles = (await (await WebdavApi.webdav).propfind(Uri.parse(params.path))).toWebDavFiles();
|
||||
List<WebDavFile> davFiles = (await (await WebdavApi.webdav).propfind(PathUri.parse(params.path))).toWebDavFiles();
|
||||
Set<CacheableFile> files = davFiles.map((e) => CacheableFile.fromDavFile(e)).toSet();
|
||||
|
||||
// webdav handles subdirectories wrong, this is a fix
|
||||
|
@ -113,7 +113,7 @@ class _MainState extends State<Main> {
|
||||
locale: const Locale('de'),
|
||||
|
||||
title: 'Marianum Fulda',
|
||||
|
||||
|
||||
themeMode: settings.val().appTheme,
|
||||
theme: LightAppTheme.theme,
|
||||
darkTheme: DarkAppTheme.theme,
|
||||
|
@ -1,6 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class NotificationService {
|
||||
static final NotificationService _instance = NotificationService._internal();
|
||||
@ -59,15 +57,4 @@ class NotificationService {
|
||||
platformChannelSpecifics,
|
||||
);
|
||||
}
|
||||
|
||||
void showToast({required String message, required BuildContext context, ToastGravity gravity = ToastGravity.TOP}) {
|
||||
Fluttertoast.showToast(
|
||||
msg: message,
|
||||
gravity: gravity,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
textColor: Colors.white,
|
||||
fontSize: 13.0,
|
||||
);
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ class DarkAppTheme {
|
||||
static const Color marianumRed = Color.fromARGB(255, 153, 51, 51);
|
||||
|
||||
static final theme = ThemeData(
|
||||
useMaterial3: false,
|
||||
brightness: Brightness.dark,
|
||||
primaryColor: marianumRed,
|
||||
hintColor: marianumRed,
|
||||
|
@ -4,6 +4,7 @@ class LightAppTheme {
|
||||
static const Color marianumRed = Color.fromARGB(255, 153, 51, 51);
|
||||
|
||||
static final theme = ThemeData(
|
||||
useMaterial3: false,
|
||||
brightness: Brightness.light,
|
||||
primaryColor: marianumRed,
|
||||
|
||||
|
@ -6,6 +6,7 @@ import 'package:flowder/flowder.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:nextcloud/nextcloud.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../../../api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart';
|
||||
@ -164,7 +165,7 @@ class _FileElementState extends State<FileElement> {
|
||||
content: "Das Element wird unwiederruflich gelöscht.",
|
||||
onConfirm: () {
|
||||
WebdavApi.webdav
|
||||
.then((value) => value.delete(Uri.parse(widget.file.path)))
|
||||
.then((value) => value.delete(PathUri.parse(widget.file.path)))
|
||||
.then((value) => widget.refetch());
|
||||
}
|
||||
));
|
||||
|
@ -43,7 +43,7 @@ class _FileUploadDialogState extends State<FileUploadDialog> {
|
||||
setState(() {
|
||||
state = FileUploadState.checkConflict;
|
||||
});
|
||||
List<WebDavResponse> result = (await webdavClient.propfind(Uri.parse(widget.remotePath.join("/")))).responses;
|
||||
List<WebDavResponse> result = (await webdavClient.propfind(PathUri.parse(widget.remotePath.join("/")))).responses;
|
||||
if(result.any((element) => element.href!.endsWith("/$targetFileName"))) {
|
||||
setState(() {
|
||||
state = FileUploadState.conflict;
|
||||
@ -56,7 +56,7 @@ class _FileUploadDialogState extends State<FileUploadDialog> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<HttpClientResponse> uploadTask = webdavClient.putFile(File(widget.localPath), FileStat.statSync(widget.localPath), Uri.parse(fullRemotePath)); // TODO use onProgress from putFile
|
||||
Future<HttpClientResponse> uploadTask = webdavClient.putFile(File(widget.localPath), FileStat.statSync(widget.localPath), PathUri.parse(fullRemotePath)); // TODO use onProgress from putFile
|
||||
uploadTask.then((value) => Future<HttpClientResponse?>.value(value)).catchError((e) {
|
||||
setState(() {
|
||||
state = FileUploadState.error;
|
||||
|
@ -3,6 +3,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:loader_overlay/loader_overlay.dart';
|
||||
import 'package:nextcloud/nextcloud.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart';
|
||||
@ -189,7 +190,7 @@ class _FilesState extends State<Files> {
|
||||
}, child: const Text("Abbrechen")),
|
||||
TextButton(onPressed: () {
|
||||
WebdavApi.webdav.then((webdav) {
|
||||
webdav.mkcol(Uri.parse("${widget.path.join("/")}/${inputController.text}")).then((value) => _query());
|
||||
webdav.mkcol(PathUri.parse("${widget.path.join("/")}/${inputController.text}")).then((value) => _query());
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
}, child: const Text("Ordner erstellen")),
|
||||
|
@ -2,6 +2,7 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:loader_overlay/loader_overlay.dart';
|
||||
import 'package:nextcloud/nextcloud.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
@ -42,7 +43,7 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
String filename = "${path.split("/").last.split(".").first}-${const Uuid().v4()}.${path.split(".").last}";
|
||||
String shareFolder = "MarianumMobile";
|
||||
WebdavApi.webdav.then((webdav) {
|
||||
webdav.mkcol(Uri.parse("/$shareFolder"));
|
||||
webdav.mkcol(PathUri.parse("/$shareFolder"));
|
||||
});
|
||||
|
||||
showDialog(context: context, builder: (context) => FileUploadDialog(
|
||||
|
Reference in New Issue
Block a user