Created with <3 with dartpad.dev.
Last active
July 21, 2023 00:31
-
-
Save GussRw/def84bd1faa298985b9afa2f6f7e4830 to your computer and use it in GitHub Desktop.
primal-branch-3015
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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