Skip to content

Instantly share code, notes, and snippets.

@adityagokula2210
Created November 12, 2024 11:16
Show Gist options
  • Select an option

  • Save adityagokula2210/1c6b35c4e99461479982665d7f0876df to your computer and use it in GitHub Desktop.

Select an option

Save adityagokula2210/1c6b35c4e99461479982665d7f0876df to your computer and use it in GitHub Desktop.
Call Action Enum
enum CallAction {
initiated("initiated"),
cancelled("cancelled"),
unanswered("unanswered"),
ongoing("ongoing"),
rejected("rejected"),
ended("ended"),
busy("busy"),
none(null);
const CallAction(this.value);
final String? value;
@override
String toString() => value ?? "";
static CallAction? fromValue(String? value) {
for (final option in CallAction.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