Is it possible to add an interface to a Dart extension? In Swift you can do this:
protocol MyProtocol {
associatedtype Item
mutating func nextItem() -> Item?
}
extension MyClass: MyProtocol {
public typealias Item = T
public mutating func nextItem() -> T? {
// ...
}
}
How do you do that in Dart? It seems this is not possible:
extension MyClassExtension<T> on MyClass implements MyInterface {
T? nextItem() {
// ...
}
}