I understand that the generic can be limited to inherit, extend, implement X or Y class, whether abstract or not.
Future<void> getInfo<T extends BaseModel>({required String extraUri})
But how can I use the methods that that interface gives to its children? Something like:
T.inheritMethodCall();
Pass object to this function and call method:
Future<void> getInfo<T extends BaseModel>(T t, {required String extraUri}) {
t.inheritMethodCall();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.