import 'package:flutter/material.dart'; class Files extends StatefulWidget { const Files({Key? key}) : super(key: key); @override State createState() => _FilesState(); } class _FilesState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { //Provider.of(context, listen: false).run(); }); super.initState(); } @override Widget build(BuildContext context) { // log("NEW CLIENT"); // Client client = newClient( // "https://***REMOVED***:***REMOVED***@cloud.marianum-fulda.de/remote.php/dav/files/***REMOVED***/", // user: "***REMOVED***", // password: "***REMOVED***", // debug: true // ); // // // client.setHeaders( // // { // // "User-Agent": "Marianum Fulda/Alpha0.1 (Development build) ; https://mhsl.eu/id.html", // // } // // ); // // log("DATA"); // log(client.readDir("/").toString()); // Future> files = Client("https://cloud.marianum-fulda.de/remote.php/dav/files/***REMOVED***", "***REMOVED***", "***REMOVED***").ls(); // log(files.toString()); // log("REQUEST FINISH"); // // files.then((asd) => { // asd.forEach((element) { // log(element.name); // }), // }); // var client = NextcloudClient("https://cloud.marianum-fulda.de", username: "***REMOVED***", password: "***REMOVED***"); // // //client.baseHeaders.putIfAbsent("Authorization", () => "Basic ***REMOVED***"); // //client.authentication?.headers.putIfAbsent("Authorization", () => "Basic ***REMOVED***"); // //client.webdav.rootClient.baseHeaders.putIfAbsent("Authorization", () => "Basic ***REMOVED***"); // // client.webdav.ls("/").then((value) => () { // log("TEST"); // value.forEach((element) { // log(element.name); // }); // }); return const Center( child: Text("Currently not implemented!"), ); // return Consumer( // builder: (context, data, child) { // // if(data.primaryLoading()) { // return const Center(child: CircularProgressIndicator()); // } // // List entries = List.empty(growable: true); // // data.listFilesResponse.files.forEach((element) { // entries.add(ListTile( // title: Text(element.name ?? "?"), // leading: Icon(element.isDir ?? false ? Icons.folder : Icons.file_copy_outlined), // onTap: () { // if(element.isDir ?? false) { // // TODO: Open Folder // } else { // // TODO: Open an File // } // }, // // onLongPress: () { // showModalBottomSheet( // context: context, // builder: (context) { // return ListView( // children: [ // ListTile( // leading: const Icon(Icons.delete), // title: Text("'${element.name?.replaceRange(20, element.name?.length, " ...")}' Löschen"), // ), // const ListTile( // leading: Icon(Icons.share), // title: Text("Teilen"), // ) // ], // ); // }, // ); // }, // )); // }); // // return ListView(children: entries); // }, // ); } }