Created with <3 with dartpad.dev.
Created
November 7, 2022 05:07
-
-
Save BrianCraig/5227427650d610304e36bddafa3e14ab to your computer and use it in GitHub Desktop.
solar-kingdom-8851
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 IIsEmpty{ | |
bool get isEmpty; | |
} | |
bool isEmptyList<T extends List>(T x) => x.isEmpty; | |
bool isEmptyMap<T extends Map>(T x) => x.isEmpty; | |
bool isEmpty<T extends IIsEmpty>(T x) => x.isEmpty; | |
void main() { | |
print(isEmptyList([])); | |
print(isEmptyMap({})); | |
print(isEmpty({})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment