Skip to content

Instantly share code, notes, and snippets.

@GussRw
Last active July 21, 2023 00:31
Show Gist options
  • Save GussRw/def84bd1faa298985b9afa2f6f7e4830 to your computer and use it in GitHub Desktop.
Save GussRw/def84bd1faa298985b9afa2f6f7e4830 to your computer and use it in GitHub Desktop.
primal-branch-3015
abstract class Model {
}
class ServicioBase<T extends Model> {
String base_url = 'https://cceo.io';
String uri;
ServicioBase(this.uri);
void post() {
print('Uri: ${this.base_url}/${this.uri}');
}
}
class User implements Model {
}
class Sale implements Model {
}
class UsersService extends ServicioBase<User> {
UsersService() : super("users");
}
class SalesService extends ServicioBase<Sale> {
SalesService() : super("sales");
}
void main() {
var usersService = UsersService();
var salesService = SalesService();
usersService.post();
salesService.post();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment