Skip to content

Instantly share code, notes, and snippets.

@guid-empty
Created February 25, 2021 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guid-empty/175ea9236fd3cd5f7827831568566f47 to your computer and use it in GitHub Desktop.
Save guid-empty/175ea9236fd3cd5f7827831568566f47 to your computer and use it in GitHub Desktop.
Dart.Language.Classes & Implementation the interfaces
void main() {
final entity = Entity();
print(entity is Disposable);
print(entity is Clonable);
print(entity is Comparable);
print(entity is BaseEntity);
// entity.
}
abstract class Clonable {
dynamic clone();
}
abstract class Disposable {
void dispose();
}
abstract class Comparable {
int compare();
}
abstract class BaseEntity {
int get id;
}
class Entity extends BaseEntity implements Clonable, Disposable, Comparable {
@override
clone() {
throw UnimplementedError();
}
@override
int compare() {
throw UnimplementedError();
}
@override
void dispose() {}
@override
int get id => throw UnimplementedError();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment