I have this case where I am extending from a super class with methods being typed using Generics as the following:

Models
------

```dart
abstract class SuperClass { 

   //.....
}

class SubClass extends SuperClass {
  int a;
  int b;
  String c;
  //....
}

```

Controllers
-----------

```dart
abstract class A {
   T getDoc<T extends SuperClass>(T doc);
} 

class B extends A {
   T getDoc<T extends SubClass>(T doc) {     //<================ Error
       //....
    }       
}

```

Basically class `B` will only deal with a `SubClass` model and any class that extends it. Extending `SuperClass` is not enough. It's a way to enforce the type usage. I could add a helper function that will check the type for each method within class `B` (`doc is SubClass`) but seems like a lot repetition.

But the above architecture fails when overriding the method `getDoc` in class B saying that it isn't a valid override although `SubClass` is a `SuperClass`. How can I achieve something like this? Or is there a better way of doing it? Appreciate any pointers :)