Upgraded dependencies and SDK

This commit is contained in:
Elias Müller 2024-01-07 20:21:55 +01:00
parent 8e778e8cc3
commit dce569cb99
11 changed files with 23 additions and 32 deletions

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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,
);
}
}

View File

@ -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,

View File

@ -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,

View File

@ -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());
}
));

View File

@ -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;

View File

@ -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")),

View File

@ -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(

View File

@ -43,7 +43,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
flutter_native_splash: ^2.2.14
flutter_login: ^4.1.0
flutter_login: ^5.0.0
bubble: ^1.2.1
http: ^1.1.0
shared_preferences: ^2.0.15
@ -56,7 +56,7 @@ dependencies:
git:
url: https://github.com/provokateurin/nextcloud-neon
path: packages/nextcloud
ref: 8ed58773dfe7b7c4106b38457561014dbebf580a
ref: 3683491a94670393e46cbc83ad85b994f7df7481
flutter_launcher_icons: ^0.13.1
pretty_json: ^2.0.0
cached_network_image: ^3.2.3
@ -71,21 +71,20 @@ dependencies:
persistent_bottom_nav_bar: ^5.0.2
badges: ^3.0.2
image_picker: ^1.0.0
file_picker: ^5.2.11
loader_overlay: ^2.2.0
file_picker: ^6.1.1
loader_overlay: ^4.0.0
crypto: ^3.0.3
package_info: ^2.0.2
syncfusion_flutter_calendar: ^22.2.9
syncfusion_flutter_calendar: ^24.1.44
async: ^2.11.0
animated_digit: ^3.2.1
syncfusion_flutter_pdfviewer: ^22.2.9
syncfusion_flutter_pdfviewer: ^24.1.44
photo_view: ^0.14.0
uuid: ^3.0.7
uuid: ^4.2.2
firebase_messaging: ^14.6.5
firebase_core: ^2.15.0
firebase_in_app_messaging: ^0.7.3+4
flutter_local_notifications: ^15.1.0+1
fluttertoast: ^8.2.2
flutter_local_notifications: ^16.3.0
fast_rsa: ^3.6.1
share_plus: ^7.1.0
flutter_split_view: ^0.1.2
@ -106,7 +105,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0
flutter_lints: ^3.0.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec