Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target of Backlink does not exist for IsarLinks #1597

Closed
3 tasks done
kanntim opened this issue Apr 15, 2024 · 1 comment
Closed
3 tasks done

Target of Backlink does not exist for IsarLinks #1597

kanntim opened this issue Apr 15, 2024 · 1 comment

Comments

@kanntim
Copy link

kanntim commented Apr 15, 2024

Steps to Reproduce

When I try to make a @Backlink using IsarLinks, I get the error "Target of Backlink does not exist".
Even the code from the official example gives the same error:

Code sample

@collection
class Teacher {
  Id id = Isar.autoIncrement;

  late String subject;

  @Backlink(to: 'teacher')
  final student = IsarLinks<Student>();
}

@collection
class Student {
  Id? id = Isar.autoIncrement;

  late String name;
  
}

The ERROR:

Target of Backlink does not exist
package:app/entity.dart:10:9
   ╷
10 │   final student = IsarLinks<Student>();
   │         ^^^^^^^
   ╵

Details

  • Platform: Android 13, API Level 33, x86_64 Android Emulator on Linux.
  • Flutter version: [3.19.5]
  • Isar version: 3.1.0+1

  • I searched for similar issues already
  • I filled the details section with the exact device model and version
  • I am able to provide a reproducible example
@kanntim kanntim closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@kanntim kanntim reopened this Apr 15, 2024
@JunhuaAhuaChen
Copy link

JunhuaAhuaChen commented May 23, 2024

@kanntim
Student() no have IsarLinks,so no backlink.
You can

@collection
class Teacher {
  Id id = Isar.autoIncrement;

  late String subject;

  @Backlink(to: 'name')
  final student = IsarLinks<Student>();
}

@collection
class Student {
  Id? id = Isar.autoIncrement;

  final name=IsarLinks<Teacher>();
  
}

@kanntim kanntim closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants