1

I have a class that has a mixin generated through freezed. I have another class that has a mixin generated through freezed. I want to extend the second class, but I receive a type error because the mixin methods have differences.

Example:

class A with _$A {
  const factory A.initial() = _Initial;
}

class B with _$B {
  const factory B.final() = _Final;
}

I want:

class B extends A with _$B, _$A {  
  const factory B.final() = _Final;  
}

and then I should be able to use:

B.initial()
donoaga
  • 11
  • 2
  • 1
    1. Can you provide the exact error message? 2. Could you perhaps provide a simple, reproducible example that doesn't use `freezed`? 3. `class B extends A with _$B, _$A` doesn't make sense since `A` in your example already includes `_$A`. – jamesdlin Dec 16 '21 at 23:00
  • Looks like you don't want class B extends A with _$B, _$A but you want class B extends A with _$B as class A is defined as already having the mixin _$A – Bram Dec 19 '21 at 18:04

0 Answers0