diff --git a/lib/api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart b/lib/api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart index c6f1491..7c64a59 100644 --- a/lib/api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart +++ b/lib/api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart @@ -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; diff --git a/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart b/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart index b5b281a..72330a2 100644 --- a/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart +++ b/lib/api/marianumcloud/webdav/queries/listFiles/listFiles.dart @@ -14,7 +14,7 @@ class ListFiles extends WebdavApi { @override Future run() async { - List davFiles = (await (await WebdavApi.webdav).propfind(Uri.parse(params.path))).toWebDavFiles(); + List davFiles = (await (await WebdavApi.webdav).propfind(PathUri.parse(params.path))).toWebDavFiles(); Set files = davFiles.map((e) => CacheableFile.fromDavFile(e)).toSet(); // webdav handles subdirectories wrong, this is a fix diff --git a/lib/main.dart b/lib/main.dart index be781d8..7c14aef 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -113,7 +113,7 @@ class _MainState extends State
{ locale: const Locale('de'), title: 'Marianum Fulda', - + themeMode: settings.val().appTheme, theme: LightAppTheme.theme, darkTheme: DarkAppTheme.theme, diff --git a/lib/notification/notificationService.dart b/lib/notification/notificationService.dart index fcdf332..cbb5758 100644 --- a/lib/notification/notificationService.dart +++ b/lib/notification/notificationService.dart @@ -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, - ); - } } \ No newline at end of file diff --git a/lib/theming/darkAppTheme.dart b/lib/theming/darkAppTheme.dart index 4bc9850..156b234 100644 --- a/lib/theming/darkAppTheme.dart +++ b/lib/theming/darkAppTheme.dart @@ -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, diff --git a/lib/theming/lightAppTheme.dart b/lib/theming/lightAppTheme.dart index 7f0c835..9ce27ee 100644 --- a/lib/theming/lightAppTheme.dart +++ b/lib/theming/lightAppTheme.dart @@ -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, diff --git a/lib/view/pages/files/fileElement.dart b/lib/view/pages/files/fileElement.dart index bb18be6..aa9554b 100644 --- a/lib/view/pages/files/fileElement.dart +++ b/lib/view/pages/files/fileElement.dart @@ -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 { 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()); } )); diff --git a/lib/view/pages/files/fileUploadDialog.dart b/lib/view/pages/files/fileUploadDialog.dart index 95f6ffa..c7eb658 100644 --- a/lib/view/pages/files/fileUploadDialog.dart +++ b/lib/view/pages/files/fileUploadDialog.dart @@ -43,7 +43,7 @@ class _FileUploadDialogState extends State { setState(() { state = FileUploadState.checkConflict; }); - List result = (await webdavClient.propfind(Uri.parse(widget.remotePath.join("/")))).responses; + List 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 { } } - Future uploadTask = webdavClient.putFile(File(widget.localPath), FileStat.statSync(widget.localPath), Uri.parse(fullRemotePath)); // TODO use onProgress from putFile + Future uploadTask = webdavClient.putFile(File(widget.localPath), FileStat.statSync(widget.localPath), PathUri.parse(fullRemotePath)); // TODO use onProgress from putFile uploadTask.then((value) => Future.value(value)).catchError((e) { setState(() { state = FileUploadState.error; diff --git a/lib/view/pages/files/files.dart b/lib/view/pages/files/files.dart index 628b64e..465bd36 100644 --- a/lib/view/pages/files/files.dart +++ b/lib/view/pages/files/files.dart @@ -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 { }, 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")), diff --git a/lib/view/pages/talk/components/chatTextfield.dart b/lib/view/pages/talk/components/chatTextfield.dart index 9aea0b9..32799b6 100644 --- a/lib/view/pages/talk/components/chatTextfield.dart +++ b/lib/view/pages/talk/components/chatTextfield.dart @@ -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 { 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( diff --git a/pubspec.yaml b/pubspec.yaml index 3ce4622..d0bd123 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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