Closed atom83 closed 2 years ago
sorry, found it already.
My users in Nextcloud do not have an E-Mail Adress,
and then in userdata.dart error happens at:
json['ocs']['data']['email'] as String,
Added E-Mail address => works like a charm now. Thanks for this Lib
Hi, Tried this simple example
Future createFolder() async { try { final client = NextCloudClient.withCredentials( Uri(host: '---'), 'xxx', 'xxx', ); final files = await client.webDav.ls('/'); for (final file in files){ print(file.path); } } on RequestException catch (e, stacktrace) { print(e.statusCode); print(e.body); print(stacktrace); } }
but get error: Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast E/flutter (28814): #0 new UserData.fromJson (package:nextcloud/src/user/userdata.dart:15:38) E/flutter (28814): #1 UserClient.getUser (package:nextcloud/src/user/client.dart:21:21) E/flutter (28814): ......
I did everything correct right?
Thanks for help.