I'm trying to get my lint rules cleared and having a hard time finding a solution for 'implicit_this_reference_in_initializer'
class MyModel extends MyEntity {
MyModel({ required this.myId, required this.myName } )
: super(myId: tmyId, myName: tmyName);
int tmyId;
String tmyName;
factory MyModel.fromJson(Map<String, dynamic> json) => MyModel(
myId : (json['my_id'] as num).toInt(),
myName : (json['my_name'] as String).toString() );
The above code produces the implicient this reference in initializer error.
If I switch to using the same variable names: myId and myName I get the lint rule: 'overrides-fields' : Don't override fields for: int myId; and String myName; variables.
At this point, I'm opting to just take the L(int..hah! get it? L ..lint...) for the error 'Don't override fields' as that seems the lesser of two evils.
Pointers appreciated.