0

appwrite is added in my dependency still i am not able to import 'package:appwrite/appwrite/models.dart'; I am getting this Target of URI doesn't exist: 'package:appwrite/appwrite/models.dart'. Try creating the file referenced by the URI, or try using a URI for a file that does exist.darturi_does_not_exist package:appwrite/appwrite/models.dart

I want to use Account which is inside models i.e. models.Account I am able to import 'package:appwrite/appwrite.dart' but not 'package:appwrite/appwrite/models.dart' I have also tried importing 'package:appwrite/models.dart' this solve the problem of not able to import appwrite/models but still I am not able to use models.Account I have tried updating dependency but still not able to figure out what is wrong.

I have tried running flutter pub get and also tried restarting vscode.

2 Answers2

0

I think that you should be able to use import 'package:appwrite/models.dart' as the structure on GitHub implies https://github.com/appwrite/sdk-for-flutter/tree/master/lib

When you are using the import it should be enough to use Account instead of models.Account.

Alternatively you could use import 'package:appwrite/models.dart' as models and then use models.Account.

Here is an example project for using appwrite: https://github.com/appwrite/playground-for-flutter/blob/master/lib/main.dart

Jannik
  • 11
  • 1
  • 2
0

So appwrite update this recently because Account class appears in both appwrite.dart and models.dart. So they changed Account to User. Try using models.User instead of models.Account

Hope that helps.