Skip to content

Instantly share code, notes, and snippets.

@adityagokula2210
Created November 12, 2024 11:15
Show Gist options
  • Save adityagokula2210/e0d34f4365c7bebe9b49d78bfe41b031 to your computer and use it in GitHub Desktop.
Save adityagokula2210/e0d34f4365c7bebe9b49d78bfe41b031 to your computer and use it in GitHub Desktop.
Call Type Enum
enum CallType {
audio("audio"),
video("video"),
none(null);
const CallType(this.value);
final String? value;
@override
String toString() => value ?? "";
static CallType? fromValue(String? value) {
for (final option in CallType.values) {
if (option.value == value) {
return option;
}
}
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment