I am using an extension name Dart data class generator and I allow it to use equatable package but for some reason it gave me this error
The error on the import line is :"Unused import: 'package:equatable/equatable.dart'.
Try removing the import directive."
Asked
Active
Viewed 534 times
1

Ken
- 57
- 6
-
Can you include the code-snippet instead of code-image that will reproduce the error? More about [minimal-reproducible-example](https://stackoverflow.com/help/minimal-reproducible-example) – Md. Yeasin Sheikh Aug 27 '22 at 12:38
-
Can you show us the code behind the error dialog? – julemand101 Aug 27 '22 at 12:52
-
And what warning do you get from the import line? – julemand101 Aug 27 '22 at 13:03
-
The waring on the import line is :"Unused import: 'package:equatable/equatable.dart'. Try removing the import directive." – Ken Aug 27 '22 at 13:06
-
1DDCG does not need Equatable. It puts its own code in for that, and better than Equatable can do. – Randal Schwartz Aug 27 '22 at 15:06
1 Answers
0
You forget to add props override, try this:
class BaseCustom extends Equatable {
final int? status;
...
BaseCustom({this.status, ...});
@override
// TODO: implement props
List<Object> get props =>[status, and other variable];
}

eamirho3ein
- 16,619
- 2
- 12
- 23