isar / isar/isar

Include better error message when extending from Equatable

Open
#1,463 3 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
4k
Forks
602
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Whenever a model extends a class from an external package it is not possible to add `@ignore` on its members. For example, this happens when extending from `Equatable`, it even has its own dedicated discussion https://github.com/isar/isar/discussions/648.

When running the isar_generator the error messages are quite handy but suggesting to add `@Collection(inheritance: false)` (or equivalent) is not included within the error message.

**Describe the solution you'd like**
As a developer, I would like the isar_generator to inform me to include `@Collection(inheritance: false)` whenever I'm inheriting from an external library (or any other case where adding `@ignore` in the super's member is not possible).

**Version**
- Platform: N/A
- Flutter version: 3.13.7
- Isar version: ^3.1.0+1

Contributor guide

Open the contributing guide

Research direction

The issue does not name a file or test; begin by locating isar_generator's existing diagnostic for inherited members and how it handles @Collection(inheritance: false). Confirm the message explains this option when @ignore cannot be added to a superclass member, then run the generator's relevant tests or reproduction to verify the guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
database, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.