Generics: Restricting the parameterized type

class Foo<T extends SomeBaseClass> { 
   // Implementation goes here... 
   String toString() => "Instance of 'Foo<$T>'"; 
} 

class Extender extends SomeBaseClass {...}

When implementing a generic type, you might want to limit the types of its parameters. You can do this using extends.

Related concepts

Restricting the parameterized type

Generics: Restricting the parameterized type — Structure map

Clickable & Draggable!

Generics: Restricting the parameterized type — Related pages: