Skip to content

Instantly share code, notes, and snippets.

@tech-andgar
Created March 27, 2023 18:18
Show Gist options
  • Save tech-andgar/b11619b5f95f104cab9697621bd1c4c7 to your computer and use it in GitHub Desktop.
Save tech-andgar/b11619b5f95f104cab9697621bd1c4c7 to your computer and use it in GitHub Desktop.
Check Generic Type Dart
void main() {
checkGenericType<String>('Hello');
}
checkGenericType<T>(T value) {
print(T.toString());
if (T is String) {
print('l');
}
if (value is String) {
print('2');
}
if (T == String) {
print('3');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment