Skip to content

Instantly share code, notes, and snippets.

@daiki1003
Created May 2, 2023 04:11
Show Gist options
  • Save daiki1003/6f45a0051c541cc11c8cf80b09c93c5d to your computer and use it in GitHub Desktop.
Save daiki1003/6f45a0051c541cc11c8cf80b09c93c5d to your computer and use it in GitHub Desktop.
enum Sample<T> {
hoge<int>(value: 0),
fuga<String>(value: 'I\'m fuga'),
withNull<int?>(value: null),
;
const Sample({required this.value});
final T value;
}
void main() {
print(Sample.hoge.value);
print(Sample.fuga.value);
print(Sample.withNull.value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment