Created
November 12, 2024 11:15
-
-
Save adityagokula2210/e0d34f4365c7bebe9b49d78bfe41b031 to your computer and use it in GitHub Desktop.
Call Type Enum
This file contains hidden or 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
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